Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]
Contains class \core\output\inplace_editable
Copyright: | 2016 Marina Glancy |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 284 lines (10 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
inplace_editable:: (7 methods):
__construct()
set_type_toggle()
set_type_select()
set_type_autocomplete()
get_linkeverything()
export_for_template()
render()
Class: inplace_editable - X-Ref
Class allowing to quick edit a title inline__construct($component, $itemtype, $itemid, $editable,$displayvalue, $value = null, $edithint = null, $editlabel = null, ?pix_icon $editicon = null) X-Ref |
Constructor. param: string $component name of the component or plugin responsible for the updating of the value (must declare callback) param: string $itemtype type of the item inside the component - each component/plugin may implement multiple inplace-editable elements param: int $itemid identifier of the item that can be edited in-place param: bool $editable whether this value is editable (check capabilities and editing mode), if false, only "displayvalue" param: string $displayvalue what needs to be displayed to the user, it must be cleaned, with applied filters (call param: string $value what needs to be edited - usually raw value from the database, it may contain multilang tags param: lang_string|string $edithint hint (title) that will be displayed under the edit link param: lang_string|string $editlabel label for the input element in the editing mode (for screenreaders) param: pix_icon|null $editicon icon to use to toggle editing |
set_type_toggle($options = null) X-Ref |
Sets the element type to be a toggle For toggle element $editlabel is not used. $displayvalue must be specified, it can have text or icons but can not contain html links. Toggle element can have two or more options. param: array $options toggle options as simple, non-associative array; defaults to array(0,1) return: self |
set_type_select($options) X-Ref |
Sets the element type to be a dropdown For select element specifying $displayvalue is optional, if null it will be assumed that $displayvalue = $options[$value]. However displayvalue can still be specified if it needs icons and/or html links. If only one option specified, the element will not be editable. param: array $options associative array with dropdown options return: self |
set_type_autocomplete($options, $attributes) X-Ref |
Sets the element type to be an autocomplete field param: array $options associative array with dropdown options param: array $attributes associative array with attributes for autoselect field. See AMD module core/form-autocomplete. return: self |
get_linkeverything() X-Ref |
Whether the link should contain all of the content or not. |
export_for_template(\renderer_base $output) X-Ref |
Export this data so it can be used as the context for a mustache template (core/inplace_editable). param: \renderer_base $output typically, the renderer that's calling this function return: array data context for a mustache template |
render(\renderer_base $output) X-Ref |
Renders this element param: \renderer_base $output typically, the renderer that's calling this function return: string |