| 523 | | $wm = ImageStdParams::get_watermark(); |
| 524 | | |
| 525 | | $position = 'custom'; |
| 526 | | if ($wm->xpos == 0 and $wm->ypos == 0) |
| 527 | | { |
| 528 | | $position = 'topleft'; |
| 529 | | } |
| 530 | | if ($wm->xpos == 100 and $wm->ypos == 0) |
| 531 | | { |
| 532 | | $position = 'topright'; |
| 533 | | } |
| 534 | | if ($wm->xpos == 50 and $wm->ypos == 50) |
| 535 | | { |
| 536 | | $position = 'middle'; |
| 537 | | } |
| 538 | | if ($wm->xpos == 0 and $wm->ypos == 100) |
| 539 | | { |
| 540 | | $position = 'bottomleft'; |
| 541 | | } |
| 542 | | if ($wm->xpos == 100 and $wm->ypos == 100) |
| 543 | | { |
| 544 | | $position = 'bottomright'; |
| 545 | | } |
| 546 | | |
| 547 | | if ($wm->xrepeat != 0) |
| 548 | | { |
| | 523 | if ($template->get_template_vars('watermark') === null) |
| | 524 | { |
| | 525 | $wm = ImageStdParams::get_watermark(); |
| | 526 | |
| 552 | | $template->assign( |
| 553 | | 'watermark', |
| 554 | | array( |
| 555 | | 'file' => $wm->file, |
| 556 | | 'minw' => $wm->min_size[0], |
| 557 | | 'minh' => $wm->min_size[1], |
| 558 | | 'xpos' => $wm->xpos, |
| 559 | | 'ypos' => $wm->ypos, |
| 560 | | 'xrepeat' => $wm->xrepeat, |
| 561 | | 'opacity' => $wm->opacity, |
| 562 | | 'position' => $position, |
| 563 | | ) |
| 564 | | ); |
| 565 | | |
| 566 | | $template->append( |
| 567 | | 'watermark', |
| 568 | | array(), |
| 569 | | true |
| 570 | | ); |
| | 554 | $template->assign( |
| | 555 | 'watermark', |
| | 556 | array( |
| | 557 | 'file' => $wm->file, |
| | 558 | 'minw' => $wm->min_size[0], |
| | 559 | 'minh' => $wm->min_size[1], |
| | 560 | 'xpos' => $wm->xpos, |
| | 561 | 'ypos' => $wm->ypos, |
| | 562 | 'xrepeat' => $wm->xrepeat, |
| | 563 | 'opacity' => $wm->opacity, |
| | 564 | 'position' => $position, |
| | 565 | ) |
| | 566 | ); |
| | 567 | } |
| | 568 | |