From: Evan Prodromou Date: Wed, 14 Jan 2009 04:54:55 +0000 (-0500) Subject: Add a base class for UI widgets X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4826fde988dcb8b59b0545e05f36987c7396150f;p=quix0rs-gnu-social.git Add a base class for UI widgets --- diff --git a/lib/widget.php b/lib/widget.php new file mode 100644 index 0000000000..e69cc8b744 --- /dev/null +++ b/lib/widget.php @@ -0,0 +1,81 @@ +. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Base class for UI widgets + * + * A widget is a cluster of HTML elements that provide some functionality that's used on different + * parts of the site. Examples would be profile lists, notice lists, and common forms. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ + +class Widget +{ + /** + * HTMLOutputter to use for output + */ + + var $out = null; + + /** + * Prepare the widget for use + * + * @param HTMLOutputter $out output helper, defaults to null + */ + + function __construct($out=null) + { + $this->out = $out; + } + + /** + * Show the widget + * + * Emit the HTML for the widget, using the configured outputter. + * + * @return void + */ + + function show() + { + } +}