From 4826fde988dcb8b59b0545e05f36987c7396150f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 13 Jan 2009 23:54:55 -0500 Subject: [PATCH] Add a base class for UI widgets --- lib/widget.php | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 lib/widget.php 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() + { + } +}