LogController::record PHP Method

record() public method

Access the log history of a specific record
public record ( string $RecordType, integer $RecordID, $Page = '' )
$RecordType string
$RecordID integer
    public function record($RecordType, $RecordID, $Page = '')
    {
        $this->permission('Garden.Moderation.Manage');
        list($Offset, $Limit) = offsetLimit($Page, 10);
        $this->setData('Title', t('Change Log'));
        $RecordType = ucfirst($RecordType);
        $Where = array('Operation' => array('Edit', 'Delete', 'Ban'), 'RecordType' => $RecordType, 'RecordID' => $RecordID);
        $RecordCount = $this->LogModel->getCountWhere($Where);
        $this->setData('RecordCount', $RecordCount);
        if ($Offset >= $RecordCount) {
            $Offset = $RecordCount - $Limit;
        }
        $Log = $this->LogModel->getWhere($Where, 'LogID', 'Desc', $Offset, $Limit);
        $this->setData('Log', $Log);
        if ($this->deliveryType() == DELIVERY_TYPE_VIEW) {
            $this->View = 'Table';
        }
        Gdn_Theme::section('Moderation');
        $this->setHighlightRoute('dashboard/log/edits');
        $this->render();
    }