/** Articles */
 public function _default()
 {
     $news = new ArticleEntityRepository();
     $category = new ArticleCategoryEntityRepository();
     echo BreadCrumbs::getInstance()->addCrumb(__('Articles'));
     echo Columns::getInstance()->add('<a class="btn btn-success" href="?p=' . P . '&do=add">' . __('Add Article') . '</a><br><br>', ['align' => 'right']);
     echo CmsTable::getInstance()->addData($news)->addColumn(ColumnImg::getInstance()->imgHeight(130)->href('?p=' . P . '&do=edit&id={%id%}'))->addColumn(ColumnData::getInstance('title')->enableTranslationColumn())->addColumn(ColumnData::getInstance('category_id')->setPairedDataOptionsForKeys($category->getPairs('title')))->addColumn(ColumnEdit::getInstance('edit'))->addColumn(ColumnActive::getInstance('active'))->addColumn(ColumnDelete::getInstance('delete'));
 }
 public static function getCategoryPairs($only_active = false)
 {
     $categories = new ArticleCategoryEntityRepository();
     if ($only_active) {
         $categories->setWhereActive(1);
     }
     $categories->addOrderByField('title');
     return $categories->getPairs('title');
 }