# Copyright (c) 2009 bivio Software Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: TaskMenu2.bunit,v 1.7 2011/01/15 14:56:41 nagler Exp $ use HTML::Parser (); my($res) = []; my($p) = HTML::Parser->new( api_version => 3, text_h => [sub {push(@$res, shift)}, 'text'], start_h => [sub { my($tag, $attr) = @_; push(@$res, $attr->{class}) if $tag && $tag eq 'div'; }, 'tag,attr'], ); $p->report_tags('a', 'div'); $p->ignore_elements('script'); Widget({ view_class_map => 'XHTMLWidget', parse_return => sub { my(undef, $actual, $expect) = @_; @$res = (); my($fh); open($fh, '<', \($actual->[0])); $p->parse_file($fh); close($fh); return [join(' ', @$res)]; }, }); req()->set_realm_and_user(qw(fourem root)) ->initialize_fully('FORUM_WIKI_VIEW'); [ [[qw( SITE_WIKI_VIEW FORUM_BLOG_LIST FORUM_FILE_TREE_LIST FORUM_CRM_THREAD_ROOT_LIST FORUM_WIKI_VIEW FORUM_CALENDAR GROUP_TASK_LOG FORUM_MAIL_THREAD_ROOT_LIST FORUM_MOTION_LIST GROUP_USER_LIST FORUM_TUPLE_USE_LIST )]] => 'task_menu Home Blog Files Wiki Calendar Mail Polls Roster Tables', [[{ task_id => 'SITE_WIKI_VIEW', sort_label => 'sort_first', }, qw( FORUM_BLOG_LIST FORUM_CRM_THREAD_ROOT_LIST FORUM_FILE_TREE_LIST FORUM_WIKI_VIEW GROUP_TASK_LOG FORUM_CALENDAR FORUM_MAIL_THREAD_ROOT_LIST GROUP_USER_LIST FORUM_MOTION_LIST FORUM_TUPLE_USE_LIST )], {want_sorting => 1}] => 'task_menu Home Blog Calendar Files Mail Polls Roster Tables Wiki', [[qw( FORUM_BLOG_LIST FORUM_WIKI_VIEW FORUM_CALENDAR )], {show_current_task => 0}] => 'task_menu Blog Calendar', [[('SITE_WIKI_VIEW')x5], {want_more => 1}] => 'task_menu Home Home Home Home Home', [[('SITE_WIKI_VIEW')x4], {want_more_threshold => 2}] => 'task_menu Home Home task_menu_wrapper want_sep dd_menu Home Home more ▼', [[('SITE_WIKI_VIEW')x3], {want_more_threshhold => 2}] => 'task_menu Home Home Home', ];