shlomi-fish-homepage / lib / local-defs.wml

<set-var latemp_navmenu_object_class="HTML::Widgets::NavMenu::JQueryTreeView" />
<set-var latemp_with_favicon="<latemp_mynot "$(PRINTABLE)" />" />
<set-var latemp_with_xml_declaration="1" />
<set-var latemp_with_breadcrumbs_trail="1" />
<set-var latemp_html_standard="xhtml1.1" />
<set-var latemp_nav_links_allowed_places="top-left" />
<set-var latemp_gen_plain_page="$(PRINTABLE)" />
<set-var latemp_with_head_meta_tags="<latemp_mynot "$(PRINTABLE)" />" />
<set-var latemp_with_html_head_nav_links="<latemp_mynot "$(PRINTABLE)" />" />
<set-var latemp_with_html_head_stylesheets="<latemp_mynot "$(PRINTABLE)" />" />
<:{
    use utf8;

    sub _wrap_as_utf8 {
        my ($cb) = @_;

        binmode STDOUT, ":utf8";

        $cb->();

        binmode STDOUT, ":raw";
    }

}:>
<define-tag latemp_get_breadcrumbs_trail_unconditionally>
<:{
    use utf8;

    init_section_nav_menu();
    my $total_leading_path = $section_nav_menu->total_leading_path(
        {
            main_leading_path => $leading_path,
        }
    );

    my $render_leading_path_component = sub {
        my $component = shift;
        my $title = $component->title();
        my $title_attr = defined($title) ? " title=\"$title\"" : "";
        return "<a href=\"" . CGI::escapeHTML($component->direct_url()) .
            "\"$title_attr>" .
            $component->label() . "</a>";
    };
    {
        _wrap_as_utf8( sub {
            print join(" → ",
                (map
                 { $render_leading_path_component->($_) }
                 @$total_leading_path
                ));
        });
    }
}:>
</define-tag>

<define-tag latemp_get_nav_menu_html>
<:{

{
    _wrap_as_utf8( sub {
        print join("\n", @$nav_html);
    });
}

}:>
</define-tag>


<define-tag latemp_get_html_head_nav_links>
<:{
my @keys = (sort { $a cmp $b } keys(%$nav_links_obj));
foreach my $key (@keys)
{
    my $val = $nav_links_obj->{$key};
    my $url = CGI::escapeHTML($val->direct_url());
    my $title = $val->title();
    _wrap_as_utf8( sub {
        print "<link rel=\"$key\" href=\"$url\" title=\"$title\" />\n";
    });
}
}:>
</define-tag>


<define-tag latemp_get_html_body_nav_links_helper>
<preserve with_accesskey />
<set-var %attributes />
<:{
    my $with_accesskey = "<get-var with_accesskey />";
    my @params;
    if ($with_accesskey ne "")
    {
        push @params, ('with_accesskey' => $with_accesskey);
    }
    _wrap_as_utf8(sub {
        print $nav_links_renderer->get_total_html(@params);
    });
}:>
<restore with_accesskey />
</define-tag>
<define-tag latemp_get_html_body_nav_links_helper>
<preserve with_accesskey />
<set-var %attributes />
<preserve object_class />
<set-var object_class="<latemp_default_val "<get-var latemp_navmenu_object_class />" "HTML::Widgets::NavMenu" />" />
<:{
use strict;
use warnings;

use MyNavData;
use <get-var object_class />;
use CGI qw();
use MyNavLinks;

my $filename = "<latemp_default_val "<get-var latemp_filename />" "$(LATEMP_FILENAME)" />";
$filename =~ s!index\.html$!!;
$filename = "/$filename";

my $expanded_nav_bar = <get-var object_class />->new(
    'path_info' => $filename,
    'current_host' => "<latemp_default_val "<get-var latemp_server />" "$(LATEMP_SERVER)" />",
    MyNavData->generic_get_params({ fully_expanded => 1}),
    'ul_classes' => [ "navbarmain", ("navbarnested") x 10 ],
    'no_leading_dot' => 1,
    );

my $rendered_results = $expanded_nav_bar->render();

# use Data::Dumper; die Dumper($rendered_results);
my $shlomif_nav_links = $rendered_results->{nav_links};

my $shlomif_nav_links_obj = $rendered_results->{nav_links_obj};

use vars qw($shlomif_nav_links_renderer);

$shlomif_nav_links_renderer = MyNavLinks->new(
        'nav_links' => $shlomif_nav_links,
        'nav_links_obj' => $shlomif_nav_links_obj,
        'root' => "$(ROOT)",
        );

}:>
<:{
    my $with_accesskey = "<get-var with_accesskey />";
    my @params;
    if ($with_accesskey ne "")
    {
        push @params, ('with_accesskey' => $with_accesskey);
    }
    print $shlomif_nav_links_renderer->get_total_html(@params);
}:>
<restore with_accesskey />
<restore object_class />
</define-tag>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.