Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 400 and 403] [Versions 401 and 403] [Versions 402 and 403]

(no description)

File Size: 394 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: column_manager  - X-Ref

Class column_manager responsible for loading and saving order to the config setting.

__construct(bool $globalsettings = false)   X-Ref
Constructor for column_manager class.

param: bool $globalsettings Only use the global default settings, ignoring user preferences?

setup_property(string $setting, bool $global = false, $encoding = 'csv')   X-Ref
Return the value for the given property, based the saved user preference or config setting.

If no value is currently stored, returns an empty array.

param: string $setting The identifier used for the saved config and user preference settings.
param: bool $global Only get the global default, ignoring the user preference?
param: string $encoding The encoding used to store the property - csv or json
return: array

set_column_order(?array $columns, bool $global = false)   X-Ref
Sets column order in the qbank_columnsortorder plugin config.

param: ?array $columns Column order to set. Null value clears the setting.
param: bool $global save this as a global default, rather than a user preference?

set_hidden_columns(?array $columns, bool $global = false)   X-Ref
Hidden Columns.

param: ?array $columns List of hidden columns. Null value clears the setting.
param: bool $global save this as a global default, rather than a user preference?

set_column_size(?string $sizes, bool $global = false)   X-Ref
Column size.

param: ?string $sizes columns with width. Null value clears the setting.
param: bool $global save this as a global default, rather than a user preference?

save_preference(string $name, ?string $value, bool $global = false)   X-Ref
Save Preferences.

param: string $name name of a configuration
param: ?string $value value of a configuration. Null value clears the setting.
param: bool $global save this as a global default, rather than a user preference?

get_questionbank()   X-Ref
Get qbank.

return: view

get_columns()   X-Ref
Get enabled columns.

return: array

get_disabled_columns()   X-Ref
Get disabled columns.

return: array

update_config($enabledcolumns, $disabledcolumns)   X-Ref
Updates enabled and disabled config for 'qbank_columnsortorder' plugin.

param: array $enabledcolumns Enabled columns to set.
param: array $disabledcolumns Disabled columns to set.

enable_columns(string $plugin)   X-Ref
Enables columns.

param: string $plugin Plugin type and name ie: qbank_viewcreator.

disable_columns(string $plugin)   X-Ref
Disables columns.

param: string $plugin Plugin type and name ie: qbank_viewcreator.

get_sorted_columns($ordertosort)   X-Ref
Orders columns in the question bank view according to config_plugins table 'qbank_columnsortorder' config.

param: array $ordertosort Unordered array of columns, [columnname => class]
return: array $properorder|$ordertosort Returns array ordered if 'qbank_columnsortorder' config exists.

set_columns_visibility(array $columns)   X-Ref
Given an array of columns, set the isvisible attribute according to $this->hiddencolumns and $this->disabledcolumns.

param: column_base[] $columns
return: array

get_colsize_map()   X-Ref
Return $this->colsize mapped as an array of column name => width, excluding empty sizes.

return: array

get_hidden_columns()   X-Ref
Return an array of hidden columns as an array of class => column name

return: array

get_column_width(column_base $column)   X-Ref
No description

get_column_actions(view $qbank)   X-Ref
No description