Exemplo n.º 1
0
/**
 * The settings of a plugin have changed, check if we need to reset the cron cache file (only on subsites)
 *
 * @param string $hook
 * @param string $action => the action being called
 * @param unknown_type $return_value
 * @param unknown_type $params
 */
function subsite_manager_plugin_action_hook($hook, $action, $return_value, $params)
{
    // are we on a Subsite, so we can handle cron reset
    if (subsite_manager_on_subsite() && $action == "plugins/settings/save") {
        $site = elgg_get_site_entity();
        // handling of the cron cache reset is done by the event function
        subsite_manager_remove_cron_cache($site->getGUID());
    }
    // clear plugin order cache
    if (is_memcache_available()) {
        $memcache = new ElggMemcache('subsite_manager');
        $memcache->delete('plugin_order');
    }
}
Exemplo n.º 2
0
/**
 * A plugin has been activated/deactivated or the settings have changed, reset cron cache file (only on subsite)
 *
 * @param string $event
 * @param string $object_type
 * @param ElggEntity $object
 */
function subsite_manager_plugin_event_handler($event, $object_type, $object)
{
    static $run_once;
    if (subsite_manager_on_subsite() && !isset($run_once)) {
        $run_once = true;
        $site = elgg_get_site_entity();
        subsite_manager_remove_cron_cache($site->getGUID());
    }
}