.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ======= overLIB ======= :Author: Kasper Skårhøj :Created: 2002-11-01T00:32:00 :Changed by: René Fritz :Changed: 2003-06-23T14:49:31 :Author: René Fritz :Email: r.fritz@colorcube.de :Info 3: :Info 4: .. _overLIB: overLIB ======= Extension Key: **overlib** Copyright 2000-2002, René Fritz, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.com .. _Table-of-Contents: Table of Contents ----------------- **EXT: overLIB 1** **Introduction 1** **Users manual 1** **Configuration 2** Reference 2 **Known problems 3** .. _Introduction: Introduction ------------ overLIB is a JavaScript library (by Erik Bosrup) to show tooltips on HTML pages. This extension provide overLIB itself and a PHP library to create tooltips easily from PHP. **This extension is only useful for PHP developers!** |img-1| overLIB is a third party library (independent from TYPO3) and uses it's own license. For license check and further documentation of overLIB go to `http://www.bosrup.com/web/overlib/ `_ .. _Users-manual: Users manual ------------ Have a look at the extension Tooltip Tag (cc\_typotag\_tooltip) which is a good example for overlib usage. .. _Example-code: Example code ^^^^^^^^^^^^ Here's example code how to use the PHP class tx\_overlib. The examples goes through an array of records and creates and returns an array with links including tooltips. The red lines are calls of the class tx\_overlib. Green lines show configuration that will be passed to the tx\_overlib functions. First of all the tx\_overlib class needs to be included: :: require_once(t3lib_extMgm::extPath("overlib")."class.tx_overlib.php"); A function of our example class: :: /** * returns an array of glossary terms */ function main($shortArr,$conf){ $conf["termMinLength"]=$conf["termMinLength"]?$conf["termMinLength"]:3; $conf["linkTermAppend"]=$conf["linkTermAppend"]?$conf["linkTermAppend"]:'*'; tx_overlib::setDefaults($conf["overlibDefaults."]); tx_overlib::includeLib(); if (!is_array($shortArr)) { $shortArr = array(); } $shortRows = $this->getList($conf); if (count($shortRows)) { $config = $conf["overlibConfig"]; $aTagParams = $conf["ATagParams"]; reset($shortRows); while(list(,$row)=each($shortRows)) { $caption = $conf["overlibFixedCaption"] ? $conf["overlibFixedCaption"]: ($conf["overlibCaption"] ? $row["term"] : ""); $desc = $row["tooltip"]?$row["tooltip"]:$row["description"]; $desc=trim(implode("
",t3lib_div::trimExplode(chr(10),htmlspecialchars($desc),0))); if (strlen($row["term"])>=$conf["termMinLength"] AND $desc) { if ($conf["linkWholeTerm"]) { $shortArr[$row["term"]]=tx_overlib::linkToolTip($row["term"].$conf["linkWholeTermAppend"], t3lib_div::slashJS($desc), $aTagParams,$caption,$config); } else { $shortArr[$row["term"]]=$row["term"].tx_overlib::linkToolTip($conf["linkTermAppend"], t3lib_div::slashJS($desc), $aTagParams,$caption,$config); } } } } return $shortArr; } Please note that the class can be used without making an instance: tx\_overlib::includeLib() .. _Configuration: Configuration ------------- Default values of overLIB can be set by TypoScript: :: plugin.tx_overlib.defaults { ol_fgcolor = "#eeeeee" ol_bgcolor = "#666666" } You can use tx\_overlib::setDefaults() (see below) to set your own default values from your plugin. For now it sets also the global default values which may change later so you will be able to use more than one tooltip look on your page. .. _Reference: Reference ^^^^^^^^^ .. _generated: ((generated)) """"""""""""" .. _TypoScript: TypoScript ~~~~~~~~~~ .. ### BEGIN~OF~TABLE ### .. _defaults: defaults '''''''' .. container:: table-row Property defaults Data type array of strings Description See overLIB Documentation for configuration values. Example: :: plugin.tx_overlib.defaults { ol_fgcolor = "#eeeeee" ol_bgcolor = "#666666" } Default .. ###### END~OF~TABLE ###### [tsref:plugin.tx\_overlib] .. _PHP-functions-in-class-tx-overlib: PHP functions in class tx\_overlib ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. ### BEGIN~OF~TABLE ### .. _includeLib: **includeLib()** '''''''''''''''' .. container:: table-row Function/Property **includeLib()** Data type Description Include the overLIB library and other data for page rendering. Any configuration has to be done before with functions setDefaultValue()/setDefaults(). Default .. _setDefaultValue: **setDefaultValue()** ''''''''''''''''''''' .. container:: table-row Function/Property **setDefaultValue()** Data type Description Set configuration values of overLIB. Default .. _name: *$name* ''''''' .. container:: table-row Function/Property *$name* Data type string Description :: 'ol_fgcolor' Default .. _value: *$value* '''''''' .. container:: table-row Function/Property *$value* Data type string Description :: '"#eeeeee"' Default .. _setDefaults: **setDefaults()** ''''''''''''''''' .. container:: table-row Function/Property **setDefaults()** Data type Description Set configuration values of overLIB per array. Default .. _arr: $arr '''' .. container:: table-row Function/Property $arr Data type array Description :: array('ol_fgcolor' => '"#eeeeee"') Default .. _linkToolTip: **linkToolTip()** ''''''''''''''''' .. container:: table-row Function/Property **linkToolTip()** Data type Description Default .. _linkContent: *$linkContent* '''''''''''''' .. container:: table-row Function/Property *$linkContent* Data type string Description String that should be linked. Default .. _boxContent: *$boxContent* ''''''''''''' .. container:: table-row Function/Property *$boxContent* Data type string Description The content that should appear inside of the tooltip. Default .. _aTagParams: *$aTagParams* ''''''''''''' .. container:: table-row Function/Property *$aTagParams* Data type string Description Additional parameters of the A tag. Default “” .. _caption: *$caption* '''''''''' .. container:: table-row Function/Property *$caption* Data type string Description Caption of the tooltip. Default “” .. _config: *$config* ''''''''' .. container:: table-row Function/Property *$config* Data type string Description overLIB configuration. :: 'STICKY,WIDTH,250' Default “” .. ###### END~OF~TABLE ###### .. _Known-problems: Known problems -------------- The configuration values which set fonts, colors, and so on, can only be set globally per page. If you want e.g. different colored tooltips on one page you have to pass the corresponding parameters to overLIB in every link. .. _Changelog: Changelog --------- rewrite of the overLIB JS code. The JS code is now encapsulated in the var 'overlib'. Should work without changes to your plugins.This was necessary to prevent collision with other JS code. |img-2| overLIB - 3 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 133 .. :id: Graphic4 .. :name: Graphic4 .. :width: 491 .. |img-2| image:: img-2.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102