1
jimmyx
strange problem in admin panel redirection
  • 2010/2/6 16:01

  • jimmyx

  • Quite a regular

  • Posts: 338

  • Since: 2007/7/18


i have a custom system_redirect template in my theme (themes/xx/modules/system/system_redirect.html)

i notice when i have this template in my theme folder

there is no style for redirection in admin panel just text with white background

when i disable the template in my theme (i just renamed it)

the redirection style is normal.no problem

same issue with all admin themes


1. is this a bug ?

2. system_redirect.html is just for front side ...so for admin theme where can i check and modify the style for redirection ?


here's my custom redirect template..

le="color: #000000"><?php <!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="<{$xoops_langcode}>" lang="<{$xoops_langcode}>"> <head> <meta http-equiv="content-type" content="text/html; charset=<{$xoops_charset}>" /> <meta http-equiv="content-language" content="<{$xoops_langcode}>" /> <meta name="robots" content="<{$xoops_meta_robots}>" /> <meta name="keywords" content="<{$xoops_meta_keywords}>" /> <meta name="description" content="<{$xoops_meta_description}>" /> <meta name="rating" content="<{$xoops_meta_rating}>" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Refresh" content="<{$time}>; url=<{$url}>" /> <title><{$xoops_sitename}> - <{$xoops_pagetitle}></title> <link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" /> <link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_imageurl}>css/closed.css" /> </head> <body> <div class="container"> <div class="the_logo"> <img src="<{$xoops_imageurl}>images/logo.png" alt="Portal" id="the-logo" /> </div> <div class="the_message redirect"> <{$message}> <span><{$lang_ifnotreload}></span> </div> <{if $xoops_logdump != ''}><div><{$xoops_logdump}></div><{/if}> </div> </body> </html>


is there anything wrong with it ? using 2.4.4

2
jimmyx
Re: strange problem in admin panel redirection
  • 2010/2/8 5:36

  • jimmyx

  • Quite a regular

  • Posts: 338

  • Since: 2007/7/18


bump

3
ghia
Re: strange problem in admin panel redirection
  • 2010/2/8 9:39

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Do you have a /themes/yourtheme/css/closed.css ?
And does it take care of all the style elements provided by:
<!-- include xoops.js and others via header.php -->
le="color: #000000"><?php <{$xoops_module_header}> <!-- XOOPS style sheet --> <link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl xoops.css}>" /> <!-- Theme style sheets --> <link rel="stylesheet" type="text/css" media="screen" title="Color" href="<{xoImgUrl style.css}>" />
?


4
jimmyx
Re: strange problem in admin panel redirection
  • 2010/2/8 10:37

  • jimmyx

  • Quite a regular

  • Posts: 338

  • Since: 2007/7/18


yes closed exist in css folder

ok i know whats the prblem
in admin when redirection occurs i view source and i saw this

le="color: #000000"><?php <link rel="stylesheet" type="text/css" media="screen" href="xxxx/themes/default/css/closed.css" />



why it is going to default theme and not my theme xxx ?

what do i need to change here ?
le="color: #000000"><?php <link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_imageurl}>css/closed.css" />


don't you here in xoops.org have this problem ?

this is actually wox theme i'm playing with

5
ghia
Re: strange problem in admin panel redirection
  • 2010/2/10 10:39

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Difficult to simulate, but I think it is still pointing to /themes/wox/, altough in the admin part also the admin theme under oxygen can be used: /modules/system/class/gui/oxygen

You should check out some Smarty variables as {$xoops_imageurl} with Smarty debug enabled.

6
trabis
Re: strange problem in admin panel redirection
  • 2010/2/10 14:06

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Try clean smarty cache folder.

7
jimmyx
Re: strange problem in admin panel redirection
  • 2010/2/10 15:45

  • jimmyx

  • Quite a regular

  • Posts: 338

  • Since: 2007/7/18


cleaning cache doesnt do anything...done that many time..

turning on debug..no any error

<{$xoops_imageurl}> i change this to my hardcore link http://domain.com/themes/xxx and all is ok


don't know maybe prblem with <{$xoops_imageurl}> which is going to domain.com/themes/default/

what can i use in my template instead of harcore link ?

8
ghia
Re: strange problem in admin panel redirection
  • 2010/2/10 19:08

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Not PHP debug, but Smarty debug!

9
trabis
Re: strange problem in admin panel redirection
  • 2010/2/10 23:26

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


OK, I found the problem.
That is the same bug we have when updating system module using the default theme: Redirect page loses style!

This is why:
system_redirect.html and system_siteclosed.html are templates and not themes!
Template have the following variables available:
le="color: #000000"><?php $this->assign(array( 'xoops_url' => XOOPS_URL , 'xoops_rootpath' => XOOPS_ROOT_PATH , 'xoops_langcode' => _LANGCODE , 'xoops_charset' => _CHARSET , 'xoops_version' => XOOPS_VERSION , 'xoops_upload_url' => XOOPS_UPLOAD_URL));

Themes have some more variables:
le="color: #000000"><?php $this->template->assign(array( 'xoops_theme' => $GLOBALS['xoopsConfig']['theme_set'] , 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $GLOBALS['xoopsConfig']['theme_set'] . '/', 'xoops_themecss' => xoops_getcss($GLOBALS['xoopsConfig']['theme_set']), 'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES), 'xoops_dirname' => isset($GLOBALS['xoopsModule'])&& is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : 'system', 'xoops_banner' => $GLOBALS['xoopsConfig']['banners'] ? xoops_getbanner() : '&nbsp;', 'xoops_pagetitle' => isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('name') : htmlspecialchars($GLOBALS['xoopsConfig']['slogan'], ENT_QUOTES))); if (isset($GLOBALS['xoopsUser']) && is_object($GLOBALS['xoopsUser'])) { $this->template->assign(array( 'xoops_isuser' => true, 'xoops_avatar' => $GLOBALS['xoopsUser']->getVar('user_avatar'), 'xoops_userid' => $GLOBALS['xoopsUser']->getVar('uid'), 'xoops_uname' => $GLOBALS['xoopsUser']->getVar('uname'), 'xoops_name' => $GLOBALS['xoopsUser']->getVar('name'), 'xoops_isadmin' => $GLOBALS['xoopsUserIsAdmin'], 'xoops_usergroups' => $GLOBALS['xoopsUser']->getGroups())); } else { $this->template->assign(array( 'xoops_isuser' => false, 'xoops_isadmin' => false, 'xoops_usergroups' => array(XOOPS_GROUP_ANONYMOUS))); }


If you delete smarty compiles and hit a redirect page in the front end (where theme is available), then you will have luck and the new template will be compiled ok. If you update system module where a $tpl->touch() is made (outside the scope of a theme) then the new compile will be messed up.

2 Solutions:
1 - Update the touch method to create a theme instance and use the tpl from the theme = Waste of resources!!
2 - Use templates as templates and not as themes.

The templates provided in default theme should not make use of xoImgUrl (requires $xoTheme). This is a core bug.

10
jimmyx
Re: strange problem in admin panel redirection
  • 2010/2/13 2:20

  • jimmyx

  • Quite a regular

  • Posts: 338

  • Since: 2007/7/18


why can templates and themes have the same variables ?