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
파일 보기 프로젝트 열기: vanilla/vanilla

보호된 프로퍼티들

프로퍼티 타입 설명
$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