roundcubemail/program/lib/Roundcube/rcube_plugin_api.php
public function register_action($action, $owner, $callback, $task = null)
    {
        // check action name
        if ($task)
            $action = $task.'.'.$action;
        else if (strpos($action, 'plugin.') !== 0)
            $action = 'plugin.'.$action;

        // can register action only if it's not taken or registered by myself
        if (!isset($this->actionmap[$action]) || $this->actionmap[$action] == $owner) {
            $this->actions[$action] = $callback;
            $this->actionmap[$action] = $owner;
        }
        else {
            rcube::raise_error(array('code' => 523, 'type' => 'php',
                'file' => __FILE__, 'line' => __LINE__,
                'message' => "Cannot register action $action;"
                    ." already taken by another plugin"), true, false);
        }
    }
public function register_action($action, $owner, $callback, $task = null)
    {
        // check action name
        if ($task)
            $action = $task.'.'.$action;
        else if (strpos($action, 'plugin.') !== 0)
            $action = 'plugin.'.$action;

        // can register action only if it's not taken or registered by myself
        if (!isset($this->actionmap[$action]) || $this->actionmap[$action] == $owner) {
            $this->actions[$action] = $callback;
            $this->actionmap[$action] = $owner;
        }
        else {
            rcube::raise_error(array('code' => 523, 'type' => 'php',
                'file' => __FILE__, 'line' => __LINE__,
                'message' => "Cannot register action $action;"
                    ." already taken by another plugin"), true, false);
        }
    }
public function register_action ( $ action , $ owner , $ callback , $ task = null ) { // check action name if ( $ task ) $ action = $ task . '.' . $ action ; else if ( strpos ( $ action , 'plugin.' ) !== 0 ) $ action = 'plugin.' . $ action ; // can register action only if it's not taken or registered by myself if ( ! isset ( $ this -> actionmap [ $ action ] ) || $ this -> actionmap [ $ action ] == $ owner ) { $ this -> actions [ $ action ] = $ callback ; $ this -> actionmap [ $ action ] = $ owner ; } else { rcube :: raise_error ( array ( 'code' => 523 , 'type' => 'php' , 'file' => __FILE__ , 'line' => __LINE__ , 'message' => "Cannot register action $action;" . " already taken by another plugin" ) , true , false ) ; } }
Let a plugin register a handler for a specific request

@param string $action   Action name (_task=mail&_action=plugin.foo)
@param string $owner    Plugin name that registers this action
@param mixed  $callback Callback: string with global function name or array($obj, 'methodname')
@param string $task     Task name registered by this plugin
Let a plugin register a handler for a specific request