user_group)) { array_push($navi_in, $navigation->navigation_id); } } if (sizeof($navi_in)) { $sql = " SELECT navigation_item_id, parent_id, title, document_id, target, level, alias, 0 AS active FROM " . PREFIX . "_navigation_items WHERE status = '1' AND navigation_id IN(" . implode(',', $navi_in) . ") ORDER BY navigation_id ASC, position ASC "; } else { return; } } $nav_items = array(); $sql = $AVE_DB->Query($sql); while ($row_nav_item = $sql->FetchAssocArray()) { if (empty($_REQUEST['module'])) { $curent_doc_id = (isset($_GET['id']) && is_numeric($_GET['id'])) ? $_GET['id'] : 1; if ($row_nav_item['alias'] == $AVE_Core->curentdoc->document_alias || 'index.php?id=' . $row_nav_item['document_id'] == 'index.php?id=' . $curent_doc_id) { $row_nav_item['active'] = 1; } } else { if ('index.php?id=' . $row_nav_item['document_id'] == 'index.php?module=' . $_REQUEST['module']) { $row_nav_item['active'] = 1; } } $nav_items[$row_nav_item['parent_id']][] = $row_nav_item; } if (sizeof($nav_items)) { $quickfinder = ''; } $sql->Close(); } function printQuickfinder(&$nav_items, &$quickfinder = '', $parent = '0') { foreach ($nav_items[$parent] as $row) { if (strpos('index.php?id=' . $row['document_id'], 'module=') === false && start_with('index.php?', 'index.php?id=' . $row['document_id'])) { 'index.php?id=' . $row['document_id'] .= '&doc=' . (empty($row['alias']) ? prepare_url($row['title']) : $row['alias']); } if (start_with('www.', 'index.php?id=' . $row['document_id'])) { 'index.php?id=' . $row['document_id'] = str_replace('www.', 'http://www.', 'index.php?id=' . $row['document_id']); } 'index.php?id=' . $row['document_id'] = rewrite_link('index.php?id=' . $row['document_id']); if($row['alias']=='/') { if (!start_with('javascript:', 'index.php?id=' . $row['document_id'])) { if ($row['target'] == '_blank') { $row['alias'] = "javascript:window.open('" . $row['alias'] . "', '', '')"; } else { $row['alias'] = "window.location.href = '" . $row['alias'] . "'"; } } } else { if (!start_with('javascript:', 'index.php?id=' . $row['document_id'])) { if ($row['target'] == '_blank') { $row['alias'] = "javascript:window.open('". ABS_PATH. $row['alias'] . "', '', '')"; } else { $row['alias'] = "window.location.href = '". ABS_PATH. $row['alias'] . "'"; } } } $quickfinder .= ''; if (isset($nav_items[$row['navigation_item_id']])) { printQuickfinder($nav_items, $quickfinder, $row['navigation_item_id']); } } } ?>