[+] BO : New AdminController system, including smarty backoffice, thanks to Raphael and Thomas
This commit is contained in:
+9
-8
@@ -47,16 +47,13 @@ class ChartCore
|
||||
if (!self::$poolId)
|
||||
{
|
||||
++self::$poolId;
|
||||
echo '
|
||||
<!--[if IE]><script type="text/javascript" src="'.PS_BASE_URI.'js/jquery/excanvas.min.js"></script><![endif]-->
|
||||
<script type="text/javascript" src="'.PS_BASE_URI.'js/jquery/jquery.flot.min.js"></script>';
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/** @prototype void public function __construct() */
|
||||
public function __construct()
|
||||
{
|
||||
self::init();
|
||||
++self::$poolId;
|
||||
}
|
||||
|
||||
@@ -101,7 +98,11 @@ class ChartCore
|
||||
/** @prototype void public function display() */
|
||||
public function display()
|
||||
{
|
||||
$options = '';
|
||||
echo $this->fetch();
|
||||
}
|
||||
|
||||
public function fetch()
|
||||
{
|
||||
if ($this->timeMode)
|
||||
{
|
||||
$options = 'xaxis:{mode:"time",timeformat:\''.addslashes($this->format).'\',min:'.$this->from.'000,max:'.$this->to.'000}';
|
||||
@@ -117,7 +118,7 @@ class ChartCore
|
||||
$jsCurves[] = $curve->getValues($this->timeMode);
|
||||
|
||||
if (count($jsCurves))
|
||||
echo '
|
||||
return '
|
||||
<div id="flot'.self::$poolId.'" style="width:'.$this->width.'px;height:'.$this->height.'px"></div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
@@ -125,7 +126,7 @@ class ChartCore
|
||||
});
|
||||
</script>';
|
||||
else
|
||||
echo ErrorFacade::Display(PS_ERROR_UNDEFINED, 'No values for this chart.');
|
||||
return ErrorFacade::Display(PS_ERROR_UNDEFINED, 'No values for this chart.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,4 +176,4 @@ class Curve
|
||||
if (array_key_exists((string)$x, $this->values))
|
||||
return $this->values[(string)$x];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user