PHP Класс DiscussionsSortFilterModule, vanilla

Renders a sort/filter module on a discussions view based on the sorts and filters in the Discussion Model. If there are category-specific filters, the categoryID property must be set in order for it to render the filters for the category.
Наследование: extends Gdn_Module
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$categoryID The ID of the category we're in.
$dropdownView The view of the dropdown module to render.
$filters The filters to render.
$selectedFilters The selected filters.
$selectedSort The selected sort.
$showFilters Whether to show the filter options in the view.
$showSorts Whether to show the sorting options in the view.
$sorts The sorts to render.

Открытые методы

Метод Описание
__construct ( integer $categoryID, string $selectedSort = '', array $selectedFilters = [] )
prepare ( ) : boolean Checks whether we should even render this whole thing.
setDropdownView ( string $dropdownView ) : DiscussionsSortFilterModule
setShowFilters ( $showFilters ) : DiscussionsSortFilterModule
setShowSorts ( $showSorts ) : DiscussionsSortFilterModule
showFilters ( ) : boolean
showSorts ( ) : boolean

Защищенные методы

Метод Описание
getFilterDropdowns ( ) : array Returns an array of dropdown menus with the data from the filters array or an array containing an empty string to make it safe for echoing out.
getPagelessPath ( ) : string Returns the current path without any page indicator. Useful for resetting sorting/filtering no matter which page the user is on.
getSortData ( ) : array Returns an array of sanitized sort data for the view.

Описание методов

__construct() публичный Метод

public __construct ( integer $categoryID, string $selectedSort = '', array $selectedFilters = [] )
$categoryID integer The ID of the category we're in.
$selectedSort string The selected sort.
$selectedFilters array The selected filters.

getFilterDropdowns() защищенный Метод

Returns an array of dropdown menus with the data from the filters array or an array containing an empty string to make it safe for echoing out.
protected getFilterDropdowns ( ) : array
Результат array An array of dropdown menus or an array containing an empty string.

getPagelessPath() защищенный Метод

Returns the current path without any page indicator. Useful for resetting sorting/filtering no matter which page the user is on.
protected getPagelessPath ( ) : string
Результат string The path of the request without the page.

getSortData() защищенный Метод

(Data uses no rendering module and must be manually inserted into the view.)
protected getSortData ( ) : array
Результат array An array of sorts consisting of the name, url, rel and cssClass of each sort item.

prepare() публичный Метод

Checks whether we should even render this whole thing.
public prepare ( ) : boolean
Результат boolean Whether to render the module.

setDropdownView() публичный Метод

public setDropdownView ( string $dropdownView ) : DiscussionsSortFilterModule
$dropdownView string The view of the dropdown module to render.
Результат DiscussionsSortFilterModule $this

setShowFilters() публичный Метод

public setShowFilters ( $showFilters ) : DiscussionsSortFilterModule
$showFilters Whether to show the filtering options in the view.
Результат DiscussionsSortFilterModule $this

setShowSorts() публичный Метод

public setShowSorts ( $showSorts ) : DiscussionsSortFilterModule
$showSorts Whether to show the sorting options in the view.
Результат DiscussionsSortFilterModule $this

showFilters() публичный Метод

public showFilters ( ) : boolean
Результат boolean Whether to show the filtering options in the view.

showSorts() публичный Метод

public showSorts ( ) : boolean
Результат boolean Whether to show the sorting options in the view.

Описание свойств

$categoryID защищенное свойство

The ID of the category we're in.
protected $categoryID

$dropdownView защищенное свойство

The view of the dropdown module to render.
protected $dropdownView

$filters защищенное свойство

The filters to render.
protected $filters

$selectedFilters защищенное свойство

The selected filters.
protected $selectedFilters

$selectedSort защищенное свойство

The selected sort.
protected $selectedSort

$showFilters защищенное свойство

Whether to show the filter options in the view.
protected $showFilters

$showSorts защищенное свойство

Whether to show the sorting options in the view.
protected $showSorts

$sorts защищенное свойство

The sorts to render.
protected $sorts