Added the new templating mechanism to styles and templates.

This commit is contained in:
JT Smith 2002-10-07 05:58:07 +00:00
parent 8c9040e396
commit 834f4abb03
8 changed files with 122 additions and 88 deletions

View file

@ -197,7 +197,7 @@ sub www_editPage {
-uiLevel=>8
);
$f->readOnly(
-value=>WebGUI::Template::selectTemplate($page{templateId}),
-value=>WebGUI::Template::select($page{templateId}),
-label=>WebGUI::International::get(356),
-uiLevel=>5
);
@ -362,8 +362,8 @@ sub www_editPageSave {
menuTitle=".quote($session{form}{menuTitle}).",
synopsis=".quote($session{form}{synopsis})."
where pageId=$session{form}{pageId}");
WebGUI::SQL->write("update wobject set templatePosition=0 where pageId=$session{form}{pageId}
and templatePosition>".(WebGUI::Template::countPositions($session{form}{templateId})-1));
WebGUI::SQL->write("update wobject set templatePosition=1 where pageId=$session{form}{pageId}
and templatePosition>".WebGUI::Template::countPositions($session{form}{templateId}));
_recursivelyChangeStyle($session{page}{pageId}) if ($session{form}{recurseStyle});
_recursivelyChangePrivileges($session{page}{pageId}) if ($session{form}{recursePrivs});
WebGUI::Session::refreshPageInfo($session{page}{pageId}) if ($session{form}{pageId} == $session{page}{pageId});

View file

@ -68,7 +68,7 @@ sub www_deleteTemplateConfirm {
} elsif (WebGUI::Privilege::isInGroup($session{setting}{templateManagersGroup})) {
$a = WebGUI::SQL->read("select * from page where templateId=".$session{form}{tid});
while (($pageId) = $a->array) {
WebGUI::SQL->write("update wobject set templatePosition=0 where pageId=$pageId");
WebGUI::SQL->write("update wobject set templatePosition=1 where pageId=$pageId");
}
$a->finish;
WebGUI::SQL->write("delete from template where templateId=".$session{form}{tid});
@ -85,7 +85,7 @@ sub www_editTemplate {
tie %template, 'Tie::CPHash';
if (WebGUI::Privilege::isInGroup($session{setting}{templateManagersGroup})) {
if ($session{form}{tid} eq "new") {
$template{template} = "<table>\n <tr>\n <td>\n\n^0;\n\n </td>\n </tr>\n</table>\n";
$template{template} = "<table>\n <tr>\n <td>\n\n<tmpl_var template.position1>\n\n </td>\n </tr>\n</table>\n";
} else {
%template = WebGUI::SQL->quickHash("select * from template where templateId=$session{form}{tid}");
}