[ 1471218 ] 6.8.8: Unable to change Default Home Page

This commit is contained in:
JT Smith 2006-04-28 19:50:55 +00:00
parent 149789c11e
commit 29e4effdb9
3 changed files with 47 additions and 9 deletions

View file

@ -110,6 +110,7 @@
- added [ 1201811 ] resizable textAreas
- added [ 1376374 ] WebGUI should return a Last-Modified http/1.x header
- added [ 1216059 ] Admin Bar Made Sticky
- fix [ 1471218 ] 6.8.8: Unable to change Default Home Page
- fix [ 1463411 ] Denied content not getting expired or trashed
- fix [ 1461522 ] 6.8.7 Linking items in the page tree (PDF and other files)
- fix [ 1465280 ] BR Tag in Outlook

View file

@ -96,6 +96,8 @@ Renders an asset selector.
sub toHtml {
my $self = shift;
my $asset = WebGUI::Asset->newByDynamicClass($self->session, $self->get("value")) || WebGUI::Asset->getRoot($self->session);
my $url = $asset->getUrl("op=formAssetTree;formId=".$self->get('id'));
$url .= ";classLimiter=".$self->get("class") if ($self->get("class"));
return WebGUI::Form::Hidden->new($self->session,
name=>$self->get("name"),
extras=>$self->get("extras"),
@ -110,7 +112,7 @@ sub toHtml {
)->toHtml
.WebGUI::Form::Button->new($self->session,
value=>"...",
extras=>'onclick="window.open(\''.$asset->getUrl("op=formAssetTree;classLimiter=".$self->get("class").";formId=".$self->get('id')).'\',\'assetPicker\',\'toolbar=no, location=no, status=no, directories=no, width=400, height=400\');"'
extras=>'onclick="window.open(\''.$url.'\',\'assetPicker\',\'toolbar=no, location=no, status=no, directories=no, width=400, height=400\');"'
)->toHtml;
}

View file

@ -41,24 +41,59 @@ sub www_formAssetTree {
my @crumb;
my $ancestors = $base->getLineage(["self","ancestors"],{returnObjects=>1});
foreach my $ancestor (@{$ancestors}) {
push(@crumb,'<a href="'.$ancestor->getUrl("op=formAssetTree;classLimiter=".$session->form->process("classLimiter").";formId="
.$session->form->process("formId")).'">'.$ancestor->get("menuTitle").'</a>');
my $url = $ancestor->getUrl("op=formAssetTree;formId=".$session->form->process("formId"));
$url .= ";classLimiter=".$session->form->process("classLimiter") if ($session->form->process("classLimiter"));
push(@crumb,'<a href="'.$url.'" class="crumb">'.$ancestor->get("menuTitle").'</a>');
}
my $output = '<p>'.join(" &gt; ", @crumb)."</p>\n";
my $output = '
<html><head>
<style type="text/css">
.base {
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, Arial, sans-serif;
font-size: 12px;
}
a {
color: #0f3ccc;
text-decoration: none;
}
a:hover {
color: #000080;
text-decoration: underline;
}
.selectLink {
color: #cc7700;
}
.crumb {
color: orange;
}
.crumbTrail {
padding: 3px;
background-color: #eeeeee;
-moz-border-radius: 10px;
}
.traverse {
font-size: 15px;
}
</style></head><body>
<div class="base">
<div class="crumbTrail">'.join(" &gt; ", @crumb)."</div><br />\n";
my $children = $base->getLineage(["children"],{returnObjects=>1});
my $i18n = WebGUI::International->new($session);
my $limit = $session->form->process("classLimiter");
foreach my $child (@{$children}) {
next unless $child->canView;
if ($child->get("className") =~ /^$session->form->process("classLimiter")/) {
$output .= '<a href="#" onclick="window.opener.document.getElementById(\''.$session->form->process("formId")
if ($limit eq "" || $child->get("className") =~ /^$limit/) {
$output .= '<a href="#" class="selectLink" onclick="window.opener.document.getElementById(\''.$session->form->process("formId")
.'\').value=\''.$child->getId.'\';window.opener.document.getElementById(\''.
$session->form->process("formId").'_display\').value=\''.$child->get("title").'\';window.close();">['.$i18n->get("select").']</a> ';
} else {
$output .= "[".$i18n->get("select")."] ";
$output .= '<span class="selectLink">['.$i18n->get("select").']</span> ';
}
$output .= '<a href="'.$child->getUrl("op=formAssetTree;classLimiter=".$session->form->process("classLimiter").";formId="
.$session->form->process("formId")).'">'.$child->get("menuTitle").'</a>'."<br />\n";
my $url = $child->getUrl("op=formAssetTree;formId=".$session->form->process("formId"));
$url .= ";classLimiter=".$session->form->process("classLimiter") if ($session->form->process("classLimiter"));
$output .= '<a href="'.$url.'" class="traverse">'.$child->get("menuTitle").'</a>'."<br />\n";
}
$output .= '</div></body></html>';
$session->style->useEmptyStyle("1");
return $output;
}