Changeset 2479
- Timestamp:
- Aug 20, 2008, 2:35:22 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/about.php
r2299 r2479 64 64 } 65 65 66 $template->assign('ABOUT_MESSAGE', load_language('about.html','', '',true) );66 $template->assign('ABOUT_MESSAGE', load_language('about.html','', array('return'=>true)) ); 67 67 68 68 $template->pparse('about'); -
trunk/admin/help.php
r2299 r2479 29 29 check_status(ACCESS_ADMINISTRATOR); 30 30 31 $template->assign('ADMIN_CONTENT', load_language('help.html','', '',true) );31 $template->assign('ADMIN_CONTENT', load_language('help.html','',array('return'=>true)) ); 32 32 ?> -
trunk/include/common.inc.php
r2476 r2479 178 178 } 179 179 trigger_action('loading_lang'); 180 load_language('local.lang' );180 load_language('local.lang', '', array('no_fallback'=>true) ); 181 181 182 182 // only now we can set the localized username of the guest user (and not in -
trunk/include/functions.inc.php
r2456 r2479 238 238 239 239 return $tndir; 240 }241 242 // The get_picture_size function return an array containing :243 // - $picture_size[0] : final width244 // - $picture_size[1] : final height245 // The final dimensions are calculated thanks to the original dimensions and246 // the maximum dimensions given in parameters. get_picture_size respects247 // the width/height ratio248 function get_picture_size( $original_width, $original_height,249 $max_width, $max_height )250 {251 $width = $original_width;252 $height = $original_height;253 $is_original_size = true;254 255 if ( $max_width != "" )256 {257 if ( $original_width > $max_width )258 {259 $width = $max_width;260 $height = floor( ( $width * $original_height ) / $original_width );261 }262 }263 if ( $max_height != "" )264 {265 if ( $original_height > $max_height )266 {267 $height = $max_height;268 $width = floor( ( $height * $original_width ) / $original_height );269 $is_original_size = false;270 }271 }272 if ( is_numeric( $max_width ) and is_numeric( $max_height )273 and $max_width != 0 and $max_height != 0 )274 {275 $ratioWidth = $original_width / $max_width;276 $ratioHeight = $original_height / $max_height;277 if ( ( $ratioWidth > 1 ) or ( $ratioHeight > 1 ) )278 {279 if ( $ratioWidth < $ratioHeight )280 {281 $width = floor( $original_width / $ratioHeight );282 $height = $max_height;283 }284 else285 {286 $width = $max_width;287 $height = floor( $original_height / $ratioWidth );288 }289 $is_original_size = false;290 }291 }292 $picture_size = array();293 $picture_size[0] = $width;294 $picture_size[1] = $height;295 return $picture_size;296 240 } 297 241 … … 753 697 load_language('common.lang'); 754 698 trigger_action('loading_lang'); 755 load_language('local.lang' );699 load_language('local.lang', '', array('no_fallback'=>true) ); 756 700 list($tmpl, $thm) = explode('/', get_default_template()); 757 701 $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm); … … 1395 1339 * @param string filename 1396 1340 * @param string dirname 1397 * @param string language 1398 * @param bool return_content - if true the file content is returned otherwise 1399 * the file is evaluated as php 1400 * @return boolean success status or a string if return_content is true 1401 */ 1402 function load_language($filename, $dirname = '', $language = '', 1403 $return_content=false, $target_charset=null) 1341 * @param mixed options can contain 1342 * language - language to load (if empty uses user language) 1343 * return - if true the file content is returned otherwise the file is evaluated as php 1344 * target_charset - 1345 * no_fallback - the language must be respected 1346 * @return boolean success status or a string if options['return'] is true 1347 */ 1348 function load_language($filename, $dirname = '', 1349 $options = array() ) 1404 1350 { 1405 1351 global $user; 1406 1352 1407 if (! $return_content)1353 if (! @$options['return'] ) 1408 1354 { 1409 1355 $filename .= '.php'; //MAYBE to do .. load .po and .mo localization files … … 1416 1362 1417 1363 $languages = array(); 1418 if ( !empty($ language) )1419 { 1420 $languages[] = $ language;1364 if ( !empty($options['language']) ) 1365 { 1366 $languages[] = $options['language']; 1421 1367 } 1422 1368 if ( !empty($user['language']) ) … … 1424 1370 $languages[] = $user['language']; 1425 1371 } 1426 if ( defined('PHPWG_INSTALLED') ) 1427 { 1428 $languages[] = get_default_language(); 1429 } 1430 $languages[] = PHPWG_DEFAULT_LANGUAGE; 1372 if ( ! @$options['no_fallback'] ) 1373 { 1374 if ( defined('PHPWG_INSTALLED') ) 1375 { 1376 $languages[] = get_default_language(); 1377 } 1378 $languages[] = PHPWG_DEFAULT_LANGUAGE; 1379 } 1380 1431 1381 $languages = array_unique($languages); 1432 1382 1433 if ( empty($ target_charset) )1383 if ( empty($options['target_charset']) ) 1434 1384 { 1435 1385 $target_charset = get_pwg_charset(); 1386 } 1387 else 1388 { 1389 $target_charset = $options['target_charset']; 1436 1390 } 1437 1391 $target_charset = strtolower($target_charset); … … 1473 1427 if ( !empty($source_file) ) 1474 1428 { 1475 if (! $return_content)1429 if (! @$options['return'] ) 1476 1430 { 1477 1431 @include($source_file); -
trunk/include/functions_mail.inc.php
r2339 r2479 247 247 248 248 // language files 249 load_language('common.lang', '', $language);249 load_language('common.lang', '', array('language'=>$language) ); 250 250 // No test admin because script is checked admin (user selected no) 251 251 // Translations are in admin file too 252 load_language('admin.lang', '', $language);252 load_language('admin.lang', '', array('language'=>$language) ); 253 253 trigger_action('loading_lang'); 254 load_language('local.lang', '', $language);254 load_language('local.lang', '', array('language'=>$language, 'no_fallback'=>true)); 255 255 256 256 $switch_lang[$language]['lang_info'] = $lang_info; -
trunk/include/functions_picture.inc.php
r2299 r2479 328 328 } 329 329 330 // The get_picture_size function return an array containing : 331 // - $picture_size[0] : final width 332 // - $picture_size[1] : final height 333 // The final dimensions are calculated thanks to the original dimensions and 334 // the maximum dimensions given in parameters. get_picture_size respects 335 // the width/height ratio 336 function get_picture_size( $original_width, $original_height, 337 $max_width, $max_height ) 338 { 339 $width = $original_width; 340 $height = $original_height; 341 $is_original_size = true; 342 343 if ( $max_width != "" ) 344 { 345 if ( $original_width > $max_width ) 346 { 347 $width = $max_width; 348 $height = floor( ( $width * $original_height ) / $original_width ); 349 } 350 } 351 if ( $max_height != "" ) 352 { 353 if ( $original_height > $max_height ) 354 { 355 $height = $max_height; 356 $width = floor( ( $height * $original_width ) / $original_height ); 357 $is_original_size = false; 358 } 359 } 360 if ( is_numeric( $max_width ) and is_numeric( $max_height ) 361 and $max_width != 0 and $max_height != 0 ) 362 { 363 $ratioWidth = $original_width / $max_width; 364 $ratioHeight = $original_height / $max_height; 365 if ( ( $ratioWidth > 1 ) or ( $ratioHeight > 1 ) ) 366 { 367 if ( $ratioWidth < $ratioHeight ) 368 { 369 $width = floor( $original_width / $ratioHeight ); 370 $height = $max_height; 371 } 372 else 373 { 374 $width = $max_width; 375 $height = floor( $original_height / $ratioWidth ); 376 } 377 $is_original_size = false; 378 } 379 } 380 $picture_size = array(); 381 $picture_size[0] = $width; 382 $picture_size[1] = $height; 383 return $picture_size; 384 } 385 330 386 ?> -
trunk/install.php
r2339 r2479 207 207 } 208 208 209 load_language( 'common.lang', '', $language, false, 'utf-8');210 load_language( 'admin.lang', '', $language, false, 'utf-8');211 load_language( 'install.lang', '', $language, false, 'utf-8');209 load_language( 'common.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); 210 load_language( 'admin.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); 211 load_language( 'install.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); 212 212 213 213 //----------------------------------------------------- template initialization -
trunk/nbm.php
r2325 r2479 35 35 // Need to update a second time 36 36 trigger_action('loading_lang'); 37 load_language('local.lang' );37 load_language('local.lang', '', array('no_fallback'=>true) ); 38 38 39 39 -
trunk/plugins/add_index/main.normal.inc.php
r2299 r2479 34 34 { 35 35 $help_content = 36 load_language('help/'.$page.'.html', $this->path, '', true);36 load_language('help/'.$page.'.html', $this->path, array('return'=>true) ); 37 37 } 38 38 else -
trunk/plugins/language_switch/language_switch.inc.php
r2299 r2479 58 58 if ( $same !== $user['language']) 59 59 { 60 load_language('common.lang', '', $user['language']);61 load_language('local.lang', '', $user['language']);60 load_language('common.lang', '', array('language'=>$user['language']) ); 61 load_language('local.lang', '', array('language'=>$user['language'], 'no_fallback'=>true) ); 62 62 if (defined('IN_ADMIN') and IN_ADMIN) 63 63 { 64 load_language('admin.lang', '', $user['language']);64 load_language('admin.lang', '', array('language'=>$user['language']) ); 65 65 } 66 66 } -
trunk/popuphelp.php
r2342 r2479 47 47 { 48 48 $help_content = 49 load_language('help/'.$_GET['page'].'.html', '', '', true);49 load_language('help/'.$_GET['page'].'.html', '', array('return'=>true) ); 50 50 51 51 if ($help_content == false) -
trunk/template-extension/distributed/samples/my-picture.tpl
r2434 r2479 23 23 24 24 {if isset($previous) } 25 <a class="navThumb" id=" thumbPrev" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev">26 <img src="{$previous.THUMB_SRC}" class="thumbLink" id="linkPrev"alt="{$previous.TITLE}">25 <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev"> 26 <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}"> 27 27 </a> 28 28 {/if} 29 29 {if isset($next) } 30 <a class="navThumb" id=" thumbNext" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next">31 <img src="{$next.THUMB_SRC}" class="thumbLink" id="linkNext"alt="{$next.TITLE}">30 <a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next"> 31 <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}"> 32 32 </a> 33 33 {/if} -
trunk/template/yoga/default-layout.css
r2476 r2479 164 164 FORM.filter FIELDSET P 165 165 { 166 167 166 clear: left; 167 display: block; 168 168 } 169 169 170 170 FORM.filter INPUT[type="submit"] { 171 172 } 173 174 FORM.properties UL , FORM#update UL{175 176 177 178 } 179 180 FORM.properties LI , FORM#update UL{181 182 183 184 171 margin-top: 1em; 172 } 173 174 FORM.properties UL { 175 list-style-type: none; 176 margin: 0; 177 padding: 0; 178 } 179 180 FORM.properties LI { 181 margin-bottom: 0.5em; 182 padding: 0; 183 line-height: 1.8em; 184 clear: left; 185 185 } 186 186 -
trunk/template/yoga/picture.css
r2295 r2479 59 59 } 60 60 61 .navThumb {62 margin-top: 2px;63 }64 #thumbPrev {65 float: left;66 }67 68 #thumbNext {69 float: right;70 }71 72 61 #linkPrev { 73 margin-right: 10px; 74 margin-left: 5px; 62 float: left; 75 63 } 76 64 77 65 #linkNext { 78 margin-right: 5px; 79 margin-left: 10px; 66 float: right; 67 } 68 69 #linkPrev IMG { 70 margin-right: 10px; 71 margin-left: 5px; 72 } 73 74 #linkNext IMG { 75 margin-right: 5px; 76 margin-left: 10px; 80 77 } 81 78 … … 97 94 98 95 .rateButton, .rateButtonSelected, .rateButtonStarFull, .rateButtonStarEmpty { 99 100 96 padding:0; 97 border:0; 101 98 } 102 99 103 100 .rateButton, .rateButtonStarFull, .rateButtonStarEmpty { 104 101 cursor: pointer; 105 102 } 106 103 107 104 .rateButtonSelected { 108 109 105 font-weight:bold; 106 font-size:120%; 110 107 } 111 108 -
trunk/template/yoga/picture.tpl
r2435 r2479 94 94 95 95 {if isset($previous) } 96 <a class="navThumb" id=" thumbPrev" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev">97 <img src="{$previous.THUMB_SRC}" class="thumbLink" id="linkPrev"alt="{$previous.TITLE}">96 <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev"> 97 <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}"> 98 98 </a> 99 99 {/if} 100 100 {if isset($next) } 101 <a class="navThumb" id=" thumbNext" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next">102 <img src="{$next.THUMB_SRC}" class="thumbLink" id="linkNext"alt="{$next.TITLE}">101 <a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next"> 102 <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}"> 103 103 </a> 104 104 {/if}
Note: See TracChangeset
for help on using the changeset viewer.