public function edits($Type = '', $Page = '', $Op = false)
{
$this->permission('Garden.Moderation.Manage');
list($Offset, $Limit) = offsetLimit($Page, 10);
$this->setData('Title', t('Change Log'));
$Operations = array('Edit', 'Delete', 'Ban');
if ($Op && in_array(ucfirst($Op), $Operations)) {
$Operations = ucfirst($Op);
}
$Where = array('Operation' => $Operations);
$AllowedTypes = array('Discussion', 'Comment', 'Activity', 'User');
$Type = strtolower($Type);
if ($Type == 'configuration') {
$this->permission('Garden.Settings.Manage');
$Where['RecordType'] = array('Configuration');
} else {
if (in_array(ucfirst($Type), $AllowedTypes)) {
$Where['RecordType'] = ucfirst($Type);
} else {
$Where['RecordType'] = $AllowedTypes;
}
}
$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();
}