private function loadDataGrid()
{
// are multiple categories allowed?
$this->multipleCategoriesAllowed = $this->get('fork.settings')->get('Faq', 'allow_multiple_categories', true);
// create dataGrid
$this->dataGrid = new BackendDataGridDB(BackendFaqModel::QRY_DATAGRID_BROWSE_CATEGORIES, BL::getWorkingLanguage());
$this->dataGrid->setHeaderLabels(array('num_items' => \SpoonFilter::ucfirst(BL::lbl('Amount'))));
if ($this->multipleCategoriesAllowed) {
$this->dataGrid->enableSequenceByDragAndDrop();
} else {
$this->dataGrid->setColumnsHidden(array('sequence'));
}
$this->dataGrid->setRowAttributes(array('id' => '[id]'));
$this->dataGrid->setPaging(false);
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('Index')) {
$this->dataGrid->setColumnFunction(array(__CLASS__, 'setClickableCount'), array('[num_items]', BackendModel::createURLForAction('Index') . '&category=[id]'), 'num_items', true);
}
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('EditCategory')) {
$this->dataGrid->setColumnURL('title', BackendModel::createURLForAction('EditCategory') . '&id=[id]');
$this->dataGrid->addColumn('edit', null, BL::lbl('Edit'), BackendModel::createURLForAction('EditCategory') . '&id=[id]', BL::lbl('Edit'));
}
}