Оптимизации и исправления топов.
This commit is contained in:
parent
77fa3dbd5e
commit
0f4b2fb722
25 changed files with 109 additions and 53 deletions
|
|
@ -33,13 +33,16 @@ class Tools_TemplateImage
|
|||
protected $data = array();
|
||||
protected $base = "c:\\windows\\fonts\\";
|
||||
protected $image;
|
||||
protected $prepare = true;
|
||||
protected $_prepare = true;
|
||||
public $debug = false;
|
||||
|
||||
function __construct ($template = false)
|
||||
public $resource;
|
||||
public $filename;
|
||||
|
||||
function __construct ($template = null)
|
||||
{
|
||||
// assert(is_string($src));
|
||||
if($template) {
|
||||
if ($template) {
|
||||
$this->data = $template;
|
||||
}
|
||||
}
|
||||
|
|
@ -116,7 +119,7 @@ class Tools_TemplateImage
|
|||
return "";
|
||||
}
|
||||
|
||||
function imageText($text, $value)
|
||||
function imageText($text, /*.stdClass.*/$value)
|
||||
{
|
||||
assert(is_string($text));
|
||||
|
||||
|
|
@ -134,7 +137,7 @@ class Tools_TemplateImage
|
|||
}
|
||||
|
||||
if ($value->valign[0]) {
|
||||
$valign = Drawing::ALIGN_TOP;
|
||||
$valign = Tools_Drawing::ALIGN_TOP;
|
||||
} elseif ($value->valign[1]) {
|
||||
$valign = Tools_Drawing::ALIGN_CENTER;
|
||||
} else {
|
||||
|
|
@ -159,7 +162,7 @@ class Tools_TemplateImage
|
|||
{
|
||||
$width = imagesx($this->image);
|
||||
$height = imagesy($this->image);
|
||||
if($new_height == false) {
|
||||
if ($new_height == null) {
|
||||
$new_height = ceil($height * $new_width / $width);
|
||||
}
|
||||
|
||||
|
|
@ -171,8 +174,8 @@ class Tools_TemplateImage
|
|||
}
|
||||
|
||||
function prepare() {
|
||||
if($this->prepare) {
|
||||
$this->prepare = false;
|
||||
if($this->_prepare) {
|
||||
$this->_prepare = false;
|
||||
foreach ($this->data as $value) {
|
||||
$this->imageText($value->text, $value); // break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue