Пример #1
0
 /**
  * 返回对象 ...
  * @return MenuDbModel
  */
 public static function getInstance()
 {
     if (is_null(self::$dbModelObj) || !isset(self::$dbModelObj)) {
         self::$dbModelObj = new MenuDbModel();
     }
     return self::$dbModelObj;
 }
Пример #2
0
 /**
  * 
  * 构造函数
  * @param $param 实例化时传入的参数
  */
 public function __construct($param = array())
 {
     $this->param = $param;
     //分类菜单相关
     $this->menuList = MenuBusiness::getMenuList();
     $this->menuList = Func::arrayKey($this->menuList);
     $actionMenuId = 0;
     if (isset($param['mid']) && isset($this->menuList[$param['mid']])) {
         $actionMenuId = $param['mid'];
     }
     View::assign('actionMenuId', $actionMenuId);
     View::assign('menuList', $this->menuList);
 }
Пример #3
0
    /**
     * Description: 生成sitemap.xml 空行请不要删除
     */
    public function buildSitemap()
    {
        $f = fopen(ROOT_PATH . 'sitemap.xml', 'w+');
        $content = <<<EOF
<?xml version="1.0" encoding="UTF-8" ?>
<urlset>
EOF;
        //获取分类列表
        $menuList = MenuBusiness::getMenuList();
        foreach ($menuList as $menu) {
            $menuXml = <<<EOF

    <url>
        <loc>%s</loc>
        <lastmod>%s</lastmod>
        <changefreq>daily</changefreq>
        <priority>1.0</priority>
    </url>
EOF;
            $content .= sprintf($menuXml, GAME_URL . 'menu/main/mid-' . $menu['id'], date('Y-m-d'));
        }
        //获取文章列表
        $articleList = ArticleBusiness::getAllList();
        foreach ($articleList as $article) {
            $articleXML = <<<EOF

    <url>
        <loc>%s</loc>
        <lastmod>%s</lastmod>
        <changefreq>daily</changefreq>
        <priority>1.0</priority>
    </url>
EOF;
            $content .= sprintf($articleXML, GAME_URL . 'article/main/aid-' . $article['id'], date('Y-m-d', $article['ctime']));
        }
        $content .= '
</urlset>';
        $result = fwrite($f, $content);
        fclose($f);
    }
Пример #4
0
 /**
  * @descrpition 删除
  */
 public function delete()
 {
     MenuBusiness::delMenu($this->param['id']);
     View::showAdminMessage('/admin.php/menu/lists', "删除分类成功!");
 }