[Phpslash-commit] CVS: phpslash-ft/public_html/admin variableAdmin.php3,1.3,1.4
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-06-18 18:03:28
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv24663/phpslash-ft/public_html/admin Modified Files: variableAdmin.php3 Log Message: variable method returns Index: variableAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/variableAdmin.php3,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** variableAdmin.php3 1 Feb 2002 04:23:52 -0000 1.3 --- variableAdmin.php3 18 Jun 2002 18:03:25 -0000 1.4 *************** *** 14,24 **** *****************************/ ! slashhead($pagetitle,$xsiteobject); /* DEBUG */ ! debug( "HTTP_POST_VARS" , $HTTP_POST_VARS); ! debug( "HTTP_GET_VARS" , $HTTP_GET_VARS); ! debug( "variable_name", $variable_name ); /* DEBUG */ --- 14,24 ---- *****************************/ ! $auth->login_if(!$perm->have_perm('variableList')); /* DEBUG */ ! // debug( "HTTP_POST_VARS" , $HTTP_POST_VARS); ! // debug( "HTTP_GET_VARS" , $HTTP_GET_VARS); ! // debug( "variable_name", $variable_name ); /* DEBUG */ *************** *** 26,74 **** $variable = new Variable; ! if ($perm->have_perm("variable")) { switch ($submit) { case "delete": ! while ( list( $key, $val ) = each( $variable_ary ) ) { ! $variable->deleteVariable($variable_ary[$key]); ! }; ! $variable->newVariable(); ! $variable->listVariable(); break; case "new": ! $variable->saveVariable($HTTP_POST_VARS); ! $variable->newVariable(); ! $variable->listVariable(); ! break; case "update": ! reset ($variable_id); ! while ( list( $key, $val ) = each( $variable_id ) ) { ! $ary["variable_id"] = $variable_id[$key]; ! $ary["variable_name"] = $variable_name[$key]; ! $ary["description"] = $description[$key]; ! $ary["value"] = $variable_value[$key]; ! $ary["variable_group"] = $variable_group[$key]; ! if ($variable->saveVariable($ary)) { ! echo "<em>$variable_name[$key]</em> has been updated<BR>\n"; ! } else { ! echo "<em>$variable_name[$key]</em> has <strong>not</strong> been updated<BR>\n"; ! } } - $variable->newVariable(); - $variable->listVariable(); break; default: ! $variable->newVariable(); ! $variable->listVariable(); } } else { ! titlebar("100%","Error! Invalid Privileges"); ! echo "Sorry. You do not have the necessary privilege to view this page."; } ! slashfoot(); page_close(); ?> --- 26,135 ---- $variable = new Variable; ! $content .= ''; ! ! if ($perm->have_perm("variableList")) { switch ($submit) { case "delete": ! if($perm->have_perm("variableDelete")) { ! while ( list( $key, $val ) = each( $variable_ary ) ) { ! $success = $variable->deleteVariable($variable_ary[$key]); ! } ! } break; case "new": ! if($perm->have_perm("variableSave")) { ! $success = $variable->saveVariable($HTTP_POST_VARS); ! } ! break; case "update": ! if($perm->have_perm("variableEdit")) { ! reset ($variable_id); ! while ( list( $key, $val ) = each( $variable_id ) ) { ! $ary["variable_id"] = $variable_id[$key]; ! $ary["variable_name"] = $variable_name[$key]; ! $ary["description"] = $description[$key]; ! $ary["value"] = $variable_value[$key]; ! $ary["variable_group"] = $variable_group[$key]; ! if ($variable->saveVariable($ary)) { ! $content .= "<em>$variable_name[$key]</em> has been updated<BR>\n"; ! } else { ! $content .= "<em>$variable_name[$key]</em> has <strong>not</strong> been updated<BR>\n"; ! } + } } break; default: ! break; ! } ! if($perm->have_perm("variableNew")) { ! $content .= $variable->newVariable(); } + if($perm->have_perm("variableList")) { + $content .= $variable->listVariable(); + } + } else { ! ! $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(); + ?> |