<?php
/**
 * $Horde: horde/lib/Block/fortune.php,v 1.3 2003/08/21 23:38:11 chuck Exp $
 *
 * @package Horde
 */
class Horde_Block_fortune extends Horde_Block {

    /**
     * Constructor.
     */
    function Horde_Block_fortune($params = array())
    {
        $this->_params = $params;
        $this->_app = 'horde';
        $this->_type = 'fortune';
    }

    /**
     * Does this block have any user editable parameters?
     *
     * @return boolean  True is there are editable parameters.
     *                  False if there are not.
     */
    function isEditable()
    {
        return true;
    }

    /**
     * The title to go in this block.
     *
     * @return string   The title text.
     */
    function _title()
    {
        return _("Fortune");
    }

    /**
     * The content to go in this block.
     *
     * @return string   The content
     */
    function _content()
    {
        return nl2br(shell_exec($this->_params['fortune']));
    }

}
