| 
      1
     | 
    
      <?php
 
     | 
  
  
    | 
      2
     | 
    
      /**
 
     | 
  
  
    | 
      3
     | 
    
       *
 
     | 
  
  
    | 
      4
     | 
    
       * @category        admin
 
     | 
  
  
    | 
      5
     | 
    
       * @package         pages
 
     | 
  
  
    | 
      6
     | 
    
       * @author          WebsiteBaker Project
 
     | 
  
  
    | 
      7
     | 
    
       * @copyright       2004-2009, Ryan Djurovich
 
     | 
  
  
    | 
      8
     | 
    
       * @copyright       2009-2011, Website Baker Org. e.V.
 
     | 
  
  
    | 
      9
     | 
    
       * @link			http://www.websitebaker2.org/
 
     | 
  
  
    | 
      10
     | 
    
       * @license         http://www.gnu.org/licenses/gpl.html
 
     | 
  
  
    | 
      11
     | 
    
       * @platform        WebsiteBaker 2.8.x
 
     | 
  
  
    | 
      12
     | 
    
       * @requirements    PHP 5.2.2 and higher
 
     | 
  
  
    | 
      13
     | 
    
       * @version         $Id: sections.php 1529 2011-11-25 05:03:32Z Luisehahne $
 
     | 
  
  
    | 
      14
     | 
    
       * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/pages/sections.php $
 
     | 
  
  
    | 
      15
     | 
    
       * @lastmodified    $Date: 2011-11-25 06:03:32 +0100 (Fri, 25 Nov 2011) $
 
     | 
  
  
    | 
      16
     | 
    
       *
 
     | 
  
  
    | 
      17
     | 
    
       */
 
     | 
  
  
    | 
      18
     | 
    
      
 
     | 
  
  
    | 
      19
     | 
    
      // Include config file
 
     | 
  
  
    | 
      20
     | 
    
      require('../../config.php');
     | 
  
  
    | 
      21
     | 
    
      
 
     | 
  
  
    | 
      22
     | 
    
      // Make sure people are allowed to access this page
 
     | 
  
  
    | 
      23
     | 
    
      if(MANAGE_SECTIONS != 'enabled')
 
     | 
  
  
    | 
      24
     | 
    
      {
     | 
  
  
    | 
      25
     | 
    
      	header('Location: '.ADMIN_URL.'/pages/index.php');
     | 
  
  
    | 
      26
     | 
    
      	exit(0);
 
     | 
  
  
    | 
      27
     | 
    
      }
 
     | 
  
  
    | 
      28
     | 
    
      /* */
 
     | 
  
  
    | 
      29
     | 
    
      $debug = false; // to show position and section_id
 
     | 
  
  
    | 
      30
     | 
    
      If(!defined('DEBUG')) { define('DEBUG',$debug);}
     | 
  
  
    | 
      31
     | 
    
      // Include the WB functions file
 
     | 
  
  
    | 
      32
     | 
    
      require_once(WB_PATH.'/framework/functions.php');
 
     | 
  
  
    | 
      33
     | 
    
      // Create new admin object
 
     | 
  
  
    | 
      34
     | 
    
      require_once(WB_PATH.'/framework/class.admin.php');
 
     | 
  
  
    | 
      35
     | 
    
      $admin = new admin('Pages', 'pages_modify', false);
     | 
  
  
    | 
      36
     | 
    
      
 
     | 
  
  
    | 
      37
     | 
    
      $action = 'show';
 
     | 
  
  
    | 
      38
     | 
    
      // Get page id
 
     | 
  
  
    | 
      39
     | 
    
      $requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
 
     | 
  
  
    | 
      40
     | 
    
      $page_id = intval((isset(${$requestMethod}['page_id'])) ? ${$requestMethod}['page_id'] : 0);
     | 
  
  
    | 
      41
     | 
    
      $action = ($page_id ? 'show' : $action);
 
     | 
  
  
    | 
      42
     | 
    
      // Get section id if there is one
 
     | 
  
  
    | 
      43
     | 
    
      $requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
 
     | 
  
  
    | 
      44
     | 
    
      $section_id = ((isset(${$requestMethod}['section_id'])) ? ${$requestMethod}['section_id']  : 0);
     | 
  
  
    | 
      45
     | 
    
      $action = ($section_id ? 'delete' : $action);
 
     | 
  
  
    | 
      46
     | 
    
      // Get module if there is one
 
     | 
  
  
    | 
      47
     | 
    
      $requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
 
     | 
  
  
    | 
      48
     | 
    
      $module = ((isset(${$requestMethod}['module'])) ? ${$requestMethod}['module']  : 0);
     | 
  
  
    | 
      49
     | 
    
      $action = ($module != '' ? 'add' : $action);
 
     | 
  
  
    | 
      50
     | 
    
      $admin_header = true;
 
     | 
  
  
    | 
      51
     | 
    
      $backlink = ADMIN_URL.'/pages/sections.php?page_id='.(int)$page_id;
 
     | 
  
  
    | 
      52
     | 
    
      
 
     | 
  
  
    | 
      53
     | 
    
      switch ($action):
 
     | 
  
  
    | 
      54
     | 
    
      	case 'delete' :
 
     | 
  
  
    | 
      55
     | 
    
      
 
     | 
  
  
    | 
      56
     | 
    
      		if( ( !($section_id = intval($admin->checkIDKEY('section_id', 0, $_SERVER['REQUEST_METHOD'])) )) )
     | 
  
  
    | 
      57
     | 
    
      		{
     | 
  
  
    | 
      58
     | 
    
      			if($admin_header) { $admin->print_header(); }
     | 
  
  
    | 
      59
     | 
    
      			$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$backlink);
 
     | 
  
  
    | 
      60
     | 
    
      		}
 
     | 
  
  
    | 
      61
     | 
    
      
 
     | 
  
  
    | 
      62
     | 
    
      		$action = 'show';
 
     | 
  
  
    | 
      63
     | 
    
      	    $sql  = 'SELECT `module` FROM `'.TABLE_PREFIX.'sections` ';
 
     | 
  
  
    | 
      64
     | 
    
      	    $sql .= 'WHERE `section_id` ='.$section_id;
 
     | 
  
  
    | 
      65
     | 
    
              if( ( ($modulname = $database->get_one($sql)) == $module) && ($section_id > 0 ) ) {
     | 
  
  
    | 
      66
     | 
    
      			// Include the modules delete file if it exists
 
     | 
  
  
    | 
      67
     | 
    
      			if(file_exists(WB_PATH.'/modules/'.$modulname.'/delete.php'))
 
     | 
  
  
    | 
      68
     | 
    
      		    {
     | 
  
  
    | 
      69
     | 
    
      				require(WB_PATH.'/modules/'.$modulname.'/delete.php');
 
     | 
  
  
    | 
      70
     | 
    
      			}
 
     | 
  
  
    | 
      71
     | 
    
      		    $sql  = 'DELETE FROM `'.TABLE_PREFIX.'sections` ';
 
     | 
  
  
    | 
      72
     | 
    
      		    $sql .= 'WHERE `section_id` ='.(int)$section_id.' LIMIT 1';
 
     | 
  
  
    | 
      73
     | 
    
      			if( !$database->query($sql) ) {
     | 
  
  
    | 
      74
     | 
    
      				if($admin_header) { $admin->print_header(); }
     | 
  
  
    | 
      75
     | 
    
      				$admin->print_error($database->get_error(),$backlink);
 
     | 
  
  
    | 
      76
     | 
    
      			}  else {
     | 
  
  
    | 
      77
     | 
    
      				require_once(WB_PATH.'/framework/class.order.php');
 
     | 
  
  
    | 
      78
     | 
    
      				$order = new order(TABLE_PREFIX.'sections', 'position', 'section_id', 'page_id');
 
     | 
  
  
    | 
      79
     | 
    
      				$order->clean($page_id);
 
     | 
  
  
    | 
      80
     | 
    
      				$format = $TEXT['SECTION'].' %d  %s %s '.strtolower( $TEXT['DELETED']);
 
     | 
  
  
    | 
      81
     | 
    
      				$message = sprintf ($format,$section_id,strtoupper($modulname),strtolower($TEXT['SUCCESS']));
 
     | 
  
  
    | 
      82
     | 
    
      				if($admin_header) { $admin->print_header(); }
     | 
  
  
    | 
      83
     | 
    
      				$admin_header = false;
 
     | 
  
  
    | 
      84
     | 
    
      				unset($_POST);
 
     | 
  
  
    | 
      85
     | 
    
      				$admin->print_success($message, $backlink );
 
     | 
  
  
    | 
      86
     | 
    
      			}
 
     | 
  
  
    | 
      87
     | 
    
              } else {
     | 
  
  
    | 
      88
     | 
    
      			if($admin_header) { $admin->print_header(); }
     | 
  
  
    | 
      89
     | 
    
      			$admin->print_error($module.' '.strtolower($TEXT['NOT_FOUND']),$backlink);
 
     | 
  
  
    | 
      90
     | 
    
              }
 
     | 
  
  
    | 
      91
     | 
    
      
 
     | 
  
  
    | 
      92
     | 
    
      		break;
 
     | 
  
  
    | 
      93
     | 
    
      	case 'add' :
 
     | 
  
  
    | 
      94
     | 
    
      
 
     | 
  
  
    | 
      95
     | 
    
      		if (!$admin->checkFTAN())
 
     | 
  
  
    | 
      96
     | 
    
      		{
     | 
  
  
    | 
      97
     | 
    
      			$admin->print_header();
 
     | 
  
  
    | 
      98
     | 
    
      			$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$backlink);
 
     | 
  
  
    | 
      99
     | 
    
      		}
 
     | 
  
  
    | 
      100
     | 
    
      		$action = 'show';
 
     | 
  
  
    | 
      101
     | 
    
      		$module = preg_replace('/\W/', '', $module );  // fix secunia 2010-91-4
     | 
  
  
    | 
      102
     | 
    
      		require_once(WB_PATH.'/framework/class.order.php');
 
     | 
  
  
    | 
      103
     | 
    
      		// Get new order
 
     | 
  
  
    | 
      104
     | 
    
      		$order = new order(TABLE_PREFIX.'sections', 'position', 'section_id', 'page_id');
 
     | 
  
  
    | 
      105
     | 
    
      		$position = $order->get_new($page_id);
 
     | 
  
  
    | 
      106
     | 
    
      		// Insert module into DB
 
     | 
  
  
    | 
      107
     | 
    
      	    $sql  = 'INSERT INTO `'.TABLE_PREFIX.'sections` SET ';
 
     | 
  
  
    | 
      108
     | 
    
      	    $sql .= '`page_id` = '.(int)$page_id.', ';
 
     | 
  
  
    | 
      109
     | 
    
      	    $sql .= '`module` = \''.$module.'\', ';
 
     | 
  
  
    | 
      110
     | 
    
      	    $sql .= '`position` = '.(int)$position.', ';
 
     | 
  
  
    | 
      111
     | 
    
      	    $sql .= '`block` = 1';
 
     | 
  
  
    | 
      112
     | 
    
              if($database->query($sql)) {
     | 
  
  
    | 
      113
     | 
    
      			// Get the section id
 
     | 
  
  
    | 
      114
     | 
    
      			$section_id = $database->get_one("SELECT LAST_INSERT_ID()");
     | 
  
  
    | 
      115
     | 
    
      			// Include the selected modules add file if it exists
 
     | 
  
  
    | 
      116
     | 
    
      			if(file_exists(WB_PATH.'/modules/'.$module.'/add.php'))
 
     | 
  
  
    | 
      117
     | 
    
      		    {
     | 
  
  
    | 
      118
     | 
    
      				require(WB_PATH.'/modules/'.$module.'/add.php');
 
     | 
  
  
    | 
      119
     | 
    
      			}
 
     | 
  
  
    | 
      120
     | 
    
              } elseif ($database->is_error())  {
     | 
  
  
    | 
      121
     | 
    
      			if($admin_header) { $admin->print_header(); }
     | 
  
  
    | 
      122
     | 
    
      			$admin->print_error($database->get_error());
 
     | 
  
  
    | 
      123
     | 
    
      		}
 
     | 
  
  
    | 
      124
     | 
    
      		break;
 
     | 
  
  
    | 
      125
     | 
    
      	default:
 
     | 
  
  
    | 
      126
     | 
    
      		break;
 
     | 
  
  
    | 
      127
     | 
    
      endswitch;
 
     | 
  
  
    | 
      128
     | 
    
      
 
     | 
  
  
    | 
      129
     | 
    
      switch ($action):
 
     | 
  
  
    | 
      130
     | 
    
      	default:
 
     | 
  
  
    | 
      131
     | 
    
      
 
     | 
  
  
    | 
      132
     | 
    
      		if($admin_header) { $admin->print_header(); }
     | 
  
  
    | 
      133
     | 
    
      		// Get perms
 
     | 
  
  
    | 
      134
     | 
    
      		$sql  = 'SELECT `admin_groups`,`admin_users` FROM `'.TABLE_PREFIX.'pages` ';
 
     | 
  
  
    | 
      135
     | 
    
      		$sql .= 'WHERE `page_id` = '.$page_id;
 
     | 
  
  
    | 
      136
     | 
    
      		$results = $database->query($sql);
 
     | 
  
  
    | 
      137
     | 
    
      
 
     | 
  
  
    | 
      138
     | 
    
      		$results_array = $results->fetchRow();
 
     | 
  
  
    | 
      139
     | 
    
      		$old_admin_groups = explode(',', $results_array['admin_groups']);
     | 
  
  
    | 
      140
     | 
    
      		$old_admin_users = explode(',', $results_array['admin_users']);
     | 
  
  
    | 
      141
     | 
    
      		$in_old_group = FALSE;
 
     | 
  
  
    | 
      142
     | 
    
      		foreach($admin->get_groups_id() as $cur_gid)
 
     | 
  
  
    | 
      143
     | 
    
      		{
     | 
  
  
    | 
      144
     | 
    
      			if (in_array($cur_gid, $old_admin_groups))
 
     | 
  
  
    | 
      145
     | 
    
      		    {
     | 
  
  
    | 
      146
     | 
    
      				$in_old_group = TRUE;
 
     | 
  
  
    | 
      147
     | 
    
      			}
 
     | 
  
  
    | 
      148
     | 
    
      		}
 
     | 
  
  
    | 
      149
     | 
    
      		if((!$in_old_group) && !is_numeric(array_search($admin->get_user_id(), $old_admin_users)))
 
     | 
  
  
    | 
      150
     | 
    
      		{
     | 
  
  
    | 
      151
     | 
    
      			$admin->print_header();
 
     | 
  
  
    | 
      152
     | 
    
      			$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
 
     | 
  
  
    | 
      153
     | 
    
      		}
 
     | 
  
  
    | 
      154
     | 
    
      
 
     | 
  
  
    | 
      155
     | 
    
      		// Get page details
 
     | 
  
  
    | 
      156
     | 
    
      		$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'pages` ';
 
     | 
  
  
    | 
      157
     | 
    
      		$sql .= 'WHERE `page_id` = '.$page_id;
 
     | 
  
  
    | 
      158
     | 
    
      		$results = $database->query($sql);
 
     | 
  
  
    | 
      159
     | 
    
      
 
     | 
  
  
    | 
      160
     | 
    
      		if($database->is_error())
 
     | 
  
  
    | 
      161
     | 
    
      		{
     | 
  
  
    | 
      162
     | 
    
      			// $admin->print_header();
 
     | 
  
  
    | 
      163
     | 
    
      			$admin->print_error($database->get_error());
 
     | 
  
  
    | 
      164
     | 
    
      		}
 
     | 
  
  
    | 
      165
     | 
    
      		if($results->numRows() == 0)
 
     | 
  
  
    | 
      166
     | 
    
      		{
     | 
  
  
    | 
      167
     | 
    
      			// $admin->print_header();
 
     | 
  
  
    | 
      168
     | 
    
      			$admin->print_error($MESSAGE['PAGES']['NOT_FOUND']);
 
     | 
  
  
    | 
      169
     | 
    
      		}
 
     | 
  
  
    | 
      170
     | 
    
      		$results_array = $results->fetchRow();
 
     | 
  
  
    | 
      171
     | 
    
      
 
     | 
  
  
    | 
      172
     | 
    
      		// Set module permissions
 
     | 
  
  
    | 
      173
     | 
    
      		$module_permissions = $_SESSION['MODULE_PERMISSIONS'];
 
     | 
  
  
    | 
      174
     | 
    
      
 
     | 
  
  
    | 
      175
     | 
    
      		// Unset block var
 
     | 
  
  
    | 
      176
     | 
    
      		unset($block);
 
     | 
  
  
    | 
      177
     | 
    
      		// Include template info file (if it exists)
 
     | 
  
  
    | 
      178
     | 
    
      		if($results_array['template'] != '')
 
     | 
  
  
    | 
      179
     | 
    
      		{
     | 
  
  
    | 
      180
     | 
    
      			$template_location = WB_PATH.'/templates/'.$results_array['template'].'/info.php';
 
     | 
  
  
    | 
      181
     | 
    
      		} else {
     | 
  
  
    | 
      182
     | 
    
      			$template_location = WB_PATH.'/templates/'.DEFAULT_TEMPLATE.'/info.php';
 
     | 
  
  
    | 
      183
     | 
    
      		}
 
     | 
  
  
    | 
      184
     | 
    
      		if(file_exists($template_location))
 
     | 
  
  
    | 
      185
     | 
    
      		{
     | 
  
  
    | 
      186
     | 
    
      			require($template_location);
 
     | 
  
  
    | 
      187
     | 
    
      		}
 
     | 
  
  
    | 
      188
     | 
    
      		// Check if $menu is set
 
     | 
  
  
    | 
      189
     | 
    
      		if(!isset($block[1]) || $block[1] == '')
 
     | 
  
  
    | 
      190
     | 
    
      		{
     | 
  
  
    | 
      191
     | 
    
      			// Make our own menu list
 
     | 
  
  
    | 
      192
     | 
    
      			$block[1] = $TEXT['MAIN'];
 
     | 
  
  
    | 
      193
     | 
    
      		}
 
     | 
  
  
    | 
      194
     | 
    
      
 
     | 
  
  
    | 
      195
     | 
    
      		/*-- load css files with jquery --*/
 
     | 
  
  
    | 
      196
     | 
    
      		// include jscalendar-setup
 
     | 
  
  
    | 
      197
     | 
    
      		$jscal_use_time = true; // whether to use a clock, too
 
     | 
  
  
    | 
      198
     | 
    
      		require_once(WB_PATH."/include/jscalendar/wb-setup.php");
 
     | 
  
  
    | 
      199
     | 
    
      
 
     | 
  
  
    | 
      200
     | 
    
      		// Setup template object, parse vars to it, then parse it
 
     | 
  
  
    | 
      201
     | 
    
      		$ThemePath = realpath(WB_PATH.$admin->correct_theme_source('pages_sections.htt'));
     | 
  
  
    | 
      202
     | 
    
      		// Create new template object
 
     | 
  
  
    | 
      203
     | 
    
      		$tpl = new Template($ThemePath);
 
     | 
  
  
    | 
      204
     | 
    
      		// $template->debug = true;
 
     | 
  
  
    | 
      205
     | 
    
      		$tpl->set_file('page', 'pages_sections.htt');
     | 
  
  
    | 
      206
     | 
    
      		$tpl->set_block('page', 'main_block', 'main');
     | 
  
  
    | 
      207
     | 
    
      		$tpl->set_block('main_block', 'module_block', 'module_list');
     | 
  
  
    | 
      208
     | 
    
      		$tpl->set_block('main_block', 'section_block', 'section_list');
     | 
  
  
    | 
      209
     | 
    
      		$tpl->set_block('section_block', 'block_block', 'block_list');
     | 
  
  
    | 
      210
     | 
    
      		$tpl->set_block('main_block', 'calendar_block', 'calendar_list');
     | 
  
  
    | 
      211
     | 
    
      		$tpl->set_var('FTAN', $admin->getFTAN());
     | 
  
  
    | 
      212
     | 
    
      
 
     | 
  
  
    | 
      213
     | 
    
      		// set first defaults and messages
 
     | 
  
  
    | 
      214
     | 
    
      		$tpl->set_var(array(
 
     | 
  
  
    | 
      215
     | 
    
      						'PAGE_ID' => $results_array['page_id'],
 
     | 
  
  
    | 
      216
     | 
    
      						// 'PAGE_IDKEY' => $admin->getIDKEY($results_array['page_id']),
 
     | 
  
  
    | 
      217
     | 
    
      						'PAGE_IDKEY' => $results_array['page_id'],
 
     | 
  
  
    | 
      218
     | 
    
      						'TEXT_PAGE' => $TEXT['PAGE'],
 
     | 
  
  
    | 
      219
     | 
    
      						'PAGE_TITLE' => ($results_array['page_title']),
 
     | 
  
  
    | 
      220
     | 
    
      						'MENU_TITLE' => ($results_array['menu_title']),
 
     | 
  
  
    | 
      221
     | 
    
      						'TEXT_CURRENT_PAGE' => $TEXT['CURRENT_PAGE'],
 
     | 
  
  
    | 
      222
     | 
    
      						'HEADING_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
 
     | 
  
  
    | 
      223
     | 
    
      						'HEADING_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
 
     | 
  
  
    | 
      224
     | 
    
      						'TEXT_CHANGE_SETTINGS' => $TEXT['CHANGE_SETTINGS'],
 
     | 
  
  
    | 
      225
     | 
    
      						'TEXT_ADD_SECTION' => $TEXT['ADD_SECTION'],
 
     | 
  
  
    | 
      226
     | 
    
      						'TEXT_ID' => 'ID',
 
     | 
  
  
    | 
      227
     | 
    
      						'TEXT_TYPE' => $TEXT['TYPE'],
 
     | 
  
  
    | 
      228
     | 
    
      						'TEXT_BLOCK' => $TEXT['BLOCK'],
 
     | 
  
  
    | 
      229
     | 
    
      						'TEXT_PUBL_START_DATE' => $TEXT{'PUBL_START_DATE'},
     | 
  
  
    | 
      230
     | 
    
      						'TEXT_PUBL_END_DATE' => $TEXT['PUBL_END_DATE'],
 
     | 
  
  
    | 
      231
     | 
    
      						'TEXT_ACTIONS' => $TEXT['ACTIONS'],
 
     | 
  
  
    | 
      232
     | 
    
      						'ADMIN_URL' => ADMIN_URL,
 
     | 
  
  
    | 
      233
     | 
    
      						'WB_URL' => WB_URL,
 
     | 
  
  
    | 
      234
     | 
    
      						'THEME_URL' => THEME_URL
 
     | 
  
  
    | 
      235
     | 
    
      						)
 
     | 
  
  
    | 
      236
     | 
    
      					);
 
     | 
  
  
    | 
      237
     | 
    
      
 
     | 
  
  
    | 
      238
     | 
    
      		// Insert variables
 
     | 
  
  
    | 
      239
     | 
    
      		$tpl->set_var(array(
 
     | 
  
  
    | 
      240
     | 
    
      						'PAGE_ID' => $results_array['page_id'],
 
     | 
  
  
    | 
      241
     | 
    
      						// 'PAGE_IDKEY' => $admin->getIDKEY($results_array['page_id']),
 
     | 
  
  
    | 
      242
     | 
    
      						'PAGE_IDKEY' => $results_array['page_id'],
 
     | 
  
  
    | 
      243
     | 
    
      						'VAR_PAGE_TITLE' => $results_array['page_title'],
 
     | 
  
  
    | 
      244
     | 
    
      						'SETTINGS_LINK' => ADMIN_URL.'/pages/settings.php?page_id='.$results_array['page_id'],
 
     | 
  
  
    | 
      245
     | 
    
      						'MODIFY_LINK' => ADMIN_URL.'/pages/modify.php?page_id='.$results_array['page_id']
 
     | 
  
  
    | 
      246
     | 
    
      						)
 
     | 
  
  
    | 
      247
     | 
    
      					);
 
     | 
  
  
    | 
      248
     | 
    
      
 
     | 
  
  
    | 
      249
     | 
    
      		$sql  = 'SELECT `section_id`,`module`,`position`,`block`,`publ_start`,`publ_end` ';
 
     | 
  
  
    | 
      250
     | 
    
      		$sql .= 'FROM `'.TABLE_PREFIX.'sections` ';
 
     | 
  
  
    | 
      251
     | 
    
      		$sql .= 'WHERE `page_id` = '.$page_id.' ';
 
     | 
  
  
    | 
      252
     | 
    
      		$sql .= 'ORDER BY `position` ASC';
 
     | 
  
  
    | 
      253
     | 
    
      		$query_sections = $database->query($sql);
 
     | 
  
  
    | 
      254
     | 
    
      
 
     | 
  
  
    | 
      255
     | 
    
      		if($query_sections->numRows() > 0)
 
     | 
  
  
    | 
      256
     | 
    
      		{
     | 
  
  
    | 
      257
     | 
    
      			$num_sections = $query_sections->numRows();
 
     | 
  
  
    | 
      258
     | 
    
      			while($section = $query_sections->fetchRow())
 
     | 
  
  
    | 
      259
     | 
    
      		    {
     | 
  
  
    | 
      260
     | 
    
      				if(!is_numeric(array_search($section['module'], $module_permissions)))
 
     | 
  
  
    | 
      261
     | 
    
      		        {
     | 
  
  
    | 
      262
     | 
    
      					// Get the modules real name
 
     | 
  
  
    | 
      263
     | 
    
      		            $sql = 'SELECT `name` FROM `'.TABLE_PREFIX.'addons` ';
 
     | 
  
  
    | 
      264
     | 
    
      		            $sql .= 'WHERE `directory` = "'.$section['module'].'"';
 
     | 
  
  
    | 
      265
     | 
    
      		            if(!$database->get_one($sql) || !file_exists(WB_PATH.'/modules/'.$section['module']))
 
     | 
  
  
    | 
      266
     | 
    
      					{
     | 
  
  
    | 
      267
     | 
    
      						$edit_page = '<span class="module_disabled">'.$section['module'].'</span>';
 
     | 
  
  
    | 
      268
     | 
    
      					}else
 
     | 
  
  
    | 
      269
     | 
    
      					{
     | 
  
  
    | 
      270
     | 
    
      						$edit_page = '';
 
     | 
  
  
    | 
      271
     | 
    
      					}
 
     | 
  
  
    | 
      272
     | 
    
      					$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR : '');
 
     | 
  
  
    | 
      273
     | 
    
      					$edit_page_0 = '<a id="sid'.$section['section_id'].'" href="'.ADMIN_URL.'/pages/modify.php?page_id='.$results_array['page_id'];
 
     | 
  
  
    | 
      274
     | 
    
      					$edit_page_1  = ($sec_anchor!='') ? '#'.$sec_anchor.$section['section_id'].'">' : '">';
 
     | 
  
  
    | 
      275
     | 
    
      					$edit_page_1 .= $section['module'].'</a>';
 
     | 
  
  
    | 
      276
     | 
    
      					if(SECTION_BLOCKS)
 
     | 
  
  
    | 
      277
     | 
    
      		            {
     | 
  
  
    | 
      278
     | 
    
      						if($edit_page == '')
 
     | 
  
  
    | 
      279
     | 
    
      						{
     | 
  
  
    | 
      280
     | 
    
      							if(defined('EDIT_ONE_SECTION') && EDIT_ONE_SECTION)
     | 
  
  
    | 
      281
     | 
    
      							{
     | 
  
  
    | 
      282
     | 
    
      								$edit_page = $edit_page_0.'&wysiwyg='.$section['section_id'].$edit_page_1;
 
     | 
  
  
    | 
      283
     | 
    
      							} else {
     | 
  
  
    | 
      284
     | 
    
      								$edit_page = $edit_page_0.$edit_page_1;
 
     | 
  
  
    | 
      285
     | 
    
      							}
 
     | 
  
  
    | 
      286
     | 
    
      						}
 
     | 
  
  
    | 
      287
     | 
    
      						$input_attribute = 'input_normal';
 
     | 
  
  
    | 
      288
     | 
    
      						$tpl->set_var(array(
 
     | 
  
  
    | 
      289
     | 
    
      								'STYLE_DISPLAY_SECTION_BLOCK' => ' style="visibility:visible;"',
 
     | 
  
  
    | 
      290
     | 
    
      								'NAME_SIZE' => 300,
 
     | 
  
  
    | 
      291
     | 
    
      								'INPUT_ATTRIBUTE' => $input_attribute,
 
     | 
  
  
    | 
      292
     | 
    
      								'VAR_SECTION_ID' => $section['section_id'],
 
     | 
  
  
    | 
      293
     | 
    
      								'VAR_SECTION_IDKEY' => $admin->getIDKEY($section['section_id']),
 
     | 
  
  
    | 
      294
     | 
    
      								// 'VAR_SECTION_IDKEY' => $section['section_id'],
 
     | 
  
  
    | 
      295
     | 
    
      								'VAR_POSITION' => $section['position'],
 
     | 
  
  
    | 
      296
     | 
    
      								'LINK_MODIFY_URL_VAR_MODUL_NAME' => $edit_page,
 
     | 
  
  
    | 
      297
     | 
    
      								'SELECT' => '',
 
     | 
  
  
    | 
      298
     | 
    
      								'SET_NONE_DISPLAY_OPTION' => ''
 
     | 
  
  
    | 
      299
     | 
    
      								)
 
     | 
  
  
    | 
      300
     | 
    
      							);
 
     | 
  
  
    | 
      301
     | 
    
      						// Add block options to the section_list
 
     | 
  
  
    | 
      302
     | 
    
      						$tpl->clear_var('block_list');
     | 
  
  
    | 
      303
     | 
    
      						foreach($block AS $number => $name)
 
     | 
  
  
    | 
      304
     | 
    
      		                {
     | 
  
  
    | 
      305
     | 
    
      							$tpl->set_var('NAME', htmlentities(strip_tags($name)));
     | 
  
  
    | 
      306
     | 
    
      							$tpl->set_var('VALUE', $number);
     | 
  
  
    | 
      307
     | 
    
      							$tpl->set_var('SIZE', 1);
     | 
  
  
    | 
      308
     | 
    
      							if($section['block'] == $number)
 
     | 
  
  
    | 
      309
     | 
    
      		                    {
     | 
  
  
    | 
      310
     | 
    
      								$tpl->set_var('SELECTED', ' selected="selected"');
     | 
  
  
    | 
      311
     | 
    
      							} else {
     | 
  
  
    | 
      312
     | 
    
      								$tpl->set_var('SELECTED', '');
     | 
  
  
    | 
      313
     | 
    
      							}
 
     | 
  
  
    | 
      314
     | 
    
      							$tpl->parse('block_list', 'block_block', true);
     | 
  
  
    | 
      315
     | 
    
      						}
 
     | 
  
  
    | 
      316
     | 
    
      					} else {
     | 
  
  
    | 
      317
     | 
    
      						if($edit_page == '')
 
     | 
  
  
    | 
      318
     | 
    
      						{
     | 
  
  
    | 
      319
     | 
    
      							$edit_page = $edit_page_0.'#wb_'.$edit_page_1;
 
     | 
  
  
    | 
      320
     | 
    
      						}
 
     | 
  
  
    | 
      321
     | 
    
      						$input_attribute = 'input_normal';
 
     | 
  
  
    | 
      322
     | 
    
      						$tpl->set_var(array(
 
     | 
  
  
    | 
      323
     | 
    
      								'STYLE_DISPLAY_SECTION_BLOCK' => ' style="visibility:hidden;"',
 
     | 
  
  
    | 
      324
     | 
    
      								'NAME_SIZE' => 300,
 
     | 
  
  
    | 
      325
     | 
    
      								'INPUT_ATTRIBUTE' => $input_attribute,
 
     | 
  
  
    | 
      326
     | 
    
      								'VAR_SECTION_ID' => $section['section_id'],
 
     | 
  
  
    | 
      327
     | 
    
      								'VAR_SECTION_IDKEY' => $admin->getIDKEY($section['section_id']),
 
     | 
  
  
    | 
      328
     | 
    
      								// 'VAR_SECTION_IDKEY' => $section['section_id'],
 
     | 
  
  
    | 
      329
     | 
    
      								'VAR_POSITION' => $section['position'],
 
     | 
  
  
    | 
      330
     | 
    
      								'LINK_MODIFY_URL_VAR_MODUL_NAME' => $edit_page,
 
     | 
  
  
    | 
      331
     | 
    
      								'NAME' => htmlentities(strip_tags($block[1])),
 
     | 
  
  
    | 
      332
     | 
    
      								'VALUE' => 1,
 
     | 
  
  
    | 
      333
     | 
    
      								'SET_NONE_DISPLAY_OPTION' => ''
 
     | 
  
  
    | 
      334
     | 
    
      								)
 
     | 
  
  
    | 
      335
     | 
    
      							);
 
     | 
  
  
    | 
      336
     | 
    
      					}
 
     | 
  
  
    | 
      337
     | 
    
      					// Insert icon and images
 
     | 
  
  
    | 
      338
     | 
    
      					$tpl->set_var(array(
 
     | 
  
  
    | 
      339
     | 
    
      								'CLOCK_16_PNG' => 'clock_16.png',
 
     | 
  
  
    | 
      340
     | 
    
      								'CLOCK_DEL_16_PNG' => 'clock_del_16.png',
 
     | 
  
  
    | 
      341
     | 
    
      								'DELETE_16_PNG' => 'delete_16.png'
 
     | 
  
  
    | 
      342
     | 
    
      								)
 
     | 
  
  
    | 
      343
     | 
    
      							);
 
     | 
  
  
    | 
      344
     | 
    
      					// set calendar start values
 
     | 
  
  
    | 
      345
     | 
    
      					if($section['publ_start']==0)
 
     | 
  
  
    | 
      346
     | 
    
      		            {
     | 
  
  
    | 
      347
     | 
    
      						$tpl->set_var('VALUE_PUBL_START', '');
     | 
  
  
    | 
      348
     | 
    
      					} else {
     | 
  
  
    | 
      349
     | 
    
      						$tpl->set_var('VALUE_PUBL_START', date($jscal_format, $section['publ_start']));
     | 
  
  
    | 
      350
     | 
    
      					}
 
     | 
  
  
    | 
      351
     | 
    
      					// set calendar start values
 
     | 
  
  
    | 
      352
     | 
    
      					if($section['publ_end']==0)
 
     | 
  
  
    | 
      353
     | 
    
      		            {
     | 
  
  
    | 
      354
     | 
    
      						$tpl->set_var('VALUE_PUBL_END', '');
     | 
  
  
    | 
      355
     | 
    
      					} else {
     | 
  
  
    | 
      356
     | 
    
      						$tpl->set_var('VALUE_PUBL_END', date($jscal_format, $section['publ_end']));
     | 
  
  
    | 
      357
     | 
    
      					}
 
     | 
  
  
    | 
      358
     | 
    
      					// Insert icons up and down
 
     | 
  
  
    | 
      359
     | 
    
      					if($section['position'] != 1 )
 
     | 
  
  
    | 
      360
     | 
    
      		            {
     | 
  
  
    | 
      361
     | 
    
      						$tpl->set_var(
 
     | 
  
  
    | 
      362
     | 
    
      									'VAR_MOVE_UP_URL',
 
     | 
  
  
    | 
      363
     | 
    
      									'<a href="'.ADMIN_URL.'/pages/move_up.php?page_id='.$page_id.'&section_id='.$section['section_id'].'">
 
     | 
  
  
    | 
      364
     | 
    
      									<img src="'.THEME_URL.'/images/up_16.png" alt="{TEXT_MOVE_UP}" />
     | 
  
  
    | 
      365
     | 
    
      									</a>' );
 
     | 
  
  
    | 
      366
     | 
    
      					} else {
     | 
  
  
    | 
      367
     | 
    
      						$tpl->set_var(array(
 
     | 
  
  
    | 
      368
     | 
    
      									'VAR_MOVE_UP_URL' => ''
 
     | 
  
  
    | 
      369
     | 
    
      									)
 
     | 
  
  
    | 
      370
     | 
    
      								);
 
     | 
  
  
    | 
      371
     | 
    
      					}
 
     | 
  
  
    | 
      372
     | 
    
      					if($section['position'] != $num_sections ) {
     | 
  
  
    | 
      373
     | 
    
      						$tpl->set_var(
 
     | 
  
  
    | 
      374
     | 
    
      									'VAR_MOVE_DOWN_URL',
 
     | 
  
  
    | 
      375
     | 
    
      									'<a href="'.ADMIN_URL.'/pages/move_down.php?page_id='.$page_id.'&section_id='.$section['section_id'].'">
 
     | 
  
  
    | 
      376
     | 
    
      									<img src="'.THEME_URL.'/images/down_16.png" alt="{TEXT_MOVE_DOWN}" />
     | 
  
  
    | 
      377
     | 
    
      									</a>' );
 
     | 
  
  
    | 
      378
     | 
    
      					} else {
     | 
  
  
    | 
      379
     | 
    
      						$tpl->set_var(array(
 
     | 
  
  
    | 
      380
     | 
    
      									'VAR_MOVE_DOWN_URL' => ''
 
     | 
  
  
    | 
      381
     | 
    
      									)
 
     | 
  
  
    | 
      382
     | 
    
      								);
 
     | 
  
  
    | 
      383
     | 
    
      					}
 
     | 
  
  
    | 
      384
     | 
    
      				} else {
     | 
  
  
    | 
      385
     | 
    
      				  continue;
 
     | 
  
  
    | 
      386
     | 
    
      				}
 
     | 
  
  
    | 
      387
     | 
    
      
 
     | 
  
  
    | 
      388
     | 
    
      					$tpl->set_var(array(
 
     | 
  
  
    | 
      389
     | 
    
      									'DISPLAY_DEBUG' => ' style="visibility="visible;"',
 
     | 
  
  
    | 
      390
     | 
    
      									'TEXT_SID' => 'SID',
 
     | 
  
  
    | 
      391
     | 
    
      									'DEBUG_COLSPAN_SIZE' => 9
 
     | 
  
  
    | 
      392
     | 
    
      									)
 
     | 
  
  
    | 
      393
     | 
    
      								);
 
     | 
  
  
    | 
      394
     | 
    
      				if($debug)
 
     | 
  
  
    | 
      395
     | 
    
      		        {
     | 
  
  
    | 
      396
     | 
    
      					$tpl->set_var(array(
 
     | 
  
  
    | 
      397
     | 
    
      									'DISPLAY_DEBUG' => ' style="visibility="visible;"',
 
     | 
  
  
    | 
      398
     | 
    
      									'TEXT_PID' => 'PID',
 
     | 
  
  
    | 
      399
     | 
    
      									'TEXT_SID' => 'SID',
 
     | 
  
  
    | 
      400
     | 
    
      									'POSITION' => $section['position']
 
     | 
  
  
    | 
      401
     | 
    
      									)
 
     | 
  
  
    | 
      402
     | 
    
      								);
 
     | 
  
  
    | 
      403
     | 
    
      				} else {
     | 
  
  
    | 
      404
     | 
    
      					$tpl->set_var(array(
 
     | 
  
  
    | 
      405
     | 
    
      									'DISPLAY_DEBUG' => ' style="display:none;"',
 
     | 
  
  
    | 
      406
     | 
    
      									'TEXT_PID' => '',
 
     | 
  
  
    | 
      407
     | 
    
      									'POSITION' => ''
 
     | 
  
  
    | 
      408
     | 
    
      									)
 
     | 
  
  
    | 
      409
     | 
    
      								);
 
     | 
  
  
    | 
      410
     | 
    
      				}
 
     | 
  
  
    | 
      411
     | 
    
      				$tpl->parse('section_list', 'section_block', true);
     | 
  
  
    | 
      412
     | 
    
      			}
 
     | 
  
  
    | 
      413
     | 
    
      		}
 
     | 
  
  
    | 
      414
     | 
    
      
 
     | 
  
  
    | 
      415
     | 
    
      		// now add the calendars -- remember to to set the range to [1970, 2037] if the date is used as timestamp!
 
     | 
  
  
    | 
      416
     | 
    
      		// the loop is simply a copy from above.
 
     | 
  
  
    | 
      417
     | 
    
      		$sql  = 'SELECT `section_id`,`module` FROM `'.TABLE_PREFIX.'sections` ';
 
     | 
  
  
    | 
      418
     | 
    
      		$sql .= 'WHERE page_id = '.$page_id.' ';
 
     | 
  
  
    | 
      419
     | 
    
      		$sql .= 'ORDER BY `position` ASC';
 
     | 
  
  
    | 
      420
     | 
    
      		$query_sections = $database->query($sql);
 
     | 
  
  
    | 
      421
     | 
    
      
 
     | 
  
  
    | 
      422
     | 
    
      		if($query_sections->numRows() > 0)
 
     | 
  
  
    | 
      423
     | 
    
      		{
     | 
  
  
    | 
      424
     | 
    
      			$num_sections = $query_sections->numRows();
 
     | 
  
  
    | 
      425
     | 
    
      			while($section = $query_sections->fetchRow())
 
     | 
  
  
    | 
      426
     | 
    
      		    {
     | 
  
  
    | 
      427
     | 
    
      				// Get the modules real name
 
     | 
  
  
    | 
      428
     | 
    
      		        $sql  = 'SELECT `name` FROM `'.TABLE_PREFIX.'addons` ';
 
     | 
  
  
    | 
      429
     | 
    
      		        $sql .= 'WHERE `directory` = "'.$section['module'].'"';
 
     | 
  
  
    | 
      430
     | 
    
      		        $module_name = $database->get_one($sql);
 
     | 
  
  
    | 
      431
     | 
    
      
 
     | 
  
  
    | 
      432
     | 
    
      				if(!is_numeric(array_search($section['module'], $module_permissions)))
 
     | 
  
  
    | 
      433
     | 
    
      		        {
     | 
  
  
    | 
      434
     | 
    
      					$tpl->set_var(array(
 
     | 
  
  
    | 
      435
     | 
    
      								'jscal_ifformat' => $jscal_ifformat,
 
     | 
  
  
    | 
      436
     | 
    
      								'jscal_firstday' => $jscal_firstday,
 
     | 
  
  
    | 
      437
     | 
    
      								'jscal_today' => $jscal_today,
 
     | 
  
  
    | 
      438
     | 
    
      								'start_date' => 'start_date'.$section['section_id'],
 
     | 
  
  
    | 
      439
     | 
    
      								'end_date' => 'end_date'.$section['section_id'],
 
     | 
  
  
    | 
      440
     | 
    
      								'trigger_start' => 'trigger_start'.$section['section_id'],
 
     | 
  
  
    | 
      441
     | 
    
      								'trigger_end' => 'trigger_stop'.$section['section_id']
 
     | 
  
  
    | 
      442
     | 
    
      								)
 
     | 
  
  
    | 
      443
     | 
    
      							);
 
     | 
  
  
    | 
      444
     | 
    
      					if(isset($jscal_use_time) && $jscal_use_time==TRUE) {
     | 
  
  
    | 
      445
     | 
    
      						$tpl->set_var(array(
 
     | 
  
  
    | 
      446
     | 
    
      								'showsTime' => "true",
 
     | 
  
  
    | 
      447
     | 
    
      								'timeFormat' => "24"
 
     | 
  
  
    | 
      448
     | 
    
      								)
 
     | 
  
  
    | 
      449
     | 
    
      							);
 
     | 
  
  
    | 
      450
     | 
    
      					}  else {
     | 
  
  
    | 
      451
     | 
    
      						$tpl->set_var(array(
 
     | 
  
  
    | 
      452
     | 
    
      								'showsTime' => "false",
 
     | 
  
  
    | 
      453
     | 
    
      								'timeFormat' => "24"
 
     | 
  
  
    | 
      454
     | 
    
      								)
 
     | 
  
  
    | 
      455
     | 
    
      							);
 
     | 
  
  
    | 
      456
     | 
    
      					}
 
     | 
  
  
    | 
      457
     | 
    
      				}
 
     | 
  
  
    | 
      458
     | 
    
      				$tpl->parse('calendar_list', 'calendar_block', true);
     | 
  
  
    | 
      459
     | 
    
      			}
 
     | 
  
  
    | 
      460
     | 
    
      		}
 
     | 
  
  
    | 
      461
     | 
    
      
 
     | 
  
  
    | 
      462
     | 
    
      		// Work-out if we should show the "Add Section" form
 
     | 
  
  
    | 
      463
     | 
    
      		$sql  = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` ';
 
     | 
  
  
    | 
      464
     | 
    
      		$sql .= 'WHERE `page_id` = '.$page_id.' AND `module` = "menu_link"';
 
     | 
  
  
    | 
      465
     | 
    
      		$query_sections = $database->query($sql);
 
     | 
  
  
    | 
      466
     | 
    
      		if($query_sections->numRows() == 0)
 
     | 
  
  
    | 
      467
     | 
    
      		{
     | 
  
  
    | 
      468
     | 
    
      			// Modules list
 
     | 
  
  
    | 
      469
     | 
    
      		    $sql  = 'SELECT `name`,`directory`,`type` FROM `'.TABLE_PREFIX.'addons` ';
 
     | 
  
  
    | 
      470
     | 
    
      		    $sql .= 'WHERE `type` = "module" AND `function` = "page" AND `directory` != "menu_link" ';
 
     | 
  
  
    | 
      471
     | 
    
      		    $sql .= 'ORDER BY `name`';
 
     | 
  
  
    | 
      472
     | 
    
      		    $result = $database->query($sql);
 
     | 
  
  
    | 
      473
     | 
    
      		// if(DEBUG && $database->is_error()) { $admin->print_error($database->get_error()); }
     | 
  
  
    | 
      474
     | 
    
      
 
     | 
  
  
    | 
      475
     | 
    
      			if($result->numRows() > 0)
 
     | 
  
  
    | 
      476
     | 
    
      		    {
     | 
  
  
    | 
      477
     | 
    
      				while ($module = $result->fetchRow())
 
     | 
  
  
    | 
      478
     | 
    
      		        {
     | 
  
  
    | 
      479
     | 
    
      					// Check if user is allowed to use this module   echo  $module['directory'],'<br />';
 
     | 
  
  
    | 
      480
     | 
    
      					if(!is_numeric(array_search($module['directory'], $module_permissions)))
 
     | 
  
  
    | 
      481
     | 
    
      		            {
     | 
  
  
    | 
      482
     | 
    
      						$tpl->set_var('VALUE', $module['directory']);
     | 
  
  
    | 
      483
     | 
    
      						$tpl->set_var('NAME', $module['name']);
     | 
  
  
    | 
      484
     | 
    
      						if($module['directory'] == 'wysiwyg')
 
     | 
  
  
    | 
      485
     | 
    
      		                {
     | 
  
  
    | 
      486
     | 
    
      							$tpl->set_var('SELECTED', ' selected="selected"');
     | 
  
  
    | 
      487
     | 
    
      						} else {
     | 
  
  
    | 
      488
     | 
    
      							$tpl->set_var('SELECTED', '');
     | 
  
  
    | 
      489
     | 
    
      						}
 
     | 
  
  
    | 
      490
     | 
    
      						$tpl->parse('module_list', 'module_block', true);
     | 
  
  
    | 
      491
     | 
    
      					} else {
     | 
  
  
    | 
      492
     | 
    
      					  continue;
 
     | 
  
  
    | 
      493
     | 
    
      					}
 
     | 
  
  
    | 
      494
     | 
    
      				}
 
     | 
  
  
    | 
      495
     | 
    
      			}
 
     | 
  
  
    | 
      496
     | 
    
      		}
 
     | 
  
  
    | 
      497
     | 
    
      		// Insert language text and messages
 
     | 
  
  
    | 
      498
     | 
    
      		$tpl->set_var(array(
 
     | 
  
  
    | 
      499
     | 
    
      							'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
 
     | 
  
  
    | 
      500
     | 
    
      							'TEXT_ARE_YOU_SURE' => $TEXT['ARE_YOU_SURE'],
 
     | 
  
  
    | 
      501
     | 
    
      							'TEXT_TYPE' => $TEXT['TYPE'],
 
     | 
  
  
    | 
      502
     | 
    
      							'TEXT_ADD' => $TEXT['ADD'],
 
     | 
  
  
    | 
      503
     | 
    
      							'TEXT_SAVE' =>  $TEXT['SAVE'],
 
     | 
  
  
    | 
      504
     | 
    
      							'TEXTLINK_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
 
     | 
  
  
    | 
      505
     | 
    
      							'TEXT_CALENDAR' => $TEXT['CALENDAR'],
 
     | 
  
  
    | 
      506
     | 
    
      							'TEXT_DELETE_DATE' => $TEXT['DELETE_DATE'],
 
     | 
  
  
    | 
      507
     | 
    
      							'TEXT_ADD_SECTION' => $TEXT['ADD_SECTION'],
 
     | 
  
  
    | 
      508
     | 
    
      							'TEXT_MOVE_UP' => $TEXT['MOVE_UP'],
 
     | 
  
  
    | 
      509
     | 
    
      							'TEXT_MOVE_DOWN' => $TEXT['MOVE_DOWN']
 
     | 
  
  
    | 
      510
     | 
    
      							)
 
     | 
  
  
    | 
      511
     | 
    
      						);
 
     | 
  
  
    | 
      512
     | 
    
      		$tpl->parse('main', 'main_block', false);
     | 
  
  
    | 
      513
     | 
    
      		$tpl->pparse('output', 'page');
     | 
  
  
    | 
      514
     | 
    
      		// include the required file for Javascript admin
 
     | 
  
  
    | 
      515
     | 
    
      		if(file_exists(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php'))
 
     | 
  
  
    | 
      516
     | 
    
      		{
     | 
  
  
    | 
      517
     | 
    
      			include(WB_PATH.'/modules/jsadmin/jsadmin_backend_include.php');
 
     | 
  
  
    | 
      518
     | 
    
      		}
 
     | 
  
  
    | 
      519
     | 
    
      		break;
 
     | 
  
  
    | 
      520
     | 
    
      endswitch;
 
     | 
  
  
    | 
      521
     | 
    
      
 
     | 
  
  
    | 
      522
     | 
    
      // Print admin footer
 
     | 
  
  
    | 
      523
     | 
    
      $admin->print_footer();
 
     |