- <?php
-
-
- /**
- * class file.
- *
- * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
- * @copyright 2005, diemeisterei GmbH. All rights reserved.
- * @author $Author: schmunk $
- * @version $Revision: 237 $ $Date: 2006-05-31 01:45:51 +0200 (Mi, 31 Mai 2006) $
- * @package Lithron.LContainer
- * @subpackage WebControls
- */
-
- /**
- * Displays an Image Button that has an overlib help text
- *
- * @package System.Web.UI.WebControls
- * @subpackage BrickSupport
- */
-
- class LImageButton extends TImageButton
- {
- /**
- * Turn overlib help system on/off
- */
- protected $overlib_enabled;
-
-
- /**
- * @return wheter overlib tooltips are enablead or not
- */
- public function getOverlibEnabled()
- {
- return $this->getViewState("OL_enable", true);
- }
-
- /**
- * @param string
- */
- public function setOverlibEnabled($value)
- {
- $this->setViewState("OL_enable", $value, true);
- }
-
- /**
- * @return overlib tooltip
- */
- public function getOverlibToolTip()
- {
- return $this->getViewState("OL_tt");
- }
-
- /**
- * @param string
- */
- public function setOverlibToolTip($value)
- {
- $this->setViewState("OL_tt", $value);
- }
-
- /**
- * prepares tooltip if enabled
- */
- public function onPreRender($param)
- {
- parent::onPreRender($param);
-
- if ($this->OverlibEnabled && $this->ToolTip && !$this->OverlibToolTip)
- {
- $this->parseToolTip();
- if ($this->OverlibEnabled)
- {
- $this->OverlibToolTip = $this->ToolTip;
- $this->ToolTip = "";
- }
- }
-
- if ($this->OverlibEnabled)
- {
- $script_url = $this->publishAsset("overlib/overlib.js");
- $bg_url = $this->publishAsset("icons/bg_75black.png");
- $scriptMgr = $this->Page->ClientScript;
- $scriptMgr->registerScriptFile("overlib", $script_url);
- $ol = "RELX, 10, RELY, -10, WIDTH, '500', HEIGHT, '30', TEXTFONT, 'Arial', TEXTSIZE, '1.3em', TEXTCOLOR, '#FFFFFF', BACKGROUND, '$bg_url'";
- $this->Attributes->add("onmouseover", "overlib('".$this->getOverlibToolTip()."', $ol);");
- $this->Attributes->add("onmouseout", "nd();");
- }
- }
-
-
-
- /**
- * @ignore
- */
- private function parseToolTip()
- {
- // find brick & cell
- $brick = $this->Parent;
- while($brick && !($brick instanceof LBrick)) $brick = $brick->Parent;
- $cell = $this->Parent;
- while($cell && !($cell instanceof LCell)) $cell = $cell->Parent;
-
- $my_smarty = array();
- if (is_object($brick))
- {
- $my_smarty["{brick_id}"] = $brick->BrickObject->getId();
- $my_smarty["{brick_name}"] = $brick->getDescriptiveName();
- }
- if (is_object($cell))
- {
- $my_smarty["{cell_position}"] = $cell->getId();
- }
- $this->setToolTip(strtr($this->getToolTip(), $my_smarty));
- }
-
- }
- ?>