PATH:
home
/
ediuae
/
accubooksuae.com
/
wp-content
/
plugins
/
hr-management
/
classes
/
Models
<?php /** * Addon states manager * * @package crewhrm */ namespace CrewHRM\Models; use CrewHRM\Helpers\_Array; use CrewHRM\Models\Settings; /** * Addon manager class and methods */ class AddonManager { /** * The array key to store addon settings under crewhrm settings */ const SETTING_NAME = 'crewhrm_addons_states'; /** * Return addon enable/disable states with id => bool paired data. * * @return object */ public static function getAddonsStates() { $states = _Array::getArray( Settings::getSetting( self::SETTING_NAME ) ); $defaults = array( 'assessment' => true, 'attachment' => true, 'email' => true, ); return array_merge( $defaults, $states ); } /** * Toggle individual addon enable state * * @param string $addon_id Addon ID to change enable state * @param boolean $new_state New state to apply * @return void */ public static function toggleState( string $addon_id, bool $new_state ) { $addons_settings = self::getAddonsStates(); $addons_settings[ $addon_id ] = $new_state; Settings::saveSettings( array( self::SETTING_NAME => $addons_settings ), true ); if($new_state){ do_action("{$addon_id}_activate"); }else{ do_action("{$addon_id}_deactivate"); } } }
[-] FileManager.php
[edit]
[-] DB.php
[edit]
[+]
..
[-] User.php
[edit]
[-] Field.php
[edit]
[-] Address.php
[edit]
[-] Pipeline.php
[edit]
[-] Settings.php
[edit]
[-] Application.php
[edit]
[-] Employment.php
[edit]
[-] Job.php
[edit]
[-] AddonManager.php
[edit]
[-] Meta.php
[edit]
[-] Mailer.php
[edit]
[-] Stage.php
[edit]
[-] Department.php
[edit]
[-] WeeklySchedule.php
[edit]