31 $this->lng = (
$lng != null)
35 $this->lng->loadLanguageModule(
"wfld");
48 $sort_options = ($wsp_type ==
"wfld")
49 ? [self::SORT_DERIVED => $this->lng->txt(
"wfld_derive")]
51 if (in_array($wsp_type, [
"wfld",
"wsrt"])) {
52 $sort_options[self::SORT_ALPHABETICAL_ASC] = $this->
getLabel(self::SORT_ALPHABETICAL_ASC);
53 $sort_options[self::SORT_ALPHABETICAL_DESC] = $this->
getLabel(self::SORT_ALPHABETICAL_DESC);
54 $sort_options[self::SORT_CREATION_ASC] = $this->
getLabel(self::SORT_CREATION_ASC);
55 $sort_options[self::SORT_CREATION_DESC] = $this->
getLabel(self::SORT_CREATION_DESC);
58 if (isset($sort_options[self::SORT_DERIVED])) {
59 $sort_options[self::SORT_DERIVED] .=
" (" . $this->
getLabel($parent_effective) .
")";
62 if (isset($sort_options[$selected])) {
63 $sort_options[$selected] =
"<strong>" . $sort_options[$selected] .
"</strong>";
77 case self::SORT_DERIVED:
return $this->lng->txt(
"wfld_derive");
78 case self::SORT_ALPHABETICAL_ASC:
return $this->lng->txt(
"wfld_alphabetically_asc");
79 case self::SORT_ALPHABETICAL_DESC:
return $this->lng->txt(
"wfld_alphabetically_desc");
80 case self::SORT_CREATION_ASC:
return $this->lng->txt(
"wfld_creation_asc");
81 case self::SORT_CREATION_DESC:
return $this->lng->txt(
"wfld_creation_desc");
96 case self::SORT_ALPHABETICAL_ASC:
99 case self::SORT_ALPHABETICAL_DESC:
103 case self::SORT_CREATION_ASC:
107 case self::SORT_CREATION_DESC:
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getOptionsByType($wsp_type, $selected, $parent_effective)
Get options by type.
const SORT_ALPHABETICAL_DESC
const SORT_ALPHABETICAL_ASC
__construct(ilLanguage $lng=null)
Constructor.
sortNodes($nodes, $sorting)
Sort nodes.
getLabel(int $option)
Get label.