true)); return $model->getMenus(); } public function getFiles() { // load the items require_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/ckbrowse.php'; return CKBrowse::getItemsList(); } public function getArticleCategoriesRoot() { $query = "SELECT id, title, alias, extension, access, 'category' as type" . " FROM #__categories" . " WHERE extension = 'com_content'" . " AND level = 1" . " ORDER BY lft ASC, title ASC" ; $categories = CKFof::dbLoadObjectList($query); return $categories; } public function getCategoriesById($parentId) { $query = "SELECT id, title, alias, extension, lft, rgt, 'category' as type, access" . " ,(SELECT COUNT(*) FROM #__content as a WHERE a.catid = c.id) AS counter" . " FROM #__categories as c" . " WHERE extension = 'com_content'" . " AND parent_id = " . (int)$parentId . " ORDER BY lft ASC, title ASC" ; $categories = CKFof::dbLoadObjectList($query); return $categories; } public function getArticlesByCategoryId($parentId) { $query = "SELECT id, title, alias, catid, language, 'article' as type, access" . " FROM #__content" . " WHERE catid = " . (int)$parentId . " ORDER BY title ASC" ; $categories = CKFof::dbLoadObjectList($query); return $categories; } }