Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
namespace core\output;
use context;
use renderable;
use stdClass;
use templatable;
/**
* The filter renderable class.
*
* @package core
* @copyright 2021 Catalyst IT Australia Pty Ltd
* @author Tomo Tsuyuki
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class datafilter implements renderable, templatable {
/** @var context $context The context where the filters are being rendered. */
protected $context;
/** @var string $tableregionid Container of the table to be updated by this filter, is used to retrieve the table */
protected $tableregionid;
/** @var stdClass $course The course shown */
protected $course;
/**
* Filter constructor.
*
* @param context $context The context where the filters are being rendered
* @param string|null $tableregionid Container of the table which will be updated by this filter
*/
public function __construct(context $context, ?string $tableregionid = null) {
$this->context = $context;
$this->tableregionid = $tableregionid;
if ($context instanceof \context_course) {
$this->course = get_course($context->instanceid);
}
}
/**
* Get data for all filter types.
*
* @return array
*/
abstract protected function get_filtertypes(): array;
/**
* Get a standardised filter object.
*
* @param string $name
* @param string $title
* @param bool $custom
* @param bool $multiple
* @param string|null $filterclass
* @param array $values
* @param bool $allowempty
* @return stdClass|null
*/
protected function get_filter_object(
string $name,
string $title,
bool $custom,
bool $multiple,
?string $filterclass,
array $values,
bool $allowempty = false
): ?stdClass {
if (!$allowempty && empty($values)) {
// Do not show empty filters.
return null;
}
return (object) [
'name' => $name,
'title' => $title,
'allowcustom' => $custom,
'allowmultiple' => $multiple,
'filtertypeclass' => $filterclass,
'values' => $values,
];
}
}