get_template_vars("MainObjPreserve"); $bookmarks = $smarty->get_template_vars('bookmarks'); if (isset($bookmarks) && isset($bookmarks['count']) && $bookmarks['count'] > 0) { $zakladki = true; } else { $bookmarks = array('data' => array()); $zakladki = false; } // if ($smarty->get_template_vars('MainObjPreserve')->GetId() != 0) { $login_f = true; // } else { // $login_f = false; // } $firstBookmark = $params; $firstBookmark['content'] = $content; $useUrl = false; if ($zakladki) { if ($bookmarks['useUrl']) { $useUrl = true; $bcont = $firstBookmark['content']; } if (isset($firstBookmark['headerTitle'])) { $headerTitleAll = $firstBookmark['headerTitle']; } $display = 'none'; } else { $bookmarks['data'][] = $firstBookmark; $display = 'block'; } //Usuwamy treść zakładek, żeby się więcej razy nie pojawiała //Utils::ArrayDisplay($bookmarks); $smarty->clear_assign('bookmarks'); $headerShown =''; if(isset($params['hidden']) && $params['hidden'] == true ){ $headerShown = 'style="display:none"'; } $className=''; if(isset($params['className'])){ $className = ' '.$params['className'].' menuTab'; } $content = ''; $header = '
'; if (isset($headerTitleAll)) { $headerImg = __temp_function_make_image_url($headerTitleAll, 'header'); if (file_exists(PATH_STATIC_CONTENT . $headerImg)) { $header .= '' . $headerTitleAll . ''; } else { $header .= '

' . $headerTitleAll . '

'; } } if ($zakladki) { $header .= '
'; } foreach ($bookmarks['data'] as $k => $bookmark) { if (!$useUrl) { $bcont = $bookmark['content']; } if ($zakladki && $k == $bookmarks['active']) { $displayIn = 'block'; $img = '_'; } else { $displayIn = $display; $img = '-'; } if (((isset($cookmark['moreButton']) && $cookmark['moreButton']) || !isset($bookmark['moreButton'])) && isset($bookmark['moreUrl']) && $bookmark['moreUrl']) { $moreUrl = $bookmark['moreUrl']; } else if (((isset($firstBookmark['moreButton']) && $firstBookmark['moreButton']) || !isset($firstBookmark['moreButton'])) && isset($firstBookmark['moreUrl']) && $firstBookmark['moreUrl']) { $moreUrl = $firstBookmark['moreUrl']; } if ((isset($bookmark['addButton']) && $bookmark['addButton']) || !isset($bookmark['addButton'])) { if (isset($bookmark['addUrl']) && $bookmark['addUrl']) { $addUrl = $bookmark['addUrl']; } else if (isset($bookmark['addUrlScript']) && $bookmark['addUrlScript']) { $addUrl = $bookmark['addUrlScript']; $addScript = true; } else if ((isset($firstBookmark['addButton']) && $firstBookmark['addButton']) || !isset($firstBookmark['addButton'])) { if (isset($firstBookmark['addUrl']) && $firstBookmark['addUrl']) { $addUrl = $firstBookmark['addUrl']; } else if (isset($firstBookmark['addUrlScript']) && $firstBookmark['addUrlScript']) { $addUrl = $firstBookmark['addUrlScript']; $addScript = true; } } } if (((isset($bookmark['editBlocked']) && !$bookmark['editBlocked']) || !isset($bookmark['editBlocked'])) && isset($bookmark['editUrl'])) { $editUrl = $bookmark['editUrl']; } else if (((isset($firstBookmark['editBlocked']) && !$firstBookmark['editBlocked']) || !isset($firstBookmark['editBlocked'])) && isset($firstBookmark['editUrl'])) { $editUrl = $firstBookmark['edit']; } if (((isset($bookmark['abuseButton']) && $bookmark['abuseButton']) || !isset($bookmark['abuseButton'])) && isset($bookmark['abuseUrl'])) { $abuseUrl = $bookmark['abuseUrl']; } else if (((isset($firstBookmark['abuseButton']) && $firstBookmark['abuseButton']) || !isset($firstBookmark['abuseButton'])) && isset($firstBookmark['abuseUrl'])) { $abuseUrl = $firstBookmark['abuseUrl']; } if (!$zakladki) { if (isset($moreUrl)) { $header .= '
'; } else { $header .= '
'; } } if ($zakladki) { $headerImg = __temp_function_make_image_url($bookmark['headerTitle'], 'zak', ($k == $bookmarks['active'] ? 1 : 0)); } else { $headerImg = __temp_function_make_image_url($bookmark['headerTitle'], 'header'); } if (file_exists(PATH_STATIC_CONTENT . $headerImg)) { $hT = '' . $bookmark['headerTitle'] . '' . $hT . ' />'; } else { $header .= $hT . ' onclick="switchBookmark(\'' . $los . '\', ' . $k . ');" />'; } } else { $hT .= " />"; if (isset($moreUrl) && $moreUrl) { $header .= '' . $hT . ''; } else { $header .= $hT; } } } else { $hT = $bookmark['headerTitle']; if ($zakladki) { if ($useUrl) { $header .= '

' . $hT . '

'; } else { $header .= '

' . $hT . '

'; } } else if (isset($moreUrl) && $moreUrl) { $header .= '

' . $hT . '

'; } else { $header .= '

' . $hT . '

'; } } unset($hT); if (!$zakladki) { $header .= '
'; } if(isset($params['hidden']) && $params['hidden'] == true ){ $displayIn = 'none'; } $content .= '
'. '
' . (isset($bookmarks['begin_content']) ? $bookmarks['begin_content'] : '') . $bcont . (isset($bookmarks['end_content']) ? $bookmarks['end_content'] : ''). '
'. '
'. '
'. '
'. '
'; if (!$zakladki || $zakladki && ((isset($bookmark['frameIcon']) && $bookmark['frameIcon']) || (isset($firstBookmark['frameIcon']) && $firstBookmark['frameIcon']))) { if (isset($bookmark['frameIcon'])) { $frameIcon = '/image/Strona/icon' . $bookmark['frameIcon'] . '.gif'; } else if (isset($firstBookmark['frameIcon'])) { $frameIcon = '/image/Strona/icon' . $firstBookmark['frameIcon'] . '.gif'; } else { $frameIcon = __temp_function_make_image_url($bookmark['headerTitle'], 'icon'); } if (isset($bookmark['iconTop'])) { $iconTop = $bookmark['iconTop']; } else { if($frameIcon == "/image/Strona/iconDeformator.gif") $iconTop = -60; else $iconTop = -45; } if (isset($bookmark['iconRight'])) { $iconRight = $bookmark['iconRight']; } else { $iconRight = 10; } if (isset($bookmark)) $frameIcon = $frameIcon; if (file_exists(PATH_STATIC_CONTENT . $frameIcon)) { $content .= '
'. '' . $bookmark['headerTitle'] . ''. '
'; } } if (isset($moreUrl)) { $moreId = "buttonFrameMore" . ($zakladki ? $k : '') . $los; if (isset($bookmark['moreTitle'])) { $moreTitle = $bookmark['moreTitle']; } else { $moreTitle = "więcej"; } $content .= ' '; } if (isset($addUrl)) { $addImg = 'buttonFrame'; if (isset($bookmark['addImg'])) { $addImg .= $bookmark['addImg']; } else if (isset($bookmark['addComment'])) { $addImg .= 'AddComment'; } else if (isset($firstBookmark['addImg'])) { $addImg .= $firstBookmark['addImg']; } else if (isset($firstBookmark['addComment'])) { $addImg .= 'AddComment'; } else { $addImg .= 'Add'; } if (isset($bookmark['addComment']) || isset($firstBookmark['addComment'])) { $addId = "buttonFrameAddComment"; } else { $addId = "buttonFrameAdd" . ($zakladki ? $k : '') . $los; } $addClass = "innerFrameAdd"; if (isset($bookmark['addOnTop']) || isset($bookmark['addComment']) || isset($firstBookmark['addOnTop']) || isset($firstBookmark['addComment'])) { $addClass .= "Top"; if (!isset($firstBookmark['addComment']) && !isset($bookmark['addComment'])) { $addImg .= "Top"; } } else if (isset($editUrl)) { $addClass .= "WithEdit"; } if (isset($bookmark['addTitle'])) { $addTitle = $bookmark['addTitle']; } else if (isset($firstBookmark['addTitle'])) { $addTitle = $firstBookmark['addTitle']; } else { $addTitle = "dodaj"; } $content .= ''; if (isset($bookmark['addComment'])) { $content .= ''; } } if (isset($editUrl) && $login_f) { $editId = "buttonFrameEdit" . ($zakladki ? $k : '') . $los; if (isset($bookmark['editTitle'])) { $editTitle = $bookmark['editTitle']; } else { $editTitle = "edytuj"; } $content .= ' '; } if (isset($abuseUrl)) { $abuseImg = 'buttonFrame'; if (isset($bookmark['abuseImg'])) { $abuseImg .= $bookmark['abuseImg']; } else { $abuseImg .= 'Abuse'; } if (isset($bookmark['abuseTitle'])) { $abuseTitle = $bookmark['abuseTitle']; } else { $abuseTitle = "Zgłoś nadużycie"; } $abuseId = "buttonFrameAbuse" . ($zakladki ? $k : '') . $los; $abuseClass = "innerFrameAbuse"; $content .= ''; } $content .= '
'; } $header .= '
'; if ($zakladki) { $header .= '
'; } $smarty->clear_assign('bookmarks'); //Utils::ArrayDisplay($content); return $header . $content; } } ?>