35 $splitCount = count($this->menuArr);
41 if ($this->mconf[
'debugItemConf']) {
42 echo
'<h3>$NOconf:</h3>';
45 $this->makeImageMap($NOconf);
58 public function makeImageMap(
$conf) {
59 if (!is_array(
$conf)) {
62 if (is_array($this->mconf[
'main.'])) {
66 $conf = $this->mconf[
'main.'];
67 if (is_array(
$conf)) {
69 $gifObjCount = (int)end($sKeyArray);
72 foreach ($itemsConf as $key => $val) {
75 $waArr[$key][
'free'] = $gifObjCount;
77 foreach ($sKeyArray as $theKey) {
78 $theValue = $val[$theKey];
79 if ((
int)$theKey && ($theValArr = $val[$theKey .
'.'])) {
80 $cObjData = $this->menuArr[$key] ?: array();
82 if ($theValue ==
'TEXT') {
83 $waArr[$key][
'textNum'] = $gifObjCount;
84 $gifCreator->data = $cObjData;
85 $theValArr = $gifCreator->checkTextObj($theValArr);
87 unset($theValArr[
'text.']);
89 $LD = $this->
menuTypoLink($this->menuArr[$key], $this->mconf[
'target'],
'',
'', array(),
'', $this->mconf[
'forceTypeValue']);
93 if ($this->menuArr[$key][
'_OVERRIDE_HREF']) {
94 $LD[
'totalURL'] = $this->menuArr[$key][
'_OVERRIDE_HREF'];
95 if ($this->menuArr[$key][
'_OVERRIDE_TARGET']) {
96 $LD[
'target'] = $this->menuArr[$key][
'_OVERRIDE_TARGET'];
100 if ($theValArr[
'imgMap.'][
'url'] ==
'') {
101 $theValArr[
'imgMap.'][
'url'] = $LD[
'totalURL'];
103 if ($theValArr[
'imgMap.'][
'target'] ==
'') {
104 $theValArr[
'imgMap.'][
'target'] = $LD[
'target'];
106 if (is_array($theValArr[
'imgMap.'][
'altText.'])) {
108 $cObj->start($cObjData,
'pages');
109 if (isset($theValArr[
'imgMap.'][
'altText.'])) {
110 $theValArr[
'imgMap.'][
'altText'] = $cObj->stdWrap($theValArr[
'imgMap.'][
'altText'], $theValArr[
'imgMap.'][
'altText.']);
112 unset($theValArr[
'imgMap.'][
'altText.']);
114 if (is_array($theValArr[
'imgMap.'][
'titleText.'])) {
116 $cObj->start($cObjData,
'pages');
117 if (isset($theValArr[
'imgMap.'][
'titleText.'])) {
118 $theValArr[
'imgMap.'][
'titleText'] = $cObj->stdWrap($theValArr[
'imgMap.'][
'titleText'], $theValArr[
'imgMap.'][
'titleText.']);
120 unset($theValArr[
'imgMap.'][
'titleText.']);
124 if ($theValue ==
'IMAGE') {
125 if ($theValArr[
'file'] ==
'GIFBUILDER') {
127 foreach ($temp_sKeyArray as $temp_theKey) {
128 if ($theValArr[
'mask.'][$temp_theKey] ==
'TEXT') {
129 $gifCreator->data = $this->menuArr[$key] ?: array();
130 $theValArr[
'mask.'][$temp_theKey .
'.'] = $gifCreator->checkTextObj($theValArr[
'mask.'][$temp_theKey .
'.']);
132 unset($theValArr[
'mask.'][$temp_theKey .
'.'][
'text.']);
136 if ($theValArr[
'mask'] ==
'GIFBUILDER') {
138 foreach ($temp_sKeyArray as $temp_theKey) {
139 if ($theValArr[
'mask.'][$temp_theKey] ==
'TEXT') {
140 $gifCreator->data = $this->menuArr[$key] ?: array();
141 $theValArr[
'mask.'][$temp_theKey .
'.'] = $gifCreator->checkTextObj($theValArr[
'mask.'][$temp_theKey .
'.']);
143 unset($theValArr[
'mask.'][$temp_theKey .
'.'][
'text.']);
150 if ($theValArr[
'if.']) {
153 $cObj->start($cObjData,
'pages');
154 if (!empty($theValArr[
'if.']) && !$cObj->checkIf($theValArr[
'if.'])) {
157 unset($theValArr[
'if.']);
161 $conf[$gifObjCount] = $theValue;
162 $conf[$gifObjCount .
'.'] = $theValArr;
171 foreach ($waArr as $key => $val) {
172 if ($dConf[$key] = $itemsConf[$key][
'distrib']) {
173 $textBB = $gifCreator->objBB[$val[
'textNum']];
174 $dConf[$key] = str_replace(
175 array(
'textX',
'textY'),
176 array($textBB[0], $textBB[1]),
183 foreach ($waArr as $key => $val) {
184 $index = $val[
'free'];
185 $gifCreator->setup[$index] =
'WORKAREA';
186 $workArea[2] = $dConf[$key][2] ?: $dConf[$key][0];
187 $workArea[3] = $dConf[$key][3] ?: $dConf[$key][1];
188 $gifCreator->setup[$index .
'.'][
'set'] = implode(
',', $workArea);
189 $workArea[0] += $dConf[$key][0];
190 $workArea[1] += $dConf[$key][1];
192 if ($this->mconf[
'debugRenumberedObject']) {
193 echo
'<h3>Renumbered GIFBUILDER object:</h3>';
194 debug($gifCreator->setup);
196 $gifCreator->createTempSubDir(
'menu/');
197 $gifFileName = $gifCreator->fileName(
'menu/');
200 $imgHash = md5($gifFileName);
201 $imgMap = $cache->get($imgHash);
203 if ($imgMap && file_exists($gifFileName)) {
204 $info = @getimagesize($gifFileName);
212 $gifCreator->output($gifFileName);
213 $gifCreator->destroy();
214 $imgMap = $gifCreator->map;
215 $cache->set($imgHash, $imgMap, array(
'ident_MENUIMAGEMAP'), 0);
217 $imgMap .= $this->mconf[
'imgMapExtras'];
219 $this->result = array(
'output_file' => $gifFileName,
'output_w' => $w,
'output_h' => $h,
'imgMap' => $imgMap);
236 $result =
'<img src="' .
$GLOBALS[
'TSFE']->absRefPrefix . $res[
'output_file'] .
'" width="' . $res[
'output_w'] .
'" height="' . $res[
'output_h'] .
'" usemap="#' . $menuName .
'" border="0" ' . $this->mconf[
'params'];
238 if (!strstr(
$result,
'alt="')) {
239 $result .=
' alt="Menu Image Map"';
241 $result .=
' /><map name="' . $menuName .
'" id="' . $menuName .
'">' . $res[
'imgMap'] .
'</map>';
242 $GLOBALS[
'TSFE']->imagesOnPage[] = $res[
'output_file'];
243 return $this->tmpl->wrap(
$result, $this->mconf[
'wrap']);
static png_to_gif_by_imagemagick($theFile)
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
static makeInstance($className)
static shortMD5($input, $len=10)
debug($variable='', $name=' *variable *', $line=' *line *', $file=' *file *', $recursiveDepth=3, $debugLevel=E_DEBUG)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static sortedKeyList($setupArr, $acceptOnlyProperties=FALSE)