['filter' => FILTER_VALIDATE_INT]
);
protected function generate() : void
{
// main container should be tagged:
if (!$this->assertGET('id'))
$this->generateNotFound(Lang::game('guide'), Lang::guide('notFound'));
$guide = new GuideList(array(['id', $this->_get['id']]));
if ($guide->error)
$this->generateNotFound(Lang::game('guide'), Lang::guide('notFound'));
if (!$guide->canBeViewed() && !$guide->userCanView())
$this->forward('?guides='.$guide->getField('category'));
$this->h1 = Lang::guide('clTitle', [$this->_get['id'], $guide->getField('title')]);
if (!$this->h1)
$this->h1 = $guide->getField('name');
$this->gPageInfo += ['name' => $guide->getField('name')];
$this->breadcrumb[] = $guide->getField('category');
parent::generate();
/* - NYI (see "&& false")
$this->addScript([SC_JS_STRING,
<<
= parseInt(e.value));
});
};
radios.each(function (i, e) {
e.onchange = limit.bind(this, e.name, parseInt(e.value));
if (i < 2 && e.name == "b") // first pair
$(e).trigger("click");
else if (e.value == 0 && e.name == "a") // last pair
$(e).trigger("click");
});
});
JS
]);
*/
$buff = '';
$inp = fn($rev) => User::isInGroup(U_GROUP_STAFF) && false ? ($rev !== null ? '' : '') : '';
$logEntries = DB::Aowow()->select('SELECT a.`username` AS `name`, gcl.`date`, gcl.`status`, gcl.`msg`, gcl.`rev` FROM ?_guides_changelog gcl JOIN ?_account a ON a.`id` = gcl.`userId` WHERE gcl.`id` = ?d ORDER BY gcl.`date` DESC', $this->_get['id']);
foreach ($logEntries as $log)
{
if ($log['status'] != GuideMgr::STATUS_NONE)
$buff .= '- '.$inp($log['rev']).''.Lang::guide('clStatusSet', [Lang::guide('status', $log['status'])]).''.Util::formatTimeDiff($log['date'])."
\n";
else if ($log['msg'])
$buff .= '- '.$inp($log['rev']).''.Util::formatTimeDiff($log['date']).Lang::main('colon').''.$log['msg'].' '.Lang::main('byUser', [$log['name'], 'style="text-decoration:underline"'])."
\n";
else
$buff .= '- '.$inp($log['rev']).''.Util::formatTimeDiff($log['date']).Lang::main('colon').''.Lang::guide('clMinorEdit').' '.Lang::main('byUser', [$log['name'], 'style="text-decoration:underline"'])."
\n";
}
// append creation
$buff .= '- '.$inp(0).''.Lang::guide('clCreated').''.Util::formatTimeDiff($guide->getField('date'))."
\n
\n";
if (User::isInGroup(U_GROUP_STAFF) && false)
$buff .= '';
$this->extraHTML = $buff;
}
}
?>