# 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: Menu4.bunit,v 1.6 2010/05/31 17:35:39 nagler Exp $ WikiText(); my($reset_menu) = sub { my($r, $p, $c) = @_; req()->with_realm($r, sub { my($path) = class('Type.WikiDataName')->to_absolute($p, 1); model('RealmFile')->delete({path => $path}); model('RealmFile')->create_with_content({path => $path}, \$c); return; }); return; }; $reset_menu->(qw(site x.bmenu), <<'EOF'); Label,Link Xa,/bp/Xa Xb,/bunit_wiki/bp/Xb Xc,/bunit_wiki/bp/Xc EOF $reset_menu->(qw(site y.bmenu), <<'EOF'); Label,Link Ya,/bp/Ya Yb,/bp/Yb EOF $reset_menu->(qw(bunit_wiki y.bmenu), <<'EOF'); Label,Link Ya Yb Yc EOF [ inline_case(sub {wiki_uri_to_req('/Xb'); 1}), [{ value => '@b-menu value=x', is_public => 0, }] => qr{@{[join('.*', qw( class="bmenu" "/bp/Xa" Xa selected "/bunit_wiki/bp/Xb" Xb "/bunit_wiki/bp/Xc" Xc ))]}}, inline_case(sub {wiki_uri_to_req('/Yb'); 1}), [{ value => '@b-menu value=y', is_public => 0, }] => qr{@{[join('.*', qw( class="bmenu" "/bunit_wiki/\w+/Ya" Ya selected "/bunit_wiki/\w+/Yb" Yb "/bunit_wiki/\w+/Yc" Yc ))]}}, ];