<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
class DraftController extends AuthorController
{
    public $actionMap = array(
        'index' => 'IndexAction',
        'create' => 'CreateAction',
        'edit' => 'EditAction',
        'delete' => 'DeleteAction',
        'sort' => 'SortAction',
        'publish' => 'PublishAction',
        'detail' => 'DetailAction',
    );
    
    public function getChapter()
    {
        $chapterId = S::gp('cid','G',2);
        $chapter = Chapter::single()->getOne($chapterId);
        if (empty($chapter))
        {
        	throw new iSystemException('不存在的章节');
        }
        
        return $chapter;
    }
}