From 0093b035c12bf21c88f57e4f0931b0abce214f43 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 13 Jan 2009 23:48:05 -0500 Subject: Modify public stream to use new UI framework I modified public.php to use the new UI framework. Since the Action class isn't functional yet, I don't know if it works. I took some of the functionality, like the public tabs nav and the feeds list, and made them widgets. I also moved the navigation from common_navigation() to a method of Action. --- lib/publicgroupnav.php | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 lib/publicgroupnav.php (limited to 'lib/publicgroupnav.php') diff --git a/lib/publicgroupnav.php b/lib/publicgroupnav.php new file mode 100644 index 000000000..d21d0a458 --- /dev/null +++ b/lib/publicgroupnav.php @@ -0,0 +1,83 @@ +. + * + * @category Action + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2008 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 all actions + * + * This is the base class for all actions in the package. An action is + * more or less a "view" in an MVC framework. + * + * Actions are responsible for extracting and validating parameters; using + * model classes to read and write to the database; and doing ouput. + * + * @category Output + * @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 PublicGroupNav +{ + var $action = null; + + function __construct($action=null) + { + $this->action = $action; + } + + function show() + { + $this->action->elementStart('ul', array('id' => 'nav_views')); + + common_menu_item(common_local_url('public'), _('Public'), + _('Public timeline'), $this->action == 'public'); + + common_menu_item(common_local_url('tag'), _('Recent tags'), + _('Recent tags'), $this->action == 'tag'); + + if (count(common_config('nickname', 'featured')) > 0) { + common_menu_item(common_local_url('featured'), _('Featured'), + _('Featured users'), $this->action == 'featured'); + } + + common_menu_item(common_local_url('favorited'), _('Popular'), + _("Popular notices"), $this->action == 'favorited'); + + common_element_end('ul'); + } +} -- cgit v1.2.3-54-g00ecf