Update of /cvsroot/phpslash/phpslash-ft/public_html/admin
In directory usw-pr-cvs1:/tmp/cvs-serv944/phpslash-ft/public_html/admin
Modified Files:
storyAdmin.php3
Log Message:
story action methods return output
Index: storyAdmin.php3
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/storyAdmin.php3,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** storyAdmin.php3 1 Jun 2002 16:11:46 -0000 1.10
--- storyAdmin.php3 13 Jun 2002 20:03:44 -0000 1.11
***************
*** 17,78 ****
$ary['section_id'] = $section_id;
! slashhead($pagetitle,$xsiteobject);
$story = new Story_admin;
! if ($perm->have_perm("story")) {
switch ($submit) {
case "delete":
! if(!$story->deleteStory($story_id)) {
! error(pslgetText("Sorry. You do not have the necessary privilege to view this page."));
}
- $story->listStory($ary,$next);
break;
case "save":
! $success = $story->saveStory($HTTP_POST_VARS);
! if( $success == false) {
! error($story->message);
! $story->newStory($HTTP_POST_VARS, "array");
}
! $story->listStory($ary,$next);
break;
case "modify":
! $story->listStory($ary,$next);
break;
case "preview":
$HTTP_POST_VARS['name'] = $HTTP_POST_VARS['author_id'];
! $story->showStory($HTTP_POST_VARS);
! titlebar("100%", "Edit Story");
$HTTP_POST_VARS['title'] = stripslashes($HTTP_POST_VARS['title']);
$HTTP_POST_VARS['intro_text'] = stripslashes($HTTP_POST_VARS['intro_text']);
$HTTP_POST_VARS['body_text'] = stripslashes($HTTP_POST_VARS['body_text']);
! $story->newStory($HTTP_POST_VARS, "array");
break;
case "edit":
! $HTTP_POST_VARS['story_id'] = $story_id;
! if(!$story->newStory($HTTP_POST_VARS, "database")) {
! error(pslgetText("Sorry. You do not have the necessary privilege to view this page."));
}
break;
! case "new":
! $story->newStory($HTTP_POST_VARS, "array");
break;
default:
! $story->listStory($ary, $next);
}
} else {
! titlebar("100%", "Error! Invalid Privileges");
! error(pslgetText("Sorry. You do not have the necessary privilege to view this page."));
}
! slashfoot();
page_close();
--- 17,151 ----
$ary['section_id'] = $section_id;
! $auth->login_if(!$perm->have_perm('storyList'));
!
! $content = '';
$story = new Story_admin;
! if ($perm->have_perm("storyList")) {
!
switch ($submit) {
case "delete":
! if ($perm->have_perm("storyDelete")) {
! if(!$story->deleteStory($story_id)) {
! $content .= getError(pslgetText("Sorry. You do not have the necessary privilege to view this page."));
! }
! }
! if ($perm->have_perm("storyList")) {
! $content .= $story->listStory($ary,$next);
}
break;
case "save":
! if ($perm->have_perm("storySave")) {
! $success = $story->saveStory($HTTP_POST_VARS);
! if( $success == false) {
! $content .= getError($story->message);
! $content .= $story->newStory($HTTP_POST_VARS, "array");
! }
}
! if ($perm->have_perm("storyList")) {
! $content .= $story->listStory($ary,$next);
! }
break;
case "modify":
! if ($perm->have_perm("storyList")) {
! $content .= $story->listStory($ary,$next);
! }
break;
case "preview":
$HTTP_POST_VARS['name'] = $HTTP_POST_VARS['author_id'];
! $content .= $story->showStory($HTTP_POST_VARS);
! $content .= getTitlebar("100%", "Edit Story");
$HTTP_POST_VARS['title'] = stripslashes($HTTP_POST_VARS['title']);
$HTTP_POST_VARS['intro_text'] = stripslashes($HTTP_POST_VARS['intro_text']);
$HTTP_POST_VARS['body_text'] = stripslashes($HTTP_POST_VARS['body_text']);
! $content .= $story->newStory($HTTP_POST_VARS, "array");
break;
case "edit":
! if ($perm->have_perm("storyEdit")) {
! $HTTP_POST_VARS['story_id'] = $story_id;
! $returned = $story->newStory($HTTP_POST_VARS, "database");
! if(isset($returned)) {
! $content .= $returned;
! } else {
! $content .= getError(pslgetText("Sorry. You do not have the necessary privilege to view this page."));
! }
}
break;
! case "new":
! if ($perm->have_perm("storyNew")) {
! $content .= $story->newStory($HTTP_POST_VARS, "array");
! }
break;
default:
! if ($perm->have_perm("storyList")) {
! $content .= $story->listStory($ary,$next);
! }
}
} else {
! $content = getTitlebar("100%", "Error! Invalid Privileges");
! $content .= getError(pslgetText("Sorry. You do not have the necessary privilege to view this page."));
}
! $block = new Block_i;
! $ary['section'] = "Admin";
!
! $breadcrumb = breadcrumb($ary);
!
! $_PSL['metatags']['object'] = $xsiteobject;
!
! slashhead($pagetitle,$_PSL['metatags']);
+ $leftblocks = $block->getBlocks($ary, "left");
+ $centerblocks = $block->getBlocks($ary, "center");
+ $rightblocks = $block->getBlocks($ary, "right");
+
+ if (empty($leftblocks)) {
+ if (empty($rightblocks)) {
+ // $centerblocks = $block->getBlocks($ary);
+ $tplfile = "index1col.tpl";
+ } else {
+ $tplfile = 'index2colright.tpl';
+ }
+ } elseif (empty($rightblocks)) {
+ $tplfile = 'index2colleft.tpl';
+ } else {
+ $tplfile = 'index3col.tpl';
+ }
+
+ $template = new Template($_PSL['templatedir']);
+ $template->debug = 0;
+ $template->set_file(array(
+ 'index' => $tplfile //"index3col.tpl"
+ ));
+
+ if( !empty($GLOBALS['QUERY_STRING'])) {
+ $QUERY_STRING = '?'.$GLOBALS['QUERY_STRING'];
+ } else {
+ $QUERY_STRING = '';
+ }
+
+ $template->set_var(array(
+ 'QUERYSTRING' => $QUERY_STRING,
+ 'ROOTDIR' => $_PSL['rooturl'],
+ 'IMAGEDIR' => $_PSL['imageurl'],
+ 'BREADCRUMB' => $breadcrumb,
+ 'STORY_COLUMN' => $content,
+ 'LEFT_BLOCK_COLUMN' => $leftblocks,
+ 'CENTER_BLOCK_COLUMN' => $centerblocks,
+ 'RIGHT_BLOCK_COLUMN' => $rightblocks
+ ));
+
+ $template->parse('OUT','index');
+ $template->p('OUT');
+
+ slashfoot();
page_close();
|