pressbooks aldine theme the theme used for the front page or default book
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

<?php
namespace Aldine;
use Sober\Controller\Controller;
class PageCatalog extends Controller
{
public function licenses()
{
if (function_exists('pb_meets_minimum_requirements') && pb_meets_minimum_requirements()) {
$licenses = (new \Pressbooks\Licensing())->getSupportedTypes();
foreach ($licenses as $key => $value) {
$licenses[$key] = preg_replace("/\([^)]+\)/", '', $value['desc']);
}
return $licenses;
} else {
return [];
}
}
public function subjectGroups()
{
return \Pressbooks\Metadata\get_thema_subjects();
}
public function catalogData()
{
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
$orderby = (get_query_var('orderby')) ? get_query_var('orderby') : 'title';
$subject = (get_query_var('subject')) ? get_query_var('subject') : '';
$license = (get_query_var('license')) ? get_query_var('license') : '';
return App::catalogData($page, 9, $orderby, $license, $subject);
}
}