<?php
/**
 * Created by JetBrains PhpStorm.
 * User: yzxh24
 * Date: 11-10-8
 * Time: 下午2:44
 * To change this template use File | Settings | File Templates.
 */
class SoftController extends BaseController
{
    public function nav($cid)
    {
        $categorys = getSoftCategorys();
        $cName = '';
        $parentId = '';
        foreach ($categorys as $category)
        {
            if ($cid == $category['id'])
            {
                $cName = $category['name'];
                if ($category['pid'])
                {
                    $parentId = $category['pid'];
                }
            }
        }

        $navArray = array();
        $navArray[] = ilink(setting('webname'), url('index'));
        $navArray[] = ilink('软件频道', url('system', array('s'=>'soft')));
        if ($parentId)
        {
            //$typeList = softTypeList();
            //$type = $typeList[$parentId];
            //$action = 1 == $parentId ? 'software' : 'game';
            //$navArray[] = ilink($type, url('system', array('s'=>'soft', 'c'=>$action)));
        }
        $navArray[] = ilink($cName, url('system', array('s'=>'soft', 'a'=>'category', 'id'=>$cid)));

        return implode('&gt;', $navArray);
    }
}
