insertRow("blocks",array('name' => ''.$add_block.'','used' => '0')); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/blocks&i=57"); break; //----------------------------------------------------------------- // Uninstall Blocks //----------------------------------------------------------------- case 2: //----------------------------------------------------------------- // Uninstall the block and remove from templates too //----------------------------------------------------------------- $checker = $db->getLine("SELECT * FROM blocks WHERE id = '$d'"); $db->deleteRow("blocks","id = '{$checker['id']}'"); $db->deleteRow("template","name = '{$checker['name']}'"); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/blocks&i=58"); break; //----------------------------------------------------------------- // Show list + form //----------------------------------------------------------------- default: //----------------------------------------------------------------- // Echo the back link //----------------------------------------------------------------- echo "
{$language['Admin name']}
» {$language['Admin back']}

"; //----------------------------------------------------------------- // Code for Installed Block //----------------------------------------------------------------- $blocks_db_blocks = $db->getTable("SELECT * FROM blocks"); if(!isset($blocks_installed)) $blocks_installed = NULL; if(!isset($exclude_installed_blocks)) $exclude_installed_blocks = NULL; if($blocks_db_blocks != FALSE) { foreach($blocks_db_blocks as $idx=>$blocks_id) { //----------------------------------------------------------------- // Make Layout //----------------------------------------------------------------- $blocks_installed .= " {$blocks_id['name']} {$language[ "; $exclude_installed_blocks .= "{$blocks_id['name']}$|"; } } else { //----------------------------------------------------------------- // Make Layout //----------------------------------------------------------------- $blocks_installed .= " {$language['Blocks view desc3']} \n"; } //----------------------------------------------------------------- // Load dropdown_form for templates directory //----------------------------------------------------------------- $array_blocks = array(); $dir_blocks = opendir( './blocks' ); while ($file_blocks = readdir($dir_blocks)) if(!preg_match( "/^..?$|^index|htm$|html$|$exclude_installed_blocks^\./i", $file_blocks)) $array_blocks[] = array($file_blocks, $file_blocks); closedir($dir_blocks); sort($array_blocks); reset($array_blocks) ?>