*/ if (!is_object($this)) die ('Error: No parent object present.'); /*************************************************************** TypoScript config: .data [string / stdWrap] The data for the notes. Every line is a new note. Each line is divided by "|" where the first part is the test, the second part is the type (1-) and the third part is the optional link (typolink-format) .charsPerLine [string] The max number of chars per line of text on the note. .images.[x] [image-contentObjects] [x] is the type-number defined by the second parameter in each line of data. .textBox { chars integer, the number of chars on each line lineDist integer, the number of pixels between each line tmplObjNumber integer, pointer to the GIFBUILDER-OBJECT (of type TEXT!!) which serves as a TEMPLATE for the objects used to create the textlines Valign string. If set to "center", the tmplObjNumber-TEXT-object is expected to be centeret in the image and calculations will be done to spred the lines above and below in case of multiple lines. (based on .angle of the TEXT object also.) maxLines } Example: // Postit: tt_content.splash.20 = PHP_SCRIPT tt_content.splash.20 { file = media/scripts/postit.inc data.field = bodytext cols = 3 textBox { chars = 16 lineDist = 18 tmplObjNumber = 100 Valign = center maxLines = 5 } typolink { parameter.current = 1 extTarget = {$styles.content.links.extTarget} target = {$styles.content.links.target} } images.1 = IMAGE images.1.file = GIFBUILDER images.1.file { XY = [5.w],[5.h] 5 = IMAGE 5.file = media/uploads/postit_1.gif 100 = TEXT 100.text = Testing 100.offset = -5,60 100.fontFile = fileadmin/fonts/arial_bold.ttf 100.fontSize = 15 100.align=center } images.2 < .images.1 images.2.file.5.file = media/uploads/postit_2.gif images.2.file.100.angle = 11 images.2.file.100.offset = -2,79 images.3 < .images.1 images.3.file.5.file = media/uploads/postit_3.gif images.3.file.100.angle = -13 images.3.file.100.offset = -7,81 } ****************************************************************/ $data = $this->stdWrap($conf['data'],$conf['data.']); $cols = intval($conf['cols']) ? intval($conf['cols']) : 3; $lines = explode(chr(10),$data); $imageArr = array(); while(list($key,$content)=each($lines)) { $content = trim($content); if ($content) { $parts = explode('|',$content); $text = trim($parts[0]); $type = t3lib_div::intInRange($parts[1],1,3); $link = trim($parts[2]); if ($text) { $imgConf = $conf['images.'][$type.'.']; $imgConf['file.'] = $this->gifBuilderTextBox ($imgConf['file.'], $conf['textBox.'], $text); $image = $this->IMAGE($imgConf); if ($image) { $this->setCurrentVal($link); $imageArr[] = $this->typolink($image,$conf['typolink.']); } } } } if (is_array($imageArr)) { reset($imageArr); if ($cols) { $res = ''; $rows = ceil(count($imageArr)/$cols); for ($a=0;$a<$rows;$a++) { $res.=''; for ($b=0;$b<$cols;$b++) { $res.=''.$imageArr[(($a*$cols)+$b)].''; } $res.=''; } $content=''.$res.'
'; } else { $content.=implode($imageArr,''); } } ?>