Skip to content

Commit

Permalink
Add Horde_Core_Block::refreshContent()
Browse files Browse the repository at this point in the history
This method has been called via Horde_Application_Ajax_Handler since
at least Horde 5.1, so make it part of the official API going forward.
  • Loading branch information
mrubinsk committed Nov 23, 2013
1 parent 6a12379 commit 0799e80
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions framework/Core/lib/Horde/Core/Block.php
Expand Up @@ -171,6 +171,38 @@ public function getContent()
*/
abstract protected function _content();

/**
* Returns the content for this block in response to a user requested
* update from within the block.
*
* This function handles the changing of current application as
* needed so code is executed in the scope of the application the
* block originated from.
*
* @param Horde_Variables $vars
*
* @return string The block's content.
*/
public function refreshContent($vars)
{
return $this->_call('_refreshContent', '', $vars);
}

/**
* Stub to be overridden by concrete block that supports user-initiated
* updating of content via ajax.
*
* @todo For Horde 6 this should be abstract.
*
* @param Horde_Variables $vars
*
* @return string
*/
protected function _refreshContent($vars)
{
return '';
}

/**
* The data to send on an AJAX update request.
*
Expand Down

0 comments on commit 0799e80

Please sign in to comment.