summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--frontends/php/include/classes/pie.inc.php7
-rw-r--r--frontends/php/js/cookies.js26
2 files changed, 18 insertions, 15 deletions
diff --git a/frontends/php/include/classes/pie.inc.php b/frontends/php/include/classes/pie.inc.php
index b2a8d483..da2a71d4 100644
--- a/frontends/php/include/classes/pie.inc.php
+++ b/frontends/php/include/classes/pie.inc.php
@@ -94,7 +94,6 @@ function selectData(){
$from_time = $this->from_time;
$to_time = $this->to_time;
-// $calc_field = 'round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)'; /* required for 'group by' support of Oracle */
$sql_arr = array();
if(($this->period / $this->sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL)){
@@ -253,7 +252,6 @@ function calcExplodedCenter($anglestart,$angleend,$x,$y,$count){
$y+= round($count * sin(deg2rad($anglemid)));
$x+= round($count * cos(deg2rad($anglemid)));
-// SDI($x.' xy '.$y);
return array($x,$y);
}
@@ -522,9 +520,7 @@ function Draw(){
$this->sizeX = min($this->sizeX,$this->sizeY);
$this->sizeY = min($this->sizeX,$this->sizeY);
-// SDI($this->graphheight3d);
$this->calc3dhight($this->sizeY);
-// SDI($this->graphheight3d);
$this->exploderad = (int) $this->sizeX / 100;
$this->exploderad3d = (int) $this->sizeX / 60;
@@ -573,10 +569,7 @@ function Draw(){
$values[$item] = abs($data->lst);
break;
}
-// $this->sum += $values[$item];
}
-// $this->SwitchPie3D();
-// $this->SwitchPieExploded();
switch($this->type){
case GRAPH_TYPE_EXPLODED:
diff --git a/frontends/php/js/cookies.js b/frontends/php/js/cookies.js
index b080533f..c2094f2f 100644
--- a/frontends/php/js/cookies.js
+++ b/frontends/php/js/cookies.js
@@ -17,13 +17,14 @@
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
// JavaScript Document
-
var cookie ={
+cookies: new Array(),
+
init: function () {
var allCookies = document.cookie.split('; ');
for (var i=0;i<allCookies.length;i++) {
var cookiePair = allCookies[i].split('=');
- this[cookiePair[0]] = cookiePair[1];
+ this.cookies[cookiePair[0]] = cookiePair[1];
}
},
@@ -37,28 +38,37 @@ create: function (name,value,days) {
}
document.cookie = name+"="+value+expires+"; path=/";
- this[name] = value;
+ this.cookies[name] = value;
},
read : function(name){
- if(typeof(this[name]) != 'undefined'){
- return this[name];
+ if(typeof(this.cookies[name]) != 'undefined'){
+ return this.cookies[name];
} else {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
- if(c.indexOf(nameEQ) == 0) return this[name] = c.substring(nameEQ.length,c.length);
+ if(c.indexOf(nameEQ) == 0) return this.cookies[name] = c.substring(nameEQ.length,c.length);
}
}
return null;
},
+printall: function() {
+ var allCookies = document.cookie.split('; ');
+ for (var i=0;i<allCookies.length;i++) {
+ var cookiePair = allCookies[i].split('=');
+
+ alert("[" + cookiePair[0] + "] is " + cookiePair[1]); // assumes print is already defined
+ }
+},
+
erase: function (name) {
this.create(name,'',-1);
- this[name] = undefined;
+ this.cookies[name] = undefined;
}
-
}
+
cookie.init(); \ No newline at end of file