Admin presets helper class.  
 More...
|  | 
| static | add_item (int $presetid, string $name, string $value, ?string $plugin='none', ?string $advname=null, ?string $advvalue=null) | 
|  | Helper method to add a setting item to a preset. 
 | 
|  | 
| static | add_plugin (int $presetid, string $plugin, string $name, int $enabled) | 
|  | Helper method to add a plugin to a preset. 
 | 
|  | 
| static | change_default_preset (string $presetnameorfile) | 
|  | Apply the given preset. 
 | 
|  | 
| static | create_default_presets () | 
|  | Helper method to create default site admin presets and initialize them. 
 | 
|  | 
| static | create_preset (array $data) | 
|  | Create an empty preset. 
 | 
|  | 
Admin presets helper class. 
- Copyright
- 2021 Sara Arjona (sara@.nosp@m.mood.nosp@m.le.co.nosp@m.m) 
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 
◆ add_item()
  
  | 
        
          | static core_adminpresets\helper::add_item | ( | int | $presetid, |  
          |  |  | string | $name, |  
          |  |  | string | $value, |  
          |  |  | ?string | $plugin = 'none', |  
          |  |  | ?string | $advname = null, |  
          |  |  | ?string | $advvalue = null ) |  | static | 
 
Helper method to add a setting item to a preset. 
- Parameters
- 
  
    | int | $presetid | Preset identifier where the item will belong. |  | string | $name | Item name. |  | string | $value | Item value. |  | string | null | $plugin | Item plugin. |  | string | null | $advname | If the item is an advanced setting, the name of the advanced setting should be specified here. |  | string | null | $advvalue | If the item is an advanced setting, the value of the advanced setting should be specified here. |  
 
- Return values
- 
  
    | int | The item identificator. |  
 
 
 
◆ add_plugin()
  
  | 
        
          | static core_adminpresets\helper::add_plugin | ( | int | $presetid, |  
          |  |  | string | $plugin, |  
          |  |  | string | $name, |  
          |  |  | int | $enabled ) |  | static | 
 
Helper method to add a plugin to a preset. 
- Parameters
- 
  
    | int | $presetid | Preset identifier where the item will belong. |  | string | $plugin | Plugin type. |  | string | $name | Plugin name. |  | int | $enabled | Whether the plugin will be enabled or not. |  
 
- Return values
- 
  
    | int | The plugin identificator. |  
 
 
 
◆ change_default_preset()
  
  | 
        
          | static core_adminpresets\helper::change_default_preset | ( | string | $presetnameorfile | ) |  |  | static | 
 
Apply the given preset. 
If it's a filename, the preset will be imported and then applied.
- Parameters
- 
  
    | string | $presetnameorfile | The preset name to be applied or a valid preset file to be imported and applied. |  
 
- Return values
- 
  
    | int|null | The preset identifier that has been applied or null if the given value was not valid. |  
 
 
 
◆ create_preset()
  
  | 
        
          | static core_adminpresets\helper::create_preset | ( | array | $data | ) |  |  | static | 
 
Create an empty preset. 
- Parameters
- 
  
    | array | $data | Preset data. Supported values: 
name. To define the preset name.comments. To change the comments field.author. To update the author field.iscore. Whether the preset is a core preset or not. Valid values on core_adminpresets\manager class.  |  
 
- Return values
- 
  
    | int | The identifier of the preset created. |  
 
 
 
The documentation for this class was generated from the following file: