| @@ -19,8 +19,15 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | final class VBOMultitaskData extends JObject |
| 21 | 21 | { |
| 22 | 22 | /** |
| 23 | + * @var array multitask data options list. | |
| 24 | + * | |
| 25 | + * @since 1.16.5 (J) - 1.6.5 (WP) | |
| 26 | + */ | |
| 27 | + protected $data_options = []; | |
| 28 | + | |
| 29 | + /** | |
| 23 | 30 | * Gets the current name of the view/task. |
| 24 | 31 | * |
| 25 | 32 | * @return string |
| 26 | 33 | */ |
| @@ -144,6 +151,36 @@ | ||
| 144 | 151 | */ |
| 145 | 152 | public function getModalJsIdentifier() |
| 146 | 153 | { |
| 147 | 154 | return $this->get('_modalJsId', ''); |
| 155 | + } | |
| 156 | + | |
| 157 | + /** | |
| 158 | + * Registers custom multitask options for rendering an admin widget. | |
| 159 | + * Options are usually set when rendering a widget within a modal. | |
| 160 | + * | |
| 161 | + * @param array $options associative list of options. | |
| 162 | + * | |
| 163 | + * @return self | |
| 164 | + * | |
| 165 | + * @since 1.16.5 (J) - 1.6.5 (WP) | |
| 166 | + */ | |
| 167 | + public function registerDataOptions(array $options = []) | |
| 168 | + { | |
| 169 | + $this->data_options = $options; | |
| 170 | + | |
| 171 | + return $this; | |
| 172 | + } | |
| 173 | + | |
| 174 | + /** | |
| 175 | + * Returns the available custom options for rendering an admin widget. | |
| 176 | + * Useful to have a top-layer set of options that differs from regular data. | |
| 177 | + * | |
| 178 | + * @return array | |
| 179 | + * | |
| 180 | + * @since 1.16.5 (J) - 1.6.5 (WP) | |
| 181 | + */ | |
| 182 | + public function getDataOptions() | |
| 183 | + { | |
| 184 | + return $this->data_options; | |
| 148 | 185 | } |
| 149 | 186 | } |