package WebGUI::Macro::m_currentMenuHorizontal; #------------------------------------------------------------------- # WebGUI is Copyright 2001 Plain Black Software. #------------------------------------------------------------------- # Please read the legal notices (docs/legal.txt) and the license # (docs/license.txt) that came with this distribution before using # this software. #------------------------------------------------------------------- # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- use strict; use WebGUI::Privilege; use WebGUI::Session; use WebGUI::SQL; #------------------------------------------------------------------- sub process { my ($output, $temp, @data, $sth, $first); $output = $_[0]; #---current menu horizontal --- if ($output =~ /\^m/) { $temp = ''; $first = 1; $sth = WebGUI::SQL->read("select title,urlizedTitle,pageId from page where parentId=$session{page}{pageId} order by sequenceNumber",$session{dbh}); while (@data = $sth->array) { if (WebGUI::Privilege::canViewPage($data[2])) { if ($first) { $first = 0; } else { $temp .= " · "; } $temp .= ''.$data[0].''; } } $sth->finish; $temp .= ''; $output =~ s/\^m/$temp/g; } return $output; } 1;