/*************************************************************************** Jupiter Content System @ Jupiterportal.com Copyright (C) 2005 Cosmin Flavius (highstrike@gmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. More Info About The Licence At http://www.gnu.org/copyleft/gpl.html ****************************************************************************/ //----------------------------------------------------------------- // Filter Acces Rightes //----------------------------------------------------------------- if(!isset($is_webmaster)) { header("location: $PHP_SELF?i=2"); exit; } switch($a) { //----------------------------------------------------------------- // Add block to template //----------------------------------------------------------------- case 1: //----------------------------------------------------------------- // Add the block to list //----------------------------------------------------------------- if($template_mode == "2") { foreach($template_left_db as $idx=>$lefty) $last_left_block_order = $lefty['succession']; $left_block_order = $last_left_block_order + 1; foreach($template_right_db as $idx=>$righty) $last_right_block_order = $righty['succession']; $right_block_order = $last_right_block_order + 1; if($mode == "Left") $db->insertRow("template",array('mode' => 'left','name' => ''.$add_block.'','succession' => ''.$left_block_order.'')); if($mode == "Right") $db->insertRow("template",array('mode' => 'right','name' => ''.$add_block.'','succession' => ''.$right_block_order.'')); } else { foreach($template_left_db as $idx=>$lefty) $last_left_block_order = $lefty['succession']; $left_block_order = $last_left_block_order + 1; $db->insertRow("template",array('mode' => 'left','name' => ''.$add_block.'','succession' => ''.$left_block_order.'')); } //----------------------------------------------------------------- // Activate the block //----------------------------------------------------------------- $db->updateRow("blocks",array('used' => '1'),"name = '$add_block'"); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/layout&i=59"); break; //----------------------------------------------------------------- // Delete block from template //----------------------------------------------------------------- case 2: //----------------------------------------------------------------- // Deactivate the block //----------------------------------------------------------------- $checker = $db->getLine("SELECT * FROM template WHERE id = '$d'"); $db->updateRow("blocks",array('used' => '0'),"name = '{$checker['name']}'"); //----------------------------------------------------------------- // Delete the block //----------------------------------------------------------------- $db->deleteRow("template","id = '$d'"); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/layout&i=60"); break; //----------------------------------------------------------------- // Save block succession //----------------------------------------------------------------- case 3: //----------------------------------------------------------------- // Save the succession //----------------------------------------------------------------- foreach($succession as $idx=>$val) $db->query("Update `template` set `succession` = '$val' WHERE `id` = '$idx'"); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/layout&i=61"); break; //----------------------------------------------------------------- // Show list + form //----------------------------------------------------------------- default: //----------------------------------------------------------------- // Code for Left Block //----------------------------------------------------------------- if(!isset($leftblock)) $leftblock = NULL; if($template_left_db != FALSE) { foreach($template_left_db as $idx=>$lefty) { //----------------------------------------------------------------- // Make Layout //----------------------------------------------------------------- $leftblock .= "
{$language['Admin name']} | ||
» {$language['Admin back']} |