added a bunch of style functions

This commit is contained in:
JT Smith 2004-01-04 06:02:28 +00:00
parent 264287a0fb
commit 759dfd2f6b
22 changed files with 75 additions and 36 deletions

View file

@ -27,3 +27,5 @@
- Added new Authentication System.
- Collateral macros now return undef instead of the macro tag when no
matching collateral is found.
- Added style personalization.
- Added admin style option.

View file

@ -21,7 +21,6 @@ save you many hours of grief.
Please see docs/migration.txt for details.
5.5.0
--------------------------------------------------------------------
* If you have any custom Message Board templates they will be

File diff suppressed because one or more lines are too long

View file

@ -447,7 +447,6 @@ while (my $authHash = $authSth->hashRef){
#--------------------------------------------
print "\tRemoving unneeded files and directories.\n" unless ($quiet);
unlink("../../lib/WebGUI/Operation/Style.pm");
unlink("../../lib/WebGUI/Wobject/Item.pm");
unlink("../../lib/WebGUI/Wobject/LinkList.pm");
unlink("../../lib/WebGUI/Wobject/FAQ.pm");

View file

@ -12,7 +12,7 @@ delete from international where internationalId=501 and namespace='WebGUI';
delete from international where internationalId=154 and namespace='WebGUI';
delete from international where internationalId=157 and namespace='WebGUI';
delete from international where internationalId=398 and namespace='WebGUI';
#delete from style where name='Reserved';
delete from style where name='Reserved';
delete from international where internationalId=654 and namespace='WebGUI';
delete from international where internationalId=609 and namespace='WebGUI';
delete from international where internationalId=659 and namespace='WebGUI';
@ -169,7 +169,7 @@ delete from international where languageId=1 and namespace='USS' and internation
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (71,1,'USS','User Submission Systems (USS) are a great way to add a sense of community to any site as well as get free content from your users. The User Submission System name is misleading to some people, because they immediately think of users as visitors. However, users are also staff, or business partners, or even yourself. With the USS you can select who can add new content, and even who can moderate that content.\r\n<br><br>\r\nUser Submission systems are so versatile that they allow you to create all kinds of applications, just by editing a few templates. Example applications are Photo Galleries, FAQs, Link Lists, Guest Books, Classifieds, and more.\r\n\r\n\r\n<p>\r\n<b>Submission Template</b><br/>\r\nChoose a layout for the individual submissions.\r\n<p/>\r\n\r\n<b>Submission Form Template</b><br>\r\nChoose a layout of the form users see when submitting content.\r\n<p>\r\n\r\n\r\n<b>Submissions Per Page</b><br>\r\nHow many submissions should be listed per page in the submissions index?\r\n<br><br>\r\n\r\n\r\n<b>Filter Content</b><br>\r\nSelect the level of content filtering you wish to perform on all submitted content.\r\n<p>\r\n\r\n<b>Sort By</b><br>\r\nThe field to sort the submission list by.\r\n<p>\r\n\r\n<b>Sort Order</b><br>\r\nThe direction to sort the submission list by.\r\n<p>\r\n\r\n\r\n\r\n\r\n<b>Who can approve?</b><br>\r\nWhat group is allowed to approve and deny content?\r\n<br><br>\r\n\r\n<b>Who can contribute?</b><br>\r\nWhat group is allowed to contribute content?\r\n<br><br>\r\n\r\n\r\n<b>Default Status</b><br>\r\nShould submissions be set to <i>Approved</i>, <i>Pending</i>, or <i>Denied</i> by default?\r\n<br><br>\r\n<i>Note:</i> If you set the default status to Pending, then be prepared to monitor your message log for new submissions.\r\n<p>\r\n\r\n<b>Karma Per Submission</b><br>\r\nHow much karma should be given to a user when they contribute to this user submission system?\r\n<p>\r\n\r\n\r\n<b>Allow discussion?</b><br>\r\nChecking this box will enable responses to your article much like Articles on Slashdot.org.\r\n<p>\r\n\r\n\r\n', 1070199700,NULL);
INSERT INTO template VALUES (1,'Default Login Box','<div class=\"loginBox\">\n<tmpl_if user.isVisitor>\n <tmpl_var form.header>\n <span><tmpl_var username.label><br></span>\n <tmpl_var username.form>\n <span><br><tmpl_var password.label><br></span>\n <tmpl_var password.form>\n <span><br></span>\n <tmpl_var form.login>\n <tmpl_var form.footer>\n <tmpl_if session.setting.anonymousRegistration>\n <p><a href=\"account.create.url\"><tmpl_var account.create.label></a></p>\n </tmpl_if> \n<tmpl_else>\n <tmpl_unless customText>\n <tmpl_var hello.label> <a href=\"<tmpl_var account.display.url>\"><tmpl_var session.user.username></a>.\n <tmpl_var logout.label>\n <tmpl_else>\n <tmpl_var customText>\n </tmpl_unless>\n</tmpl_if>\n</div>\n','Macro/L_loginBox');
INSERT INTO template VALUES (2,'Horizontal Login Box','<div class=\"loginBox\">\n<tmpl_if user.isVisitor>\n <tmpl_var form.header>\n <table border=\"0\" class=\"loginBox\" cellpadding=\"1\" cellspacing=\"0\">\n <tr>\n <td><tmpl_var username.form></td>\n <td><tmpl_var password.form></td>\n <td><tmpl_var form.login></td>\n </tr>\n <tr>\n <td><tmpl_var username.label></td>\n <td><tmpl_var password.label></td>\n <td></td>\n </tr>\n </table> \n <tmpl_var form.footer>\n <tmpl_if session.setting.anonymousRegistration>\n <a href=\"account.create.url\"><tmpl_var account.create.label></a>\n </tmpl_if> \n<tmpl_else>\n <tmpl_unless customText>\n <tmpl_var hello.label> <a href=\"<tmpl_var account.display.url>\"><tmpl_var session.user.username></a>.\n <tmpl_var logout.label><br />\n <tmpl_else>\n <tmpl_var customText>\n </tmpl_unless>\n</tmpl_if>\n</div>\n','Macro/L_loginBox');
INSERT INTO template VALUES (2,'DHTML Admin Bar','<script language=\"JavaScript1.2\" src=\"^Extras;/coolmenus/coolmenus4.js\">\n/*****************************************************************************\nCopyright (c) 2001 Thomas Brattli (webmaster@dhtmlcentral.com)\n \nDHTML coolMenus - Get it at coolmenus.dhtmlcentral.com\nVersion 4.0_beta\nThis script can be used freely as long as all copyright messages are\nintact.\n \nExtra info - Coolmenus reference/help - Extra links to help files ****\nCSS help: http://192.168.1.31/projects/coolmenus/reference.asp?m=37\nGeneral: http://coolmenus.dhtmlcentral.com/reference.asp?m=35\nMenu properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=47\nLevel properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=48\nBackground bar properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=49\nItem properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=50\n******************************************************************************/\n</script>\n<style type=\"text/css\">\n \n.adminBarTop,.adminBarTopOver,.adminBarSub,.adminBarSubOver{position:absolute; overflow:hidden; width:130; height:25; cursor:pointer; cursor:hand}\n.adminBarTop,.adminBarTopOver{padding:4px; font-size:12px; font-weight:bold}\n.adminBarTop{color:white; }\n.adminBarTopOver,.adminBarSubOver{color:#EC4300;}\n.adminBarSub,.adminBarSubOver{padding:2px; font-size:11px; font-weight:bold}\n.adminBarSub{color: white; background-color: #666666; layer-background-color: #666666;}\n.adminBarSubOver,.adminBarSubOver,.adminBarBorder,.adminBarBkg{layer-background-color: black; background-color: black;}\n.adminBarBorder{position:absolute; visibility:hidden; z-index:300}\n.adminBarBkg{position:absolute; width:10; height:10; visibility:hidden; }\n</style>\n\n<script language=\"JavaScript1.2\">\nadminBar=new makeCM(\"adminBar\"); \n\n//menu properties\nadminBar.resizeCheck=1; \nadminBar.rows=1; \nadminBar.onlineRoot=\"\"; \nadminBar.pxBetween =0;\nadminBar.fillImg=\"^Extras/spacer.gif\"; \nadminBar.fromTop=0; \nadminBar.fromLeft=50; \nadminBar.wait=300; \nadminBar.zIndex=10000;\nadminBar.menuPlacement=\"left\";\n\n//background bar properties\nadminBar.useBar=1; \nadminBar.barWidth=\"100%\"; \nadminBar.barHeight=\"menu\"; \nadminBar.barX=0;\nadminBar.barY=\"menu\"; \nadminBar.barClass=\"adminBarBkg\";\nadminBar.barBorderX=0; \nadminBar.barBorderY=0;\n\nadminBar.level[0]=new cm_makeLevel(150,20,\"adminBarTop\",\"adminBarTopOver\",1,1,\"adminBarBorder\",0,\"bottom\",0,0,0,0,0);\nadminBar.level[1]=new cm_makeLevel(150,18,\"adminBarSub\",\"adminBarSubOver\",1,1,\"adminBarBorder\",0,\"right\",0,0,\"menu_arrow.gif\",10,10);\n\n\nadminBar.makeMenu(\'addcontent\',\'\',\'<tmpl_var addcontent.label>\',\'\');\n<tmpl_loop addcontent_loop> \n adminBar.makeMenu(\'addcontent<tmpl_var addcontent.count>\',\'addcontent\',\'<tmpl_var addcontent.label>\',\'<tmpl_var addcontent.url>\');\n</tmpl_loop>\n\nadminBar.makeMenu(\'clipboard\',\'\',\'<tmpl_var clipboard.label>\',\'\');\n<tmpl_loop clipboard_loop> \n adminBar.makeMenu(\'clipboard<tmpl_var clipboard.count>\',\'clipboard\',\'<tmpl_var clipboard.label>\',\'<tmpl_var clipboard.url>\');\n</tmpl_loop>\n\nadminBar.makeMenu(\'admin\',\'\',\'<tmpl_var admin.label>\',\'\');\n<tmpl_loop admin_loop> \n adminBar.makeMenu(\'admin<tmpl_var admin.count>\',\'admin\',\'<tmpl_var admin.label>\',\'<tmpl_var admin.url>\');\n</tmpl_loop>\n \nadminBar.construct()\n</script>\n<br />\n','Macro/AdminBar');
INSERT INTO template VALUES (2,'DHTML Admin Bar','<script language=\"JavaScript1.2\" src=\"^Extras;/coolmenus/coolmenus4.js\">\n/*****************************************************************************\nCopyright (c) 2001 Thomas Brattli (webmaster@dhtmlcentral.com)\n \nDHTML coolMenus - Get it at coolmenus.dhtmlcentral.com\nVersion 4.0_beta\nThis script can be used freely as long as all copyright messages are\nintact.\n \nExtra info - Coolmenus reference/help - Extra links to help files ****\nCSS help: http://192.168.1.31/projects/coolmenus/reference.asp?m=37\nGeneral: http://coolmenus.dhtmlcentral.com/reference.asp?m=35\nMenu properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=47\nLevel properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=48\nBackground bar properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=49\nItem properties: http://coolmenus.dhtmlcentral.com/properties.asp?m=50\n******************************************************************************/\n</script>\n<style type=\"text/css\">\n \n.adminBarTop,.adminBarTopOver,.adminBarSub,.adminBarSubOver{position:absolute; overflow:hidden; width:150; height:25; cursor:pointer; cursor:hand}\n.adminBarTop,.adminBarTopOver{padding:4px; font-size:12px; font-weight:bold}\n.adminBarTop{color:white; }\n.adminBarTopOver,.adminBarSubOver{color:#EC4300;}\n.adminBarSub,.adminBarSubOver{padding:2px; font-size:11px; font-weight:bold}\n.adminBarSub{color: white; background-color: #666666; layer-background-color: #666666;}\n.adminBarSubOver,.adminBarSubOver,.adminBarBorder,.adminBarBkg{layer-background-color: black; background-color: black;}\n.adminBarBorder{position:absolute; visibility:hidden; z-index:300}\n.adminBarBkg{position:absolute; width:10; height:10; visibility:hidden; }\n</style>\n\n<script language=\"JavaScript1.2\">\nadminBar=new makeCM(\"adminBar\"); \n\n//menu properties\nadminBar.resizeCheck=1; \nadminBar.rows=1; \nadminBar.onlineRoot=\"\"; \nadminBar.pxBetween =0;\nadminBar.fillImg=\"^Extras/spacer.gif\"; \nadminBar.fromTop=0; \nadminBar.fromLeft=50; \nadminBar.wait=300; \nadminBar.zIndex=10000;\nadminBar.menuPlacement=\"left\";\n\n//background bar properties\nadminBar.useBar=1; \nadminBar.barWidth=\"100%\"; \nadminBar.barHeight=\"menu\"; \nadminBar.barX=0;\nadminBar.barY=\"menu\"; \nadminBar.barClass=\"adminBarBkg\";\nadminBar.barBorderX=0; \nadminBar.barBorderY=0;\n\nadminBar.level[0]=new cm_makeLevel(150,20,\"adminBarTop\",\"adminBarTopOver\",1,1,\"adminBarBorder\",0,\"bottom\",0,0,0,0,0);\nadminBar.level[1]=new cm_makeLevel(150,18,\"adminBarSub\",\"adminBarSubOver\",1,1,\"adminBarBorder\",0,\"right\",0,0,\"menu_arrow.gif\",10,10);\n\n\nadminBar.makeMenu(\'addcontent\',\'\',\'<tmpl_var addcontent.label>\',\'\');\n<tmpl_loop addcontent_loop> \n adminBar.makeMenu(\'addcontent<tmpl_var addcontent.count>\',\'addcontent\',\'<tmpl_var addcontent.label>\',\'<tmpl_var addcontent.url>\');\n</tmpl_loop>\n\nadminBar.makeMenu(\'clipboard\',\'\',\'<tmpl_var clipboard.label>\',\'\');\n<tmpl_loop clipboard_loop> \n adminBar.makeMenu(\'clipboard<tmpl_var clipboard.count>\',\'clipboard\',\'<tmpl_var clipboard.label>\',\'<tmpl_var clipboard.url>\');\n</tmpl_loop>\n\nadminBar.makeMenu(\'admin\',\'\',\'<tmpl_var admin.label>\',\'\');\n<tmpl_loop admin_loop> \n adminBar.makeMenu(\'admin<tmpl_var admin.count>\',\'admin\',\'<tmpl_var admin.label>\',\'<tmpl_var admin.url>\');\n</tmpl_loop>\n \nadminBar.construct()\n</script>\n<br />\n','Macro/AdminBar');
INSERT INTO template VALUES (1,'Default Admin Bar',' <script language=\"JavaScript\" type=\"text/javascript\"> <!--\n function goContent(){\n location = document.content.contentSelect.options[document.content.contentSelect.selectedIndex].value\n }\n function goAdmin(){\n location = document.admin.adminSelect.options[document.admin.adminSelect.selectedIndex].value\n }\n function goClipboard(){\n location = document.clipboard.clipboardSelect.options[document.clipboard.clipboardSelect.selectedIndex].value\n }\n //--> </script>\n \n<div class=\"adminBar\">\n<table class=\"adminBar\" width=\"100%\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\n <tr>\n <form name=\"content\"> <td>\n <select name=\"contentSelect\" onChange=\"goContent()\">\n <option value=\"\"><tmpl_var addcontent.label></option>\n <tmpl_loop addcontent_loop>\n <option value=\"<tmpl_var addcontent.url>\"><tmpl_var addcontent.label></option>\n </tmpl_loop>\n </select>\n </td> </form>\n <form name=\"clipboard\"> <td align=\"center\">\n <select name=\"clipboardSelect\" onChange=\"goClipboard()\">\n <option value=\"\"><tmpl_var clipboard.label></option>\n <tmpl_loop clipboard_loop>\n <option value=\"<tmpl_var clipboard.url>\"><tmpl_var clipboard.label></option>\n </tmpl_loop>\n </select>\n </td> </form>\n <form name=\"admin\"> <td align=\"center\">\n <select name=\"adminSelect\" onChange=\"goAdmin()\">\n <option value=\"\"><tmpl_var admin.label></option>\n <tmpl_loop admin_loop>\n <option value=\"<tmpl_var admin.url>\"><tmpl_var admin.label></option>\n </tmpl_loop>\n </select>\n </td> </form>\n </tr>\n</table>\n</div>\n','Macro/AdminBar');
delete from international where internationalId=34 and namespace='WebGUI';
delete from international where internationalId=19 and namespace='SQLReport';
@ -288,4 +288,13 @@ delete from template where namespace='Operation/Profile/Edit' and templateId=1;
INSERT INTO template (templateId,name,template,namespace) VALUES (1,'Default Edit Profile Template','<tmpl_var displayTitle>\r\n\r\n<tmpl_if profile.message>\r\n <tmpl_var profile.message>\r\n</tmpl_if>\r\n\r\n<tmpl_var profile.form.header>\r\n<table >\r\n<tmpl_var profile.form.hidden>\r\n\r\n<tmpl_loop profile.form.elements>\r\n <tr>\r\n <td class=\"tableHeader\" valign=\"top\" colspan=\"2\">\r\n <tmpl_var profile.form.category>\r\n </td>\r\n </tr>\r\n \r\n <tmpl_loop profile.form.category.loop>\r\n <tr>\r\n <td class=\"formDescription\" valign=\"top\">\r\n <tmpl_var profile.form.element.label>\r\n </td>\r\n <td class=\"tableData\">\r\n <tmpl_var profile.form.element>\r\n <tmpl_if profile.form.element.subtext>\r\n <span class=\"formSubtext\">\r\n <tmpl_var profile.form.element.subtext>\r\n </span>\r\n </tmpl_if>\r\n </td>\r\n </tr>\r\n </tmpl_loop>\r\n</tmpl_loop>\r\n<tmpl_loop create.form.profile>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var profile.formElement.label></td>\r\n <td class=\"tableData\"><tmpl_var profile.formElement></td>\r\n</tr>\r\n</tmpl_loop>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"></td>\r\n <td class=\"tableData\">\r\n <tmpl_var profile.form.submit>\r\n </td>\r\n</tr>\r\n</table>\r\n<tmpl_var create.form.footer>\r\n\r\n<div class=\"accountOptions\">\r\n <ul>\r\n <tmpl_loop profile.accountOptions>\r\n <li><tmpl_var options.display>\r\n </tmpl_loop>\r\n </ul>\r\n</div>','Operation/Profile/Edit');
delete from template where namespace='Operation/Profile/View' and templateId=1;
INSERT INTO template (templateId,name,template,namespace) VALUES (1,'Default Profile Display Template','<tmpl_var displayTitle>\r\n\r\n<table>\r\n <tmpl_loop profile.elements>\r\n <tr>\r\n <tmpl_if profile.category>\r\n <td colspan=\"2\" class=\"tableHeader\">\r\n <tmpl_var profile.category>\r\n </td>\r\n <tmpl_else>\r\n <td class=\"tableHeader\">\r\n <tmpl_var profile.label>\r\n </td>\r\n <td class=\"tableData\">\r\n <tmpl_var profile.value>\r\n </td>\r\n </tmpl_if> \r\n </tr>\r\n </tmpl_loop>\r\n</table>\r\n<div class=\"accountOptions\">\r\n <ul>\r\n <tmpl_loop profile.accountOptions>\r\n <li><tmpl_var options.display>\r\n </tmpl_loop>\r\n </ul>\r\n</div>','Operation/Profile/View');
#End Authentication Changes
#End Authentication Changes
alter table page add column printableStyleId int not null default 3;
delete from international where languageId=1 and namespace='WebGUI' and internationalId=1079;
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (1079,1,'WebGUI','Printable Style', 1073152790,'A label describing a style that looks good when printing the page.');
delete from international where languageId=1 and namespace='WebGUI' and internationalId=1081;
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (1081,1,'WebGUI','Admin Style', 1073161679,'A label indicating that the user should choose a style for admin pages.');
delete from international where languageId=1 and namespace='WebGUI' and internationalId=1080;
insert into international (internationalId,languageId,namespace,message,lastUpdated,context) values (1080,1,'WebGUI','Use admin style?', 1073161583,'A label asking the user if they want to use a seperate admin style from the main page style.');
insert into settings values ("useAdminStyle",1);
insert into settings values ("adminStyleId",1000);

View file

@ -16,7 +16,7 @@ use WebGUI::URL;
#-------------------------------------------------------------------
sub process {
if ($session{env}{QUERY_STRING} =~ /op/ || $session{env}{QUERY_STRING} =~ /func/) {
if ($session{form}{op} || $session{form}{func}) {
return '<a href="'.WebGUI::URL::page().'">'.$session{page}{title}.'</a>';
} else {
return $session{page}{title};

View file

@ -22,11 +22,11 @@ use WebGUI::Utility;
sub process {
my ($temp, @param, $styleId);
@param = WebGUI::Macro::getParams($_[0]);
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},'makePrintable=1');
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},'op=makePrintable');
if ($param[1] ne "") {
($styleId) = WebGUI::SQL->quickArray("select styleId from style where name=".quote($param[1]));
if ($styleId != 0) {
$temp = WebGUI::URL::append($temp,'style='.$styleId);
$temp = WebGUI::URL::append($temp,'styleId='.$styleId);
}
}
if ($param[0] ne "linkonly") {

View file

@ -30,6 +30,7 @@ use WebGUI::Operation::Scratch;
use WebGUI::Operation::Search;
use WebGUI::Operation::Settings;
use WebGUI::Operation::Statistics;
use WebGUI::Operation::Style;
use WebGUI::Operation::Template;
use WebGUI::Operation::Theme;
use WebGUI::Operation::Trash;

View file

@ -217,17 +217,9 @@ sub www_editGroup {
-value=>$g->autoDelete,
-label=>WebGUI::International::get(975)
);
my %databaseLinkOptions;
tie %databaseLinkOptions, 'Tie::IxHash',
"0"=>WebGUI::International::get(19,'SQLReport'),
WebGUI::DatabaseLink::getHash();
$f->selectList(
-name=>"databaseLinkId",
-options=>\%databaseLinkOptions,
-label=>WebGUI::International::get(20,'SQLReport'),
-value=>[$g->databaseLinkId],
-subtext=>(WebGUI::Privilege::isInGroup(3)) ? '<a href="'.WebGUI::URL::page("op=listDatabaseLinks").'">'.WebGUI::International::get(981).'</a>' : ""
);
$f->databaseLink(
-value=>[$g->databaseLinkId]
);
$f->textarea(
-name=>"dbQuery",
-value=>$g->dbQuery,

View file

@ -74,7 +74,8 @@ sub _recursePageTree {
hideFromNavigation,
newWindow,
cacheTimeout,
cacheTimeoutVisitor
cacheTimeoutVisitor,
printableStyleId
) values (
$newPageId,
$_[1],
@ -101,7 +102,8 @@ sub _recursePageTree {
$package{hideFromNavigation},
$package{newWindow},
$package{cacheTimeout},
$package{cacheTimeoutVisitor}
$package{cacheTimeoutVisitor},
$package{printableStyleId}
)");
_recursePageTree($package{pageId},$newPageId);
}
@ -111,6 +113,7 @@ sub _recursePageTree {
#-------------------------------------------------------------------
sub www_selectPackageToDeploy {
my ($output, %data, $sth, $flag);
$session{page}{useAdminStyle} = 1;
if (WebGUI::Privilege::canEditPage()) {
tie %data,'Tie::CPHash';
$output = helpIcon(30);

View file

@ -69,7 +69,7 @@ sub _recursivelyChangeStyle {
$sth = WebGUI::SQL->read("select pageId from page where parentId=$_[0]");
while (($pageId) = $sth->array) {
if (WebGUI::Privilege::canEditPage($pageId)) {
WebGUI::SQL->write("update page set styleId=$session{form}{styleId} where pageId=$pageId");
WebGUI::SQL->write("update page set styleId=$session{form}{styleId}, printableStyleId=$session{form}{printableStyleId} where pageId=$pageId");
_recursivelyChangeStyle($pageId);
}
}
@ -248,6 +248,7 @@ use WebGUI::TabForm;
#-------------------------------------------------------------------
sub www_editPage {
my ($f, $endDate, $output, $subtext, $childCount, %hash, %page);
$session{page}{useAdminStyle} = 1;
tie %hash, "Tie::IxHash";
tie %page, "Tie::CPHash";
if (WebGUI::Privilege::canEditPage($session{form}{npp})) {
@ -318,7 +319,7 @@ sub www_editPage {
-value=>$page{urlizedTitle},
-uiLevel=>3
);
$f->getTab("properties")->select(
$f->getTab("properties")->selectList(
-name=>"languageId",
-label=>WebGUI::International::get(304),
-value=>[$page{languageId}],
@ -365,17 +366,17 @@ sub www_editPage {
-unitsValue=>$data[1],
-uiLevel=>8
);
if (WebGUI::Privilege::isInGroup(5)) {
$subtext = ' &nbsp; <a href="'.WebGUI::URL::page('op=listStyles')
.'">'.WebGUI::International::get(6).'</a>';
} else {
$subtext = "";
}
$f->getTab("layout")->template(
-name=>"styleId",
-label=>WebGUI::International::get(105),
-value=>$page{styleId},
-subtext=>$subtext,
-label=>WebGUI::International::get(912),
-value=>($page{styleId} || 2),
-namespace=>'style',
-uiLevel=>5
);
$f->getTab("layout")->template(
-name=>"printableStyleId",
-label=>WebGUI::International::get(1079),
-value=>($page{printableStyleId} || 3),
-namespace=>'style',
-uiLevel=>5
);
@ -494,6 +495,7 @@ sub www_editPageSave {
WebGUI::SQL->write("update page set
title=".quote($session{form}{title}).",
styleId=$session{form}{styleId},
printableStyleId=$session{form}{printableStyleId},
ownerId=$session{form}{ownerId},
groupIdView=$session{form}{groupIdView},
groupIdEdit=$session{form}{groupIdEdit},
@ -604,6 +606,7 @@ sub www_pastePage {
#-------------------------------------------------------------------
sub www_viewPageTree {
my ($output);
$session{page}{useAdminStyle} = 1;
$output = '<h1>'.WebGUI::International::get(448).'</h1>';
$output .= _traversePageTree(0,0);
return $output;

View file

@ -128,6 +128,17 @@ sub www_editMiscSettings {
},
-label=>WebGUI::International::get(1069)
);
$f->yesNo(
-name=>"useAdminStyle",
-value=>$session{setting}{useAdminStyle},
-label=>WebGUI::International::get(1080)
);
$f->template(
-name=>"adminStyleId",
-namespace=>"style",
-value=>$session{setting}{adminStyleId},
-label=>WebGUI::International::get(1081)
);
$f->submit;
$output .= $f->print;
return _submenu($output);

View file

@ -66,6 +66,7 @@ our @EXPORT = qw(&menuWrapper);
#-------------------------------------------------------------------
sub menuWrapper {
my ($output, $key);
$session{page}{useAdminStyle} = 1;
$output = '<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr><td width="70%" class="tableData" valign="top">';
$output .= $_[0];

View file

@ -180,9 +180,9 @@ sub www_viewStatistics {
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(794).':</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from wobject where wobjectId > 0 and pageId<>3");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(148).':</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from style where styleId>1000");
($data) = WebGUI::SQL->quickArray("select count(*) from template where templateId>1000 and namespace='style'");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(427).':</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from template where templateId>1000");
($data) = WebGUI::SQL->quickArray("select count(*) from template where templateId>1000 and namespace<>'style'");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(792).':</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from collateral");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(793).':</td><td class="tableData">'.$data.'</td></tr>';

View file

@ -89,6 +89,13 @@ sub process {
my %var;
$var{'body.content'} = shift;
my $templateId = shift;
if ($session{page}{makePrintable}) {
$templateId = $session{page}{printableStyleId};
} elsif ($session{page}{useAdminStyle} ne "" && $session{setting}{useAdminStyle}) {
$templateId = $session{setting}{adminStyleId};
} elsif ($session{scratch}{personalStyleId} ne "") {
$templateId = $session{scratch}{personalStyleId};
}
my $type = lc($session{setting}{siteicon});
$type =~ s/.*\.(.*?)$/$1/;
$var{'head.tags'} = '

View file

@ -1165,6 +1165,7 @@ An id this namespace of the WebGUI international system. This message will be re
sub www_edit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($self, @p) = @_;
my ($properties, $layout, $privileges, $heading, $helpId, $headingId) =
rearrange([qw(properties layout privileges heading helpId headingId)], @p);

View file

@ -453,6 +453,7 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_editField {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($output, %field, $f, %fieldStatus);
tie %field, 'Tie::CPHash';
tie %fieldStatus, 'Tie::IxHash';

View file

@ -318,6 +318,7 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_editEvent {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my (%recursEvery, $special, $output, $f, %event);
tie %event, 'Tie::CPHash';
tie %recursEvery, 'Tie::IxHash';

View file

@ -184,6 +184,7 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_editDownload {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($output, $file, $f);
$file = $_[0]->getCollateral("FileManager_file","FileManager_fileId",$session{form}{did});
$output .= helpIcon(2,$_[0]->get("namespace"));

View file

@ -102,6 +102,7 @@ sub www_edit {
#-------------------------------------------------------------------
sub www_editForum {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my $forumMeta;
if ($session{form}{forumId} ne "new") {
$forumMeta = WebGUI::SQL->quickHashRef("select title,description from MessageBoard_forums where forumId=".$session{form}{forumId});

View file

@ -116,6 +116,7 @@ sub purge {
#-------------------------------------------------------------------
sub www_addAccessory {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($output, $f, $accessory, @usedAccessories);
$output = helpIcon(4,$_[0]->get("namespace"));
$output .= '<h1>'.WebGUI::International::get(16,$_[0]->get("namespace")).'</h1>';
@ -137,6 +138,7 @@ sub www_addAccessory {
#-------------------------------------------------------------------
sub www_addAccessorySave {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($seq);
($seq) = WebGUI::SQL->quickArray("select max(sequenceNumber) from Product_accessory
where wobjectId=".$_[0]->get("wobjectId"));
@ -326,6 +328,7 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_editBenefit {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($output, $data, $f, $benefits);
$data = $_[0]->getCollateral("Product_benefit","Product_benefitId",$session{form}{bid});
$output = helpIcon(6,$_[0]->get("namespace"));
@ -361,6 +364,7 @@ sub www_editBenefitSave {
#-------------------------------------------------------------------
sub www_editFeature {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($output, $data, $f, $features);
$data = $_[0]->getCollateral("Product_feature","Product_featureId",$session{form}{fid});
$output = helpIcon(2,$_[0]->get("namespace"));
@ -396,6 +400,7 @@ sub www_editFeatureSave {
#-------------------------------------------------------------------
sub www_editSpecification {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($output, $data, $f, $hashRef);
$data = $_[0]->getCollateral("Product_specification","Product_specificationId",$session{form}{sid});
$output = helpIcon(3,$_[0]->get("namespace"));

View file

@ -306,6 +306,7 @@ sub www_editSave {
#-------------------------------------------------------------------
sub www_editAnswer {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($question, $output, $f, $answer);
$answer = $_[0]->getCollateral("Survey_answer","Survey_answerId",$session{form}{aid});
$output = '<h1>'.WebGUI::International::get(18,$_[0]->get("namespace")).'</h1>';
@ -383,6 +384,7 @@ sub www_editAnswerSave {
#-------------------------------------------------------------------
sub www_editQuestion {
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditWobject($_[0]->get("wobjectId")));
$session{page}{useAdminStyle} = 1;
my ($output, $f, $question, $answerFieldType, $sth, %data);
tie %data, 'Tie::CPHash';
$question = $_[0]->getCollateral("Survey_question","Survey_questionId",$session{form}{qid});