From: Michael J. Rubinsky Date: Sun, 4 Jul 2010 15:22:12 +0000 (-0400) Subject: This file was superseded by the twitter_stream.php file X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=415b25c5d41dfc17eb50104370eb8aff2773ef2f;p=horde.git This file was superseded by the twitter_stream.php file --- diff --git a/horde/lib/Block/twitter.php b/horde/lib/Block/twitter.php deleted file mode 100644 index b2f35ebb9..000000000 --- a/horde/lib/Block/twitter.php +++ /dev/null @@ -1,141 +0,0 @@ - - * @package Horde_Block - */ - -if (@include_once 'Services/Twitter.php') { - $block_name = _("Twitter Status Update"); -} - -require_once 'Horde/Form.php'; -require_once 'Horde/Form/Renderer.php'; -require_once 'Horde/Variables.php'; - -class Horde_Block_Horde_twitter extends Horde_Block { - - /** - * Whether this block has changing content. - */ - var $updateable = false; - - var $_app = 'horde'; - - /** - * The title to go in this block. - * - * @return string The title text. - */ - function _title() - { - if (!empty($this->_params['username'])) { - return sprintf(_("Twitter Status Update for %s"), $this->_params['username']); - } - return _("Twitter Status Update"); - } - - function _params() - { - if (!@include_once 'Services/Twitter.php') { - Horde::logMessage('The Twitter block will not work without Services_Twitter from PEAR. Run pear install Services_Twitter.', 'ERR'); - return array( - 'error' => array( - 'type' => 'error', - 'name' => _("Error"), - 'default' => _("Internal error: Twitter block not available.") - ) - ); - } else { - global $conf; - - return array( - 'username' => array( - 'type' => 'text', - 'name' => _("Twitter Username"), - 'required' => true, - ), - 'password' => array( - 'type' => 'password', - 'name' => _("Twitter Password"), - 'required' => true, - ) - ); - } - } - - /** - * The content to go in this block. - * - * @return string The content - */ - function _content() - { - if (!@include_once 'Services/Twitter.php') { - Horde::logMessage('The Twitter block will not work without Services_Twitter from PEAR. Run pear install Services_Twitter.', 'ERR'); - return _("Twitter block not available. Details have been logged for the administrator."); - } - - global $conf; - - if (empty($this->_params['username']) || - empty($this->_params['password'])) { - return _("Must configure a Twitter username and password to use this block."); - } - - // Store the username and password in the session to enable - // services/twitterapi.php's functionality. - $_SESSION['horde']['twitterblock']['username'] = $this->_params['username']; - $_SESSION['horde']['twitterblock']['password'] = $this->_params['password']; - - // Get a unique instance ID in case someone likes to have multiple - // Twitter blocks. - $instance = md5(serialize(array($this->_params['username'], - $this->_params['password']))); - - $endpoint = Horde::url('services/twitterapi.php', true); - $spinner = '$(\'' . $instance . '_loading\')'; - $inputNode = '$(\'' . $instance . '_newStatus\')'; - $notifyNode = '$(\'' . $instance . '_notifications\')'; - $html = << - function updateStatus(statusText) - { - {$spinner}.toggle(); - params = new Object(); - params.actionID = 'updateStatus'; - params.statusText = statusText; - new Ajax.Updater({success:'currentStatus'}, - '$endpoint', - { - method: 'post', - parameters: params, - onComplete: function(response) { - e = {$notifyNode} - e.innerHTML = response.responseText; - setTimeout('e.innerHTML= ""', 15000); - {$inputNode}.value = 'What are you working on now?'; - {$spinner}.toggle() - }, - onFailure: function() {{$spinner}.toggle()} - } - ); - } - - -EOF; - $html .= '
' - . '' - . '' - . Horde::img('loading.gif', '', array('id' => $instance . '_loading', 'style' => 'display:none;')); - - return $html; - } - -}