Ejemplo n.º 1
0
function get_current_path()
{
    $out_of_chain_page = false;
    $file = getFileURI();
    $prev_file = getPrevFileURI();
    $current_item = getMenuId($file, $_SESSION['pageLang']);
    if (!$current_item) {
        $current_item = getMenuId($prev_file, $_SESSION['pageLang']);
        $out_of_chain_page = true;
    }
    $has_parent = lookupField('menus', 'menu_id', 'p_id', $current_item);
    $parent = lookupField('menus', 'menu_id', 'p_id', $current_item);
    echo '<a href="' . _PREF . '">' . home . '</a> ';
    if ($current_item) {
        if ($has_parent) {
            echo ' <span class="sep">></span> <a href="' . _PREF . lookupField('menus', 'menu_id', 'item_link', $parent) . '">' . lookupField('menus', 'menu_id', 'item_label', $parent) . '</a>';
            echo ' <span class="sep">></span> <a href="' . _PREF . lookupField('menus', 'menu_id', 'item_link', $current_item) . '">' . lookupField('menus', 'menu_id', 'item_label', $current_item) . '</a>';
        } else {
            echo ' <span class="sep">></span> <a href="' . _PREF . lookupField('menus', 'menu_id', 'item_link', $current_item) . '">' . lookupField('menus', 'menu_id', 'item_label', $current_item) . '</a>';
        }
    }
    if (!$current_item or $out_of_chain_page) {
        $current_form = getCurrentFormName();
        $prev_form = getPrevFormName();
        $id = $_REQUEST['id'];
        if (!$id) {
            $id = $_REQUEST['gid'];
        }
        $current = get_current_form_label($current_form, $id);
        $prev = get_current_form_label($prev_form, $id);
        if (!$out_of_chain_page) {
            foreach ($prev as $label => $link) {
                echo '<span class="sep"> > </span><a href="' . $link . '">' . $label . '</a>';
            }
        }
        foreach ($current as $label => $link) {
            echo '<span class="sep"> > </span><a href="' . $link . '">' . $label . '</a>';
        }
    }
}
Ejemplo n.º 2
0
function getPath($pageLang)
{
    $file = substr(strrchr($_SERVER['PHP_SELF'], "/"), 1);
    $thisfile = substr($file, 0, strpos($file, '.php'));
    $mid = addslashes($_REQUEST['mid']);
    if ($mid) {
        $title = "";
        $path = getMenuPath();
    } else {
        if ($find_id = getMenuId(getFileURI(), $pageLang)) {
            $title = "";
            $path = getMenuPath($find_id);
        } else {
            //			$title = "<a href='#'>".getTitle($thisfile,$pageLang)."</a>";
            $title = "&nbsp;&nbsp;" . getTitle($thisfile, $pageLang);
            $path = getSPath($thisfile, $pageLang);
        }
    }
    if ($thisfile != "viewProducts" && $thisfile != "viewNews") {
        $path .= $title;
    }
    if ($thisfile == "viewAllProducts") {
        $path .= "&nbsp;&nbsp;" . getTitle($thisfile, $pageLang);
    }
    return $path;
}