public function Create() { $CategoryID = _intval($this->_GET['CategoryID'], true); $Category = new ArticlesCategoryModule(); if ($CategoryID) { $Detail = $Category->Get($CategoryID); if (!$Detail) { JsMessage('很抱歉, 您指定的分类不存在! 无法编辑!'); } $this->Detail = $Detail; } $this->data = $Category->GetCategories($Category->MaxLevel); }
public function Lists() { $articles = new ArticlesModule(); $this->category = $Category = new ArticlesCategoryModule(); $this->Categories = $Category->GetCategories(2); $Page = _intval($this->_GET['Page'], true); if (!$Page) { $Page = 1; } $Limit = 50; $Offset = ($Page - 1) * $Limit; $this->Data = $Data = $articles->Lists($Offset, $Limit); if ($Page > 1) { $this->BackPage = $Page - 1; } if (count($Data) == $Limit) { $this->NextPage = $Page + 1; } $this->Page = $Page; }