]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/widget.php
Type testing instead of just empty() in OStatusPlugin
[quix0rs-gnu-social.git] / lib / widget.php
index e69cc8b744dac85d5f3fe636ebad8d2385d90495..d068dea0f031b295a85fa73232c223abd437fb4e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
  *
  * Base class for UI widgets
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Widget
- * @package   Laconica
- * @author    Evan Prodromou <evan@controlyourself.ca>
- * @author    Sarven Capadisli <csarven@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @author    Sarven Capadisli <csarven@status.net>
+ * @copyright 2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://laconi.ca/
+ * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !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.
+ * 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, navigation menus (tabsets) and common forms.
  *
  * @category Widget
- * @package  Laconica
- * @author   Evan Prodromou <evan@controlyourself.ca>
- * @author   Sarven Capadisli <csarven@controlyourself.ca>
+ * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
+ * @author   Sarven Capadisli <csarven@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://laconi.ca/
+ * @link     http://status.net/
  *
  * @see      HTMLOutputter
  */
@@ -78,4 +79,30 @@ class Widget
     function show()
     {
     }
+
+    /**
+     * Get HTMLOutputter
+     *
+     * Return the HTMLOutputter for the widget.
+     *
+     * @return HTMLOutputter the output helper
+     */
+
+    function getOut()
+    {
+        return $this->out;
+    }
+
+    /**
+     * Delegate output methods to the outputter attribute.
+     *
+     * @param string $name      Name of the method
+     * @param array  $arguments Arguments called
+     *
+     * @return mixed Return value of the method.
+     */
+    function __call($name, $arguments)
+    {
+        return call_user_func_array(array($this->out, $name), $arguments);
+    }
 }