{
$this->ensureUserIsStaff();
- $admin_log = \PFF\Container::databaseQuery()
- ->from('admin_log')
- ->orderBy('created_at DESC')
- ->limit(10)
- ->asObject(true)
- ->fetchAll();
-
$context = array(
'page_title' => __('Site Administration'),
- 'admin_log' => $admin_log,
+ 'admin_log' => IPF_Admin_Log::recent(),
);
return $this->render('admin/index.html', $context);
}
class IPF_Admin_Log
{
+ public static function recent()
+ {
+ return \PFF\Container::databaseQuery()
+ ->from('admin_log')
+ ->orderBy('created_at DESC')
+ ->limit(10)
+ ->asObject(true)
+ ->fetchAll();
+ }
+
public static function log($who, $action, $repr, $class, $url=null)
{
$data = array(