Project

General

Profile

« Previous | Next » 

Revision 1914

Added by Dietmar over 11 years ago

! /admin/pages/ add/change to new Translate class
add a default.ini with a list of protected basenames,
and a PagesEnvironment to force writing the accessfile forever

View differences:

sections.php
4 4
 * @category        admin
5 5
 * @package         pages
6 6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker2.org/
7
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
11 11
 * @requirements    PHP 5.2.2 and higher
......
40 40

  
41 41
// Include the WB functions file
42 42
if(!function_exists('directory_list')) { require(WB_PATH.'/framework/functions.php'); }
43
$mLang = Translate::getinstance();
44
$mLang->enableAddon('admin\pages');
43 45

  
44 46
$action = 'show';
45 47
// Get page id
......
89 91
				require_once(WB_PATH.'/framework/class.order.php');
90 92
				$order = new order(TABLE_PREFIX.'sections', 'position', 'section_id', 'page_id');
91 93
				$order->clean($page_id);
92
				$format = $TEXT['SECTION'].' %d  %s %s '.strtolower( $TEXT['DELETED']);
93
				$message = sprintf ($format,$section_id,strtoupper($modulname),strtolower($TEXT['SUCCESS']));
94
				$format = $mLang->TEXT_SECTION.' %d  %s %s '.strtolower( $mLang->TEXT_DELETED);
95
				$message = sprintf ($format,$section_id,strtoupper($modulname),strtolower($mLang->TEXT_SUCCESS));
94 96
				if($admin_header) { $admin->print_header(); }
95 97
				$admin_header = false;
96 98
				unset($_POST);
......
98 100
			}
99 101
        } else {
100 102
			if($admin_header) { $admin->print_header(); }
101
			$admin->print_error($module.' '.strtolower($TEXT['NOT_FOUND']),$backlink);
103
			$admin->print_error($module.' '.strtolower($mLang->TEXT_NOT_FOUND),$backlink);
102 104
        }
103 105

  
104 106
		break;
......
221 223
		}
222 224
		foreach($block as $iIndex=>$sBlockTitle) {
223 225
			if(trim($sBlockTitle) == '' ) {
224
			 $block[$iIndex] = $TEXT['BLOCK'].'_'.$iIndex;
226
			 $block[$iIndex] = $mLang->TEXT_BLOCK.'_'.$iIndex;
225 227
			}
226 228
		}
227 229
	}else {
228 230
		// Make our own menu list
229
		$block = array(1, $TEXT['MAIN']);
231
		$block = array(1, $mLang->TEXT_MAIN);
230 232
	}
231 233
		/*-- load css files with jquery --*/
232 234
		// include jscalendar-setup
......
250 252
						'PAGE_ID' => $results_array['page_id'],
251 253
						// 'PAGE_IDKEY' => $admin->getIDKEY($results_array['page_id']),
252 254
						'PAGE_IDKEY' => $results_array['page_id'],
253
						'TEXT_PAGE' => $TEXT['PAGE'],
255
						'TEXT_PAGE' => $mLang->TEXT_PAGE,
254 256
						'PAGE_TITLE' => ($results_array['page_title']),
255 257
						'MENU_TITLE' => ($results_array['menu_title']),
256
						'TEXT_CURRENT_PAGE' => $TEXT['CURRENT_PAGE'],
257
						'TEXT_LAST_MODIFIED' => $TEXT['LAST_UPDATED_BY'],
258
						'TEXT_CURRENT_PAGE' => $mLang->TEXT_CURRENT_PAGE,
259
						'TEXT_LAST_MODIFIED' => $mLang->TEXT_LAST_UPDATED_BY,
258 260
						'HEADING_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
259 261
						'HEADING_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
260
						'TEXT_CHANGE_SETTINGS' => $TEXT['CHANGE_SETTINGS'],
261
						'TEXT_ADD_SECTION' => $TEXT['ADD_SECTION'],
262
						'TEXT_SECTION' => $TEXT['SECTION'],
262
						'TEXT_CHANGE_SETTINGS' => $mLang->TEXT_CHANGE_SETTINGS,
263
						'TEXT_ADD_SECTION' => $mLang->TEXT_ADD_SECTION,
264
						'TEXT_SECTION' => $mLang->TEXT_SECTION,
263 265
						'TEXT_ID' => 'ID',
264
						'TEXT_TYPE' => $TEXT['TYPE'],
265
						'TEXT_BLOCK' => $TEXT['BLOCK'],
266
						'TEXT_TYPE' => $mLang->TEXT_TYPE,
267
						'TEXT_BLOCK' => $mLang->TEXT_BLOCK,
266 268
						'TEXT_PUBL_START_DATE' => $TEXT{'PUBL_START_DATE'},
267
						'TEXT_PUBL_END_DATE' => $TEXT['PUBL_END_DATE'],
268
						'TEXT_ACTIONS' => $TEXT['ACTIONS'],
269
						'TEXT_PUBL_END_DATE' => $mLang->TEXT_PUBL_END_DATE,
270
						'TEXT_ACTIONS' => $mLang->TEXT_ACTIONS,
269 271
						'MODIFIED_BY'          => $user['display_name'],
270 272
						'MODIFIED_BY_USERNAME' => $user['username'],
271 273
						'MODIFIED_WHEN'        => $modified_ts,
......
330 332
		if($query_sections->numRows() > 0)
331 333
		{
332 334
			$num_sections = $query_sections->numRows();
333
			while($section = $query_sections->fetchRow())
335
			while($section = $query_sections->fetchRow(MYSQL_ASSOC))
334 336
		    {
335 337
				if(!is_numeric(array_search($section['module'], $module_permissions)))
336 338
		        {
......
344 346
					{
345 347
						$edit_page = '';
346 348
					}
347
					$sec_anchor = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR : 'section_');
349
					$sSectionIdPrefix = ( defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR : 'Sec');
348 350
					$edit_page_0 = '<a id="sid'.$section['section_id'].'" href="'.ADMIN_URL.'/pages/modify.php?page_id='.$results_array['page_id'];
349
					$edit_page_1  = ($sec_anchor!='') ? '#'.$sec_anchor.$section['section_id'].'">' : '">';
351
					$edit_page_1  = ($sSectionIdPrefix!='') ? '#'.$sSectionIdPrefix.$section['section_id'].'">' : '">';
350 352
					$edit_page_1 .= $section['module'].'</a>';
351 353
					if(SECTION_BLOCKS)
352 354
		            {
......
421 423
		            {
422 424
						$tpl->set_var('VALUE_PUBL_START', '');
423 425
					} else {
424
						$tpl->set_var('VALUE_PUBL_START', date($jscal_format, $section['publ_start']));
426
						$tpl->set_var('VALUE_PUBL_START', date($jscal_format, $section['publ_start']+TIMEZONE));
425 427
					}
426 428
					// set calendar start values
427 429
					if($section['publ_end']==0)
428 430
		            {
429 431
						$tpl->set_var('VALUE_PUBL_END', '');
430 432
					} else {
431
						$tpl->set_var('VALUE_PUBL_END', date($jscal_format, $section['publ_end']));
433
						$tpl->set_var('VALUE_PUBL_END', date($jscal_format, $section['publ_end']+TIMEZONE));
432 434
					}
433 435
					// Insert icons up and down
434 436
					if($section['position'] != 1 )
......
545 547
		$sql  = 'SELECT `section_id` FROM `'.TABLE_PREFIX.'sections` ';
546 548
		$sql .= 'WHERE `page_id` = '.$page_id.' AND `module` = "menu_link"';
547 549
		$query_sections = $database->query($sql);
548
		$tpl->set_var('TEXT_PLEASE_SELECT', $TEXT['NONE']);
550
		$tpl->set_var('TEXT_PLEASE_SELECT', $mLang->TEXT_NONE);
549 551
		if($query_sections->numRows() == 0)
550 552
		{
551
			$tpl->set_var('TEXT_PLEASE_SELECT', $TEXT['PLEASE_SELECT']);
553
			$tpl->set_var('TEXT_PLEASE_SELECT', $mLang->TEXT_PLEASE_SELECT);
552 554
			// Modules list
553 555
		    $sql  = 'SELECT `name`,`directory`,`type` FROM `'.TABLE_PREFIX.'addons` ';
554 556
		    $sql .= 'WHERE `type` = "module" AND `function` = "page" AND `directory` != "menu_link" ';
......
581 583
		// Insert language text and messages
582 584
		$tpl->set_var(array(
583 585
							'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
584
							'TEXT_ARE_YOU_SURE' => $TEXT['ARE_YOU_SURE'],
585
							'TEXT_TYPE' => $TEXT['TYPE'],
586
							'TEXT_ADD' => $TEXT['ADD'],
587
							'TEXT_SAVE' =>  $TEXT['SAVE'],
586
							'TEXT_ARE_YOU_SURE' => $mLang->TEXT_ARE_YOU_SURE,
587
							'TEXT_TYPE' => $mLang->TEXT_TYPE,
588
							'TEXT_ADD' => $mLang->TEXT_ADD,
589
							'TEXT_SAVE' =>  $mLang->TEXT_SAVE,
588 590
							'TEXTLINK_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
589
							'TEXT_CALENDAR' => $TEXT['CALENDAR'],
590
							'TEXT_DELETE_DATE' => $TEXT['DELETE_DATE'],
591
							'TEXT_ADD_SECTION' => $TEXT['ADD_SECTION'],
592
							'TEXT_MOVE_UP' => $TEXT['MOVE_UP'],
593
							'TEXT_MOVE_DOWN' => $TEXT['MOVE_DOWN']
591
							'TEXT_CALENDAR' => $mLang->TEXT_CALENDAR,
592
							'TEXT_DELETE_DATE' => $mLang->TEXT_DELETE_DATE,
593
							'TEXT_ADD_SECTION' => $mLang->TEXT_ADD_SECTION,
594
							'TEXT_MOVE_UP' => $mLang->TEXT_MOVE_UP,
595
							'TEXT_MOVE_DOWN' => $mLang->TEXT_MOVE_DOWN
594 596
							)
595 597
						);
596 598
		$tpl->parse('main', 'main_block', false);

Also available in: Unified diff