added asset form control, fixed some interval problems, added a check so users can't delete the default page or the not found page

This commit is contained in:
JT Smith 2005-02-06 17:02:20 +00:00
parent 1523c9c904
commit 778236efcb
8 changed files with 198 additions and 21 deletions

View file

@ -1,4 +1,4 @@
package WebGUI::Operation::RichEdit;
package WebGUI::Operation::FormHelpers;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2004 Plain Black Corporation.
@ -16,6 +16,34 @@ use WebGUI::HTMLForm;
use WebGUI::Session;
use WebGUI::Style;
#-------------------------------------------------------------------
sub www_formAssetTree {
my $base = WebGUI::Asset->newByUrl || WebGUI::Asset->getRoot;
my @crumb;
my $ancestors = $base->getLineage(["self","ancestors"],{returnQuickReadObjects=>1});
foreach my $ancestor (@{$ancestors}) {
push(@crumb,'<a href="'.$ancestor->getUrl("op=formAssetTree&classLimiter=".$session{form}{classLimiter}."&formId="
.$session{form}{formId}).'">'.$ancestor->get("menuTitle").'</a>');
}
my $output = '<p>'.join(" &gt; ", @crumb)."</p>\n";
my $children = $base->getLineage(["children"],{returnQuickReadObjects=>1});
foreach my $child (@{$children}) {
next unless $child->canView;
if ($child->get("className") =~ /^$session{form}{classLimiter}/) {
$output .= '<a href="#" onclick="window.opener.document.getElementById(\''.$session{form}{formId}
.'\').value=\''.$child->getId.'\';window.opener.document.getElementById(\''.
$session{form}{formId}.'_display\').value=\''.$child->get("title").'\';window.close();">(&bull;)</a> ';
} else {
$output .= "(&bull;) ";
}
$output .= '<a href="'.$child->getUrl("op=formAssetTree&classLimiter=".$session{form}{classLimiter}."&formId="
.$session{form}{formId}).'">'.$child->get("menuTitle").'</a>'."<br />\n";
}
$session{page}{useEmptyStyle} = 1;
return $output;
}
#-------------------------------------------------------------------
sub www_richEditPageTree {

View file

@ -60,24 +60,21 @@ sub www_editSettings {
-value=>$session{setting}{companyURL}
);
# content settings
my $pages = WebGUI::SQL->buildHashRef("select pageId,menuTitle from page order by menuTitle");
my %htmlFilter = (
'none'=>$i18n->get(420),
'most'=>$i18n->get(421),
'javascript'=>$i18n->get(526),
'all'=>$i18n->get(419)
);
$tabform->getTab("content")->selectList(
$tabform->getTab("content")->asset(
-name=>"defaultPage",
-options=>$pages,
-label=>$i18n->get(527),
-value=>[$session{setting}{defaultPage}]
-value=>$session{setting}{defaultPage}
);
$tabform->getTab("content")->selectList(
$tabform->getTab("content")->asset(
-name=>"notFoundPage",
-options=>$pages,
-label=>$i18n->get(141),
-value=>[$session{setting}{notFoundPage}]
-value=>$session{setting}{notFoundPage}
);
$tabform->getTab("content")->text(
-name=>"urlExtension",
@ -101,7 +98,7 @@ sub www_editSettings {
);
$tabform->getTab("content")->yesNo(
-name=>"metaDataEnabled",
-label=>$i18n->get("Enable Metadata ?", 'MetaData'),
-label=>$i18n->get("Enable Metadata ?", 'Asset'),
-value=>$session{setting}{metaDataEnabled}
);
# user interface settings
@ -202,12 +199,10 @@ sub www_editSettings {
-label=>$i18n->get(540),
-value=>$session{setting}{karmaPerLogin}
);
my ($interval, $units) = WebGUI::DateTime::secondsToInterval($session{setting}{sessionTimeout});
$tabform->getTab("user")->interval(
-name=>"sessionTimeout",
-label=>$i18n->get(142),
-intervalValue=>$interval,
-unitsValue=>$units
-value=>$session{setting}{sessionTimeout}
);
$tabform->getTab("user")->yesNo(
-name=>"selfDeactivation",
@ -221,9 +216,9 @@ sub www_editSettings {
);
$tabform->getTab("user")->yesNo(
-name=>"passiveProfilingEnabled",
-label=>$i18n->get("Enable passive profiling ?", 'MetaData'),
-label=>$i18n->get("Enable passive profiling ?", 'Asset'),
-value=>$session{setting}{passiveProfilingEnabled},
-extras=>' onChange="alert(\''.$i18n->get("Illegal Warning","MetaData").'\')" '
-extras=>' onChange="alert(\''.$i18n->get("Illegal Warning","Asset").'\')" '
);
# auth settings
WebGUI::Style::setScript($session{config}{extrasURL}."/swapLayers.js",{language=>"Javascript"});