phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/blocks block-Current_Sectio


From: Patrick Walsh <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/blocks block-Current_Section.php,NONE,1.1
Date: Tue, 17 Sep 2002 19:52:02 -0400

Update of /cvsroot/phpgroupware/sitemgr/sitemgr-site/blocks
In directory subversions:/tmp/cvs-serv28112/blocks

Added Files:
        block-Current_Section.php 
Log Message:
Added a navigational block for showing pages and subcats in the currently 
viewed category.


--- NEW FILE ---
<?php
if (eregi("block-SiteIndex.php",$PHP_SELF)) {
        Header("Location: index.php");
        die();
}

        if ($GLOBALS['page_name'] || $GLOBALS['page_id'] || 
$GLOBALS['category_id'])
        {
                if ($GLOBALS['page_id'])
                {
                        $page = 
ExecMethod('sitemgr.Pages_SO.getPage',$GLOBALS['page_id']);
                        $cat_id = (int) $page->cat_id;
                        unset($page);
                }
                elseif ($GLOBALS['page_name'])
                {
                        $page = 
ExecMethod('sitemgr.Pages_SO.getPageByName',$GLOBALS['page_name']);
                        $cat_id = (int) $page->cat_id;
                        unset($page);
                }
                elseif ($GLOBALS['category_id'])
                {
                        $cat_id = (int) $GLOBALS['category_id'];
                }
                $bo = new bo;
                $catlinks = $bo->getCatLinks($cat_id,false);
                $pagelinks = $bo->getPageLinks($cat_id,false);
                $category = 
ExecMethod('sitemgr.Categories_BO.getCategory',$cat_id);
                $title = $category->name.' Section';
                unset($bo);

                $content = '';
                if (count($catlinks))
                {
                        $content .= "\n".'<b>Subsections:</b><br>';
                        foreach ($catlinks as $catlink)
                        {
                                $content .= 
"\n".'&nbsp;&middot;&nbsp;'.$catlink['link'].'<br>';
                        }
                        $content .= '<br>';
                }
                if (count($pagelinks)>1)
                {
                        $content .= "\n".'<b>Pages:</b><br>';
                        foreach ($pagelinks as $pagelink)
                        {
                                $content .= 
'&nbsp;&middot;&nbsp;'.$pagelink['link'].'<br>';
                        }
                }
        }
        else
        {
                $content = '';
        }
?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]