mourningdove/cgi-bin/bml/scheme/global.look

122 lines
3.1 KiB
Text
Raw Normal View History

2026-05-24 01:03:05 +00:00
# This code was forked from the LiveJournal project owned and operated
# by Live Journal, Inc. The code has been modified and expanded by
# Dreamwidth Studios, LLC. These files were originally licensed under
# the terms of the license supplied by Live Journal, Inc, which can
# currently be found at:
#
# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
#
# In accordance with the original license, this code and all its
# modifications are provided under the GNU General Public License.
# A copy of that license can be found in the LICENSE file included as
# part of this distribution.
_parent=>../../lj-bml-blocks.pl
SECURITYPRIVATE=>{Ss}<img src="<?imgprefix?>/silk/entry/private.png" alt="private" width=16 height=16 align=absmiddle>
SECURITYPROTECTED=>{Ss}<img src="<?imgprefix?>/silk/entry/locked.png" alt="protected" width=14 height=15 align=absmiddle>
SECURITYGROUPS=>{Ss}<img src="<?imgprefix?>/silk/entry/filtered.png" alt="custom" idth=21 height=13 align=absmiddle>
HELP=>{DR}(<a href="%%data%%"><i>help</i></a>)
INERR=>{DR}<font color="#ff0000"><b>%%data%%</b></font>
BADINPUT<=
<?h1 <?_ml bml.badinput.head _ml?> h1?>
<?p <?_ml bml.badinput.body1 _ml?> p?>
<=BADINPUT
REQUIREPOST=><?_ml bml.requirepost _ml?>
H1=>{D}<h1>%%data%%</h1>
H2=>{D}<h2>%%data%%</h2>
HR=>{S}<hr />
P=>{D}<p>%%data%%</p>
BLOCK=>{D}<div>%%data%%</div>
STANDOUT<=
{D}<blockquote>
<hr />
%%data%%
<hr />
</blockquote>
<=STANDOUT
ERRORBAR<=
{D}<blockquote>
<hr />
%%data%%
<hr />
</blockquote>
<=ERRORBAR
WARNINGBAR<=
{D}<blockquote>
<hr />
%%data%%
<hr />
</blockquote>
<=WARNINGBAR
BADCONTENT<=
<?h1 <?_ml Error _ml?> h1?>
<?p <?_ml bml.badcontent.body _ml?> p?>
<=BADCONTENT
DE<=
%%data%%
<=DE
HOTCOLOR=>{S}#ff0000
PAGE<=
{Fp}<html>
<head><title>%%title%%</title>
<?_code LJ::res_includes() _code?>
<link rel="stylesheet" type="text/css" href="<?statprefix?>/lj_base-app.css" />
%%head%%
</head>
<body %%bodyopts%%>
<?_code
return @errors && scalar @errors ? LJ::error_list(@errors) : '';
_code?>
%%body%%
</body>
</html>
<=PAGE
# Dreamwidth menu structure
menunav<=
<?_code
{
use DW::Logic::MenuNav;
my $ret;
$ret .= "<ul class="left">\n";
my $nav_links = DW::Logic::MenuNav->get_menu_navigation; # defaults to remote
foreach my $cathash ( @{ $nav_links } ) {
my $cat = $cathash->{name};
my @submenu = @{ $cathash->{items} };
my @displayed = ();
foreach my $item ( @submenu ) {
push @displayed, "<li class='subnav'><a href='$item->{url}'>" . BML::ml( "$item->{text}", $item->{text_opts} ) . "</a></li>" if $item->{display};
}
if ( @displayed ) { # only display a top-level menu if any of its items are displayed
$ret .= "<li id='${cat}_topnav' class='topnav has-dropdown'><a href='$LJ::SITEROOT/nav/$cat'>$ML{\"menunav.$cat\"}</a>\n";
$ret .= "<ul id='${cat}_subnav' class='subnav_container dropdown'>\n";
$ret .= join( "\n", @displayed ) . "\n";
$ret .= "</ul>\n";
$ret .= "</li>\n";
}
}
$ret .= "</ul>\n";
return $ret;
}
_code?>
<=menunav