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:

settings.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
......
86 86
		}
87 87
	} // end of function parent_list
88 88
/* -------------------------------------------------------------------------------------*/
89
	$mLang = ModLanguage::getInstance();
90
	$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
89
//	$mLang = ModLanguage::getInstance();
90
//	$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
91
	$mLang = Translate::getinstance();
92
	$mLang->enableAddon('admin\pages');
91 93
	$sDisabled = ' disabled="disabled"';
92 94
	$sSelected = ' selected="selected"';
93 95
	$sChecked  = ' checked="checked"';
......
103 105
	if( ($oPages = $database->query($sql)) ) {
104 106
		$aCurrentPage = $oPages->fetchRow(MYSQL_ASSOC);
105 107
		// Work-out if we should set seo_title
106
        $aCurrentPage['seo_title'] = basename($aCurrentPage['link']);
108
		$aCurrentPage['seo_title'] = basename($aCurrentPage['link']);
107 109
		// Work-out if we should check for existing page_code
108 110
		$field_set = isset($aCurrentPage['page_code']);
109 111
		if( !$admin->ami_group_member($aCurrentPage['admin_groups']) &&
......
136 138
	$oTpl->set_file('page', 'pages_settings.htt');
137 139
	$oTpl->set_block('page', 'main_block', 'main');
138 140
	$oTpl->set_var('FTAN', $admin->getFTAN());
139
//    $sShowIconDirText = $TEXT['EXPAND'].' ';
141
//    $sShowIconDirText = $mLang->TEXT_EXPAND'].' ';
140 142
	$sql = 'SELECT `value` FROM `'.TABLE_PREFIX.'settings` WHERE `name` = \'page_extendet\'';
141 143
//	if($page_extend = $database->get_one($sql)) {}
142 144
	$page_extend = (defined('PAGE_EXTENDET') ? filter_var(PAGE_EXTENDET, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) : false);
143
	$sShowIconDirText = ($page_extend==true) ? $TEXT['HIDE_ADVANCED'] : $TEXT['SHOW_ADVANCED'];
145
	$sShowIconDirText = ($page_extend==true) ? $mLang->TEXT_HIDE_ADVANCED : $mLang->TEXT_SHOW_ADVANCED;
144 146

  
145 147
	$oTpl->set_var(array(
146 148
			'PAGE_ID'              => $aCurrentPage['page_id'],
......
154 156
			'MODIFIED_BY'          => $user['display_name'],
155 157
			'MODIFIED_BY_USERNAME' => $user['username'],
156 158
			'MODIFIED_WHEN'        => $modified_ts,
157
			'TEXT_SAVE_BACK'       => $TEXT['SAVE'].' & '.$TEXT['BACK'],
159
			'TEXT_SAVE_BACK'       => $mLang->TEXT_SAVE.' & '.$mLang->TEXT_BACK,
158 160
			'TEXT_EXTENDED'        => $sShowIconDirText,
161
			'VISIBILITY'           => 'visibility',
159 162
			'ADMIN_URL'            => ADMIN_URL,
160 163
			'WB_URL'               => WB_URL,
161 164
			'THEME_URL'            => THEME_URL
......
207 210
	$sTemplate = ($aCurrentPage['template'] == '' ? DEFAULT_TEMPLATE : $aCurrentPage['template']);
208 211
	$sIconDir = str_replace('\\', '/', ((defined('PAGE_ICON_DIR') && PAGE_ICON_DIR != '') ? PAGE_ICON_DIR : MEDIA_DIRECTORY));
209 212
	$sIconDir = str_replace('/*', '/'.$sTemplate, $sIconDir);
210
	$bIconDirHide = ($page_extend==true) ? '' : 'hide';
213
	$bIconDirHide = ($page_extend==true) ? 'display:block;' : 'display:none;';
214

  
211 215
//	$oTpl->set_var('ICON_DIR', WB_REL.$sIconDir);
212 216
	$sHelp = replaceVars($mLang->HELP_PAGE_IMAGE_DIR, array('icon_dir'=>WB_REL.$sIconDir ) );
213 217

  
......
551 555
		}
552 556
		$aMenu = getTemplateInfo($aCurrentPage['template']);
553 557
		// set menu[1] as default if there's no entry in info.php
554
		$aMenu[1] = (!isset($aMenu[1]) OR ($aMenu[1] == '')) ? $TEXT['MAIN'] : $aMenu[1];
558
		$aMenu[1] = (!isset($aMenu[1]) OR ($aMenu[1] == '')) ? $mLang->TEXT_MAIN : $aMenu[1];
555 559
		$oTpl->set_block('show_menu_list_block', 'menu_list_block', 'menu_list');
556 560
		foreach($aMenu as $iIndex => $sMenuName) {
557 561
			$aVars = array();

Also available in: Unified diff