roundcubemail/program/lib/Roundcube/rcube_plugin_api.php
public function register_handler($name, $owner, $callback)
    {
        // check name
        if (strpos($name, 'plugin.') !== 0) {
            $name = 'plugin.' . $name;
        }

        // can register handler only if it's not taken or registered by myself
        if (is_object($this->output)
            && (!isset($this->objectsmap[$name]) || $this->objectsmap[$name] == $owner)
        ) {
            $this->output->add_handler($name, $callback);
            $this->objectsmap[$name] = $owner;
        }
        else {
            rcube::raise_error(array('code' => 525, 'type' => 'php',
                'file' => __FILE__, 'line' => __LINE__,
                'message' => "Cannot register template handler $name;"
                    ." already taken by another plugin or no output object available"), true, false);
        }
    }
public function register_handler($name, $owner, $callback)
    {
        // check name
        if (strpos($name, 'plugin.') !== 0) {
            $name = 'plugin.' . $name;
        }

        // can register handler only if it's not taken or registered by myself
        if (is_object($this->output)
            && (!isset($this->objectsmap[$name]) || $this->objectsmap[$name] == $owner)
        ) {
            $this->output->add_handler($name, $callback);
            $this->objectsmap[$name] = $owner;
        }
        else {
            rcube::raise_error(array('code' => 525, 'type' => 'php',
                'file' => __FILE__, 'line' => __LINE__,
                'message' => "Cannot register template handler $name;"
                    ." already taken by another plugin or no output object available"), true, false);
        }
    }
public function register_handler ( $ name , $ owner , $ callback ) { // check name if ( strpos ( $ name , 'plugin.' ) !== 0 ) { $ name = 'plugin.' . $ name ; } // can register handler only if it's not taken or registered by myself if ( is_object ( $ this -> output ) && ( ! isset ( $ this -> objectsmap [ $ name ] ) || $ this -> objectsmap [ $ name ] == $ owner ) ) { $ this -> output -> add_handler ( $ name , $ callback ) ; $ this -> objectsmap [ $ name ] = $ owner ; } else { rcube :: raise_error ( array ( 'code' => 525 , 'type' => 'php' , 'file' => __FILE__ , 'line' => __LINE__ , 'message' => "Cannot register template handler $name;" . " already taken by another plugin or no output object available" ) , true , false ) ; } }
Register a handler function for template objects

@param string $name Object name
@param string $owner Plugin name that registers this action
@param mixed  $callback Callback: string with global function name or array($obj, 'methodname')
Register a handler function for template objects