xoops forums

Burning

Theme Designer
Posted on: 2010/7/1 13:02
Burning
Burning (Show more)
Theme Designer
Posts: 1163
Since: 2006/8/22
#1

how to customize Admin redirection page ?

hi'

I'm trying to customize redirection page, the goal is to display same redirection page on front side (eg: when I log in) and on admin side (eg: when I submit a form).

I started to design the redirection page for front side, overrding tpl in www/my-theme/modules/system/system_redirect.html

I works fine, except on Admin side, redirection page is not changed. Override does not work. To modify it, I have to edit www/modules/system/system_redirect.html

Why not ? But, I have two little problems :
• I must write css properties directly in www/modules/system/system_redirect.html. I don't know how to call correctly a stylesheet from this file
• because of that, I'm not able to use this kind of instruction :
Quote:
background: url(wrapper-bg.gif) top right no-repeat;

... even if I put wrapper-bg.gif image into www/modules/system/


I someone know how to call an "external" stylesheet for redirection page (admin side) ?
I use EXM gui

Thanks in advance :)
Still learning CSS and... english

noo-b

Just can't stay away
Posted on: 2010/7/2 1:57
noo-b
noo-b (Show more)
Just can't stay away
Posts: 456
Since: 2007/10/23
#2

Re: how to customize Admin redirection page ?

in my site i have only 1 theme - i've deleted the zeta and default theme

i also have custom template for the redirect in my theme
mysite.com/themes/mytheme/modules/system/
i put my css here
mysite.com/themes/mytheme/css/style.css

in admin i use the paradigme theme.

in redirect i have the default redirect ..

when i check page info in firefox i can see that there is missing missing css/images which the browser trying to access at these following address

site.com/themes/default/modules/system
site.com/themes/default/css/


so i put the template and css in the two folders (since i deleted them... i have to recreate it)

and now i have the same redirect template user side and admin side
..weird....


is this a bug ?
I Love Xoops

Burning

Theme Designer
Posted on: 2010/7/6 20:53
Burning
Burning (Show more)
Theme Designer
Posts: 1163
Since: 2006/8/22
#3

Re: how to customize Admin redirection page ?

hi'

Thanks noo'b, nice shot !

I believe it is a bug
Still learning CSS and... english

ghia

Community Support Member
Posted on: 2010/7/6 22:38
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#4

Re: how to customize Admin redirection page ?

Quote:
in my site i have only 1 theme - i've deleted the zeta and default theme
It is not a good idea to delete the standard themes. They can come in very handy for debugging purposes.
Nevertheless other things should not be dependent on the presence of these themes and use the selected site wide theme of the preferences.

trabis

Core Developer
Posted on: 2010/9/8 20:03
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#5

Re: how to customize Admin redirection page ?

This should be fixed on 2.5

You can edit class/theme php and change:
function resourcePath($path)
    {
        if (
substr($path01) == '/') {
            
$path substr($path1);
        }

        if (
file_exists(XOOPS_ROOT_PATH "/{$this->themesPath}/{$this->folderName}/{$path}")) {
            return 
"{$this->themesPath}/{$this->folderName}/{$path}";
        }

        if (
file_exists(XOOPS_ROOT_PATH "/themes/{$this->folderName}/{$path}")) {
            return 
"themes/{$this->folderName}/{$path}";
        }
        return 
$path;
    }

jph000

Just popping in
Posted on: 2010/9/30 17:41
jph000
jph000 (Show more)
Just popping in
Posts: 60
Since: 2004/8/2 2
#6

Re: system_redirect theme template problem

trabis, thanks for the above posting regarding changing /class/theme.php because I had a similar problem which was quite frustrating over several days.

The template code in the default theme for:

/xoops/themes/default/modules/system/system_redirect.html

was not being used for redirects on logging in and out and other updates. I noticed this problem because the:

/xoops/themes/default/icons/ajax_indicator_01.gif

image was not being shown on the page, and the code for the page was what was in:

/xoops/modules/system/templates/system_redirect.html

instead.

What was even more puzzling was that the problem occurred on a new, fresh Xoops 2.4.5 installation. But the problem did NOT occur on an old Xoops site which I'd upgraded to 2.4.5.

I changed the code for function resourcePath in:

/xoops/class/theme.php

and the problem went away for the site, regardless of whether the default theme or a renamed copy of it was used. And finally the cache smarty_compile file:

/xoops_data/caches/smarty_compile/http%25253A%25252F%25252F192.168.1.100%25252F%25257Ejp%25252Fxoops%2525%2525system-default-default%5E%25%25F6%5EF69%5EF692B736%25%25db%253Asystem_redirect.html.php

was correct, that is, it used the template code with ajax_indicator_01.gif.

However, I am still puzzled, since after I reverted the theme.php file and reloaded the System module, the problem did NOT occur again.

My test sites are using:

XOOPS Version XOOPS 2.4.5
PHP Version 5.3.2-1ubuntu4.5
mySQL Version 5.1.41-3ubuntu12.6

One other note, the problem does not occur on an Xoops 2.4.5 beta site using XOOPS Version XOOPS 2.4.5 beta, PHP Version 5.2.14, mySQL Version 5.1.39-log.

Anonymous

Posted on: 2010/9/30 21:38
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#7

Re: how to customize Admin redirection page ?

I handle the same problem but I cann't fix it. The change in /xoops/class/theme.php is not working or me.

It is very annoying....

XOOPS Versie XOOPS 2.4.5 (upgraded)
PHP Versie 5.2.10
MySQL Versie 5.0.77

mboyden

Moderator
Posted on: 2010/11/10 18:15
mboyden
mboyden (Show more)
Moderator
Posts: 484
Since: 2005/3/9 1
#8

Re: How to Customize Templates in Themes

I found this topic while I was trying to figure out how to do custom templates for the system_redirect.html template.

Short story:

To use custom templates in a theme (<xoops>/themes/mytheme/modules/<modname>/<template_name.html>), you must set the template set to Default in the System General Preferences. If using custom templates, theme templates will never be used.

The code for selecting templates is in <xoops>/class/smarty/xoops_plugins/resource.db.php in the function smarty_resource_db_tplinfo and the logic for retrieving a template generally goes like this:
1. If custom template set selected, see if template exists in that set, if it does, return it; else
2. Retrieve the template from the Default set from the database,
3. If the template doesn't exist in the Default set, return false; else
4. Check if template exists in current theme, if not, use the one found in the module templates directory
5. If that doesn't exist, use the one found in the Default set.

I would think that theme templates should over-ride database/file templates no matter what is set as a template set in the preferences. I would suggest logic more like this:

1. If exists, use theme template; else
2. If selected and exists, use template from custom theme set; else
3. If exists, use template from Default theme set; else
4. If exists, use template from module templates directory; else
5. Return false (failure)

Finally, the class/theme.php resourcePath function referenced in this thread won't deal with $path values that start with a full URL starting with http or https (other than pass it back as is), nor does it use the theme-defined template on the admin side (although I don't personally want it to do so for a number of reasons).

XOOPS 2.4.5 on PHP 5.2.14 running CentOS 5.5 with cPanel (Linux 2.6.18-028stab070.2-ent)
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development