[Phpslash-commit] CVS: phpslash-ft/public_html/admin pollAdmin.php3,1.8,1.9
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-06-18 16:39:55
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv18948/phpslash-ft/public_html/admin Modified Files: pollAdmin.php3 Log Message: left out of previous commit to polls Index: pollAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/pollAdmin.php3,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pollAdmin.php3 16 Apr 2002 15:16:27 -0000 1.8 --- pollAdmin.php3 18 Jun 2002 16:39:52 -0000 1.9 *************** *** 13,67 **** *****************************/ ! $auth->login_if(!$perm->have_perm('poll')); /* DEBUG STUFF */ ! debug("HTTP_POST_VARS" , $HTTP_POST_VARS); ! debug("HTTP_GET_VARS" , $HTTP_GET_VARS); /* END DEBUG STUFF */ $poll = new Poll; ! if ($perm->have_perm("poll")) { ! ! slashhead($pagetitle,$xsiteobject); ! switch ($submit) { case "edit": ! $poll->editPoll($question_id); break; case "new": ! $poll->newPoll(); break; case "save": ! if ($poll->savePoll($HTTP_POST_VARS)) { ! echo "<center>"; ! fancybox(210, $_PSL['site_name'] ."Poll", $poll->getPollBooth($HTTP_POST_VARS['question_id']), "r"); ! echo "</center>"; ! } else { ! error($poll->message); } break; case "delete": ! titlebar ("100%", "Deleting poll"); if($poll->deletePoll($question_id)) { ! message($poll->message); } else { ! error($poll->message); } case "makecurrent": if(!$poll->makeCurrent($question_id)) { ! error($poll->message); } default: ! $poll->listPolls($min); ! } ! } else { // no permissions! ! titlebar("100%","Error! Invalid Privileges"); ! echo "Sorry. You do not have the necessary privilege to view this page."; } ! slashfoot(); page_close(); ?> --- 13,125 ---- *****************************/ ! $auth->login_if(!$perm->have_perm('pollList')); /* DEBUG STUFF */ ! // debug("HTTP_POST_VARS" , $HTTP_POST_VARS); ! // debug("HTTP_GET_VARS" , $HTTP_GET_VARS); /* END DEBUG STUFF */ $poll = new Poll; ! $content = ''; ! switch ($submit) { case "edit": ! if ($perm->have_perm("pollEdit")) { ! $content .= $poll->editPoll($question_id); ! } break; case "new": ! if ($perm->have_perm("pollNew")) { ! $content .= $poll->newPoll(); ! } break; case "save": ! if ($perm->have_perm("pollPut")) { ! if ($poll->savePoll($HTTP_POST_VARS)) { ! $content .= "<center>"; ! $content .= getFancybox(210, $_PSL['site_name'] ."Poll", $poll->getPollBooth($HTTP_POST_VARS['question_id']), "r"); ! $content .= "</center>"; ! } else { ! $content .= getError($poll->message); ! } } break; case "delete": ! $content .= getTitlebar ("100%", "Deleting poll"); if($poll->deletePoll($question_id)) { ! $content .= getMessage($poll->message); } else { ! $content .= getError($poll->message); } case "makecurrent": if(!$poll->makeCurrent($question_id)) { ! $content .= getError($poll->message); } default: ! if ($perm->have_perm("pollList")) { ! $content .= $poll->listPolls($min); ! } ! } ! ! if($content == '') { ! $content = getTitlebar("100%","Error! Invalid Privileges"); ! $content .= "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(); + ?> |