MV_PAGE — contains the relative pathname of the current page
This variable contains relative, system-wide path of the current page being served, without the suffix. The variable is not set in the configuration files, but is manipulated by the Interchange daemon while it is runnning.
Example: Reading the value of MV_PAGE
Add the following to a test Interchange page:
Filename: vars/MV_PAGE
Interchange 5.9.0:
Source: code/UserTag/css.tag
Line 34 (context shows lines 24-38)
my $id = ""; if (! $opt->{no_imagedir} ) { $id = $opt->{imagedir} || $Vend::Cfg->{ImageDir}; $id =~ s:/*$:/:; } $dir =~ s:/+$::; if($opt->{relative}) { my @dirs = split m{/}, $Global::Variable->{MV_PAGE}; pop @dirs; if(@dirs) { $id .= join "/", @dirs, ''; $dir = join "/", $dir, @dirs;
Source: code/UserTag/bar_button.tag
Line 18 (context shows lines 8-22)
# $Id: bar_button.tag,v 1.5 2007-03-30 23:40:56 pajamian Exp $ UserTag bar-button Order page current UserTag bar-button PosNumber 2 UserTag bar-button HasEndTag 1 UserTag bar-button Version $Revision: 1.5 $ UserTag bar-button Routine <<EOR sub { use strict; my ($page, $current, $html) = @_; $current = $Global::Variable->{MV_PAGE} if ! $current; $html =~ s!\[selected\]((?s:.)*)\[/selected]!!i; my $alt = $1; return $html if $page ne $current;
Source: code/UserTag/forum.tag
Line 133 (context shows lines 123-137)
EOF my $lastlevel = 0; my @uls; my $Tag = new Vend::Tags; my $row = shift; $opt->{reply_page} ||= 'forum/reply'; $opt->{submit_page} ||= 'forum/submit'; $opt->{display_page} ||= $Global::Variable->{MV_PAGE}; $opt->{date_format} ||= '%B %e, %Y @%H:%M'; my $menu_row = sub { shift; my $row = shift;
Source: code/UserTag/page_meta.tag
Line 16 (context shows lines 6-20)
# (at your option) any later version. See the LICENSE file for details. # # $Id: page_meta.tag,v 1.4 2007-03-30 23:40:57 pajamian Exp $ UserTag page-meta Order page UserTag page-meta addAttr UserTag page-meta Version $Revision: 1.4 $ UserTag page-meta Routine <<EOR sub { my ($page, $opt) = @_; $page ||= $Global::Variable->{MV_PAGE}; $page = "pages/$page"; my $meta = Vend::Table::Editor::meta_record($page) or return; while (my ($k, $v) = each %$meta) {
Source: code/UI_Tag/return_to.coretag
Line 63 (context shows lines 53-67)
if($opt->{stack} or $CGI::values{ui_return_stack}) { $type = 'formlink'; } else { $type = 'done'; $out .= "ui_return_to=\n"; } } if($type eq 'formlink') { $page = $Global::Variable->{MV_PAGE} if ! $page; $out .= qq{ui_return_to=$page\n}; for(@args) { tr/\n/\r/; $out .= qq{ui_return_to=$_\n}
Source: code/UI_Tag/return_to.coretag
Line 71 (context shows lines 61-75)
if($type eq 'formlink') { $page = $Global::Variable->{MV_PAGE} if ! $page; $out .= qq{ui_return_to=$page\n}; for(@args) { tr/\n/\r/; $out .= qq{ui_return_to=$_\n} } } elsif($type eq 'url') { $page = $Global::Variable->{MV_PAGE} if ! $page; $out .= $Tag->area( { href => $page, form => join("\n", @args), });
Source: code/UI_Tag/return_to.coretag
Line 78 (context shows lines 68-82)
} } elsif($type eq 'url') { $page = $Global::Variable->{MV_PAGE} if ! $page; $out .= $Tag->area( { href => $page, form => join("\n", @args), }); } elsif ($type eq 'form') { $page = $Global::Variable->{MV_PAGE} if ! $page; $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="$page">\n}; for(@args) { s/"/"/g; $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="$_">\n}
Source: code/UI_Tag/return_to.coretag
Line 86 (context shows lines 76-90)
} elsif ($type eq 'form') { $page = $Global::Variable->{MV_PAGE} if ! $page; $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="$page">\n}; for(@args) { s/"/"/g; $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="$_">\n} } } elsif ($type eq 'regen') { $page = $Global::Variable->{MV_PAGE} if ! $page; $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="ui_return_to=$page">\n}; for(@args) { s/"/"/g; $out .= qq{<INPUT TYPE=hidden NAME=ui_return_to VALUE="ui_return_to=$_">\n}
Source: code/UI_Tag/assume_identity.tag
Line 26 (context shows lines 16-30)
my ($file, $locale, $opt) = @_; my $pn; if($opt and $opt->{name}) { $pn = $opt->{name}; } else { $pn = $file; $pn =~ s/\.\w+$//; $pn =~ s:^pages/::; } $Global::Variable->{MV_PAGE} = $pn; $locale = 1 unless defined $locale; return Vend::Interpolate::interpolate_html( Vend::Util::readfile($file, undef, $locale) );
Source: code/UI_Tag/flex_select.coretag
Line 728 (context shows lines 718-732 in flex_select_init():30)
$meta_anchor = 'M'; } } $opt->{form_name} ||= "fs_$table"; $output{TOP_OF_TABLE} = <<EOF; <table width="$opt->{table_width}" border="$opt->{table_border}" cellpadding="$opt->{table_padding}" \ cellspacing="$opt->{table_spacing}" class="$opt->{table_class}"> EOF my $cwp = $Global::Variable->{MV_PAGE}; $opt->{form_href} ||= $CGI->{ui_searchpage} || $cwp; $opt->{form_extra} ||= ''; $opt->{form_extra} .= qq{ name="$opt->{form_name}"} if $opt->{form_name}; $opt->{form_extra} =~ s/^\s*/ /;
Source: code/UI_Tag/flex_select.coretag
Line 883 (context shows lines 873-887 in flex_select_init():30)
<td$td_extra> <table align="left" class="$opt->{group_class}" cellspacing=$opt->{group_spacing} \ cellpadding=$opt->{group_padding} width="$opt->{group_width}"> <tr> EOF unless($opt->{no_group} || $m->{fs_no_group}) { my $u = $Tag->area({ href => 'admin/flex_group', form => qq( mv_data_table=$table ui_meta_view=$mview from_page=$Global::Variable->{MV_PAGE} mv_arg=$col ), }); my $msg = errmsg('Select group by %s', $col);
Source: code/UI_Tag/file_navigator.coretag
Line 172 (context shows lines 162-176)
@files = grep $_ ne 'CVS', glob('*'); } else { @files = split /\s+/, $dir_mask; } } else { @files = grep $_ !~ m{/CVS$}, glob("$curdir/*"); } my $this_page = $Global::Variable->{MV_PAGE}; my $this = Vend::Interpolate::tag_area($this_page); $this =~ s/\?(.*)//; my $up_img = qq{<img src="up.gif" align=center border=0 height=22 width=20 title="upload ~FN~">};
Source: code/UI_Tag/if_mm.coretag
Line 105 (context shows lines 95-109)
$opt->{table} = $field; } $table = $opt->{table} || $table; my $acl; my $check; $status = 0, last CHECKIT if $func eq 'super'; if($check = $file_func{$func}) { $status = 1, last CHECKIT unless $record->{$check}; my $file = $field || $Global::Variable->{MV_PAGE}; # strip trailing slashes for checks on directories $file =~ s%/+$%%; #::logDebug("check=$check file=$file record=$record->{$check} prefix=$opt->{prefix}"); my @files = UI::Primitive::list_glob($record->{$check}, $opt->{prefix});
Source: code/UI_Tag/auto_wizard.coretag
Line 925 (context shows lines 915-929 in compile_wizard():426)
</td> <td class=cdata width=500> $WIDGET$ </td> </tr> <tr class=rspacer> <td colspan=2><img src="bg.gif" height=1 width=1></td> EOF $opts{ui_wizard_fields} = join " ", @$name; $opts{mv_nextpage} = $Global::Variable->{MV_PAGE}; $opts{mv_prevpage} = $Global::Variable->{MV_PAGE} if $current_page != 1; $opts{bottom_buttons} = 1; #::logDebug("walking optref");
Source: lib/Vend/Interpolate.pm
Line 3295 (context shows lines 3285-3299 in tag_more_list():3253)
} $session = $q->{mv_cache_key}; my $first = $q->{mv_first_match} || 0; $chunk = $q->{mv_matchlimit}; $perm = $q->{mv_more_permanent} ? ':1' : ''; $total = $q->{matches}; my $next = defined $q->{mv_next_pointer} ? $q->{mv_next_pointer} : $first + $chunk; $page = $q->{mv_search_page} || $Global::Variable->{MV_PAGE}; $prefix = $q->{prefix} || ''; my $form_arg = "mv_more_ip=1\nmv_nextpage=$page"; $form_arg .= "\npf=$q->{prefix}" if $q->{prefix}; $form_arg .= "\n$opt->{form}" if $opt->{form};
Source: lib/Vend/Interpolate.pm
Line 4850 (context shows lines 4840-4854 in tag_loop_list():4843)
return $page; } sub tag_loop_list { my ($list, $opt, $text) = @_; my $fn; my @rows; $opt->{prefix} ||= 'loop'; $opt->{label} ||= "loop" . ++$::Instance->{List_it} . $Global::Variable->{MV_PAGE}; #::logDebug("list is: " . uneval($list) ); ## Thanks to Kaare Rasmussen for this suggestion
Source: lib/Vend/Interpolate.pm
Line 5319 (context shows lines 5309-5323 in timed_build():5252)
my $secs; CHECKDIR: { last CHECKDIR if Vend::File::file_name_is_absolute($file); last CHECKDIR if $file and $file !~ m:/:; my $dir; if ($file) { $dir = '.'; } else { $dir = 'timed'; $file = $saved_file || $Vend::Flypart || $Global::Variable->{MV_PAGE}; #::logDebug("static=$file"); if($saved_file) { $file = $saved_file; $file =~ s:^scan/::;
Source: lib/Vend/Interpolate.pm
Line 5328 (context shows lines 5318-5332 in timed_build():5252)
$dir = 'timed'; $file = $saved_file || $Vend::Flypart || $Global::Variable->{MV_PAGE}; #::logDebug("static=$file"); if($saved_file) { $file = $saved_file; $file =~ s:^scan/::; $file = generate_key($file); $file = "scan/$file"; } else { $saved_file = $file = ($Vend::Flypart || $Global::Variable->{MV_PAGE}); } $file .= $Vend::Cfg->{HTMLsuffix}; } $dir .= "/$1"
Source: lib/Vend/Form.pm
Line 340 (context shows lines 330-344 in links():323)
$opt->{extra} = " $opt->{extra}" if $opt->{extra}; my $template = $opt->{template} || <<EOF; <a href="{URL}"{EXTRA}>{SELECTED <b>}{LABEL}{SELECTED </b>}</a> EOF my $o_template = $opt->{o_template} || <<EOF; <b>{TVALUE}</b> EOF my $href = $opt->{href} || $Global::Variable->{MV_PAGE}; $opt->{form} = "mv_action=return" unless $opt->{form}; my $no_encode = $opt->{pre_filter} eq 'decode_entities' ? 1 : 0;
Source: lib/Vend/Util.pm
Line 1181 (context shows lines 1171-1185 in readin():1165)
my($fn, $contents, $gate, $pathdir, $dir, $level); local($/); if($file =~ m{[\[<]}) { ::logGlobal("Possible code/SQL injection attempt with file name '%s'", $file); $file = escape_chars($file); ::logGlobal("Suspect file changed to '%s'", $file); } $Global::Variable->{MV_PREV_PAGE} = $Global::Variable->{MV_PAGE} if defined $Global::Variable->{MV_PAGE}; $Global::Variable->{MV_PAGE} = $file; $file =~ s#^\s+##; $file =~ s#\s+$##;
Source: lib/Vend/Util.pm
Line 1372 (context shows lines 1362-1376 in vendUrl():1316)
or ($Vend::Cookie and $::Scratch->{mv_no_session_id}); $ct = ++$Vend::Session->{pageCount} unless $opt->{no_count}; if($opt->{no_session} or $::Pragma->{url_no_session_id}) { undef $id; undef $ct; } if($opt->{link_relative}) { my $cur = $Global::Variable->{MV_PAGE}; $cur =~ s{/[^/]+$}{} and $path = "$cur/$path"; }