<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
class SortAction extends AuthorAction
{
    public function run()
    {
        $bookId = S::gp('bid', 'G', 2);
        $book = $this->isBookOwner($bookId);
        if (isset($_POST['fromid']))
        {
            $fromid = S::gp('fromid', 'P', 2);
	        $toid = S::gp('toid', 'P', 2);
	        Chapter::single()->sort($fromid, $toid, $bookId);
            iforward(url('system', array('s'=>'author','c'=>'chapter','bid'=>$bookId)));
        }

        $this->showMessage('非法操作');
    }
}