Page 1 of 1

[LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Posted: Mon Nov 20, 2006 10:37 am
by fotisevangelou
Description:
The file offline.php does not have the $cur_template variable included in the CSS path. The variable exists higher but is not used in the html output. Instead this link is used:

Code: Select all

<link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/css/offline.css" type="text/css" />
Adding below that the current template's CSS link, it would ease the customization of the "Offline" page, only from the template's CSS file.

Reported on:
Joomla 1.0.11

Classification:
Low/Enhancement

Affected functions:
"Offline" page for Joomla!

Related files:
offline.php

Steps to replicate:
Enable offline mode for any Joomla! 1.0.11 website.

Analysis:
[Q&T] Confirmed

Proposed fix(es):
Add below the current CSS link this line of code:

Code: Select all

<link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $cur_template; ?>/css/template_css.css" type="text/css" />
Keeping the link to offline.css would serve as a backup, in case someone did not use a template_css.css file for their Joomla! website.

Topic / Artifact ID:
[USER] Enter the cross reference for topic or artifact id/url when submitted

System info:
Tested on several Windows machines, under AMP setup with PHP4 and MySQL 4 or 5.

Re: Adjust CSS path in file offline.php

Posted: Mon Nov 20, 2006 10:58 am
by Robin
Q&T Note; Status > Under Review

Re: [LOW:UNDER REVIEW:1.0.11] Adjust CSS path in file offline.php

Posted: Mon Nov 20, 2006 6:32 pm
by Robin
Q&T Note; discussed by Rob and Robin, feedback has been requested by Dev.

Re: [LOW:UNDER REVIEW:1.0.11] Adjust CSS path in file offline.php

Posted: Thu Nov 23, 2006 1:28 am
by RobS
alright, the Devs seem to think it is okay if we include that tag but I only want to include it if the file exists so we don't have people's access logs being filled up with 404 errors. 

so, the revised change would be something like:

Code: Select all

if( file_exists( 'templates/' . $cur_template .'/css/template_css.css' ) ) {
     ?>    
     <link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $cur_template; ?>/css/template_css.css" type="text/css"/>
     <?php
}
Q&T Note; Added to the Tracker.  http://forge.joomla.org/sf/go/artf6863?nav=1

Re: [LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Posted: Sun Nov 26, 2006 1:13 am
by absalom
Possible code revision:

Code: Select all

if (!defined( '_ADMIN_OFFLINE' ) || defined( '_INSTALL_CHECK' )) {
	@include_once ('language/' . $mosConfig_lang . '.php' );
	
	// needed to seperate the ISO number from the language file constant _ISO
	$iso = split( '=', _ISO );
	?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo _LANGUAGE; ?>" lang="<?php echo _LANGUAGE; ?>">
	<head>
		<title><?php echo $mosConfig_sitename; ?> - Offline</title>
	<?php 
	if( file_exists( 'templates/' . $cur_template .'/css/template_css.css' ) ) {
    ?>
	<link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/<?php echo $cur_template; ?>/css/
	template_css.css" type="text/css"/>
	<?php 
	}
	?>
		<link rel="stylesheet" href="<?php echo $mosConfig_live_site; ?>/templates/css/offline.css" type="text/css" />
By disambiguating it from being set to rhuk_solarflare_ii, it means it will grab the appropriate styles from the relevant template and then style with offline.css. It also deals with the XML prolog issue that's been affecting frontend and backend rendering via quirks mode.

Re: [LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Posted: Wed Nov 29, 2006 7:46 pm
by Robin
Q&T Note; fixed for next release

Re: [LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Posted: Thu Dec 07, 2006 1:30 am
by RobS
As a final note on this one, I changed the css file to offline.css as there were style conflicts with using template_css.css.  So, now the offline.php will include templates/css/offline.css and if present, templates/$current_template/css/offline.css

Re: [LOW:TRACKER 6863:1.0.11] Adjust CSS path in file offline.php

Posted: Thu Dec 07, 2006 3:20 am
by absalom
RobS wrote: As a final note on this one, I changed the css file to offline.css as there were style conflicts with using template_css.css.  So, now the offline.php will include templates/css/offline.css and if present, templates/$current_template/css/offline.css
Probably not the best path to take.. CSS allows precedence and if you want your 'offline' status styled in the same way as your 'online' templates, the only problem therefore will be potential malformedness on part of the initial offline.css file / offline template design.

So it's not the template_css.css file at fault, but the way the offline effect is delivered.