Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $65.00
Net Balance: $61.80
Left to go: $38.20

Donations
studioC  ($25)May-17
Anonymous ($15)May-16
Anonymous ($25)May-4

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

2 2.5 2.5.5 2.6 3.0 2013 Abuse alimento AntiHarvesting AntiMalUser AntiSpam API Beats billige black block Blocking Blocks blue Captcha cell Christmas chronolabs content Conversion demo Dictionary docek download Dresses editor Elastic evden eve facebook floor forms framework free herre Honeypot Human Hymn instant-zero IP jQuery kantor Karaoke lamps Load log logger mobile module modules Monster MyAlbum-p nakliyat newbb news online PageRank Permissions pink Plugin pollos portal Prevention profile project Protector publisher REST Rights rmcommon Room sale security Server site Smarty Spam SQL stem StopForumSpam Studio tag tags tdmcreate Theme themes Transaction userlog website Whitepaper Wishcraft XFriendica xoops Xortify ZendFramework

New Users

Registering user

# 136015

handrick12

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post



#1 Posted on: 2009/10/20 6:31 adding jquery in admin <head>
hi is there a way to add the jquery.js file in the head of admin when loading a module admin section? like the one used in frontend to load scripts from frameworks folder (browse.php).

I would like to load jquery but in the head of the admin html code not just anywhere.

Thanks

Top

kerkyra
Just can't stay away
Just can't stay away
Joined:
2005/2/14 15:55
From Athens
Group:
Registered Users
Posts: 535
(Show More) (Show Less)


#2 Posted on: 2009/10/21 4:11 Re: adding jquery in admin <head>
bump?

Top

kerkyra
Just can't stay away
Just can't stay away
Joined:
2005/2/14 15:55
From Athens
Group:
Registered Users
Posts: 535
(Show More) (Show Less)


#3 Posted on: 2009/10/21 8:09 Re: adding jquery in admin <head>
$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');// use browse.php to access xoops_lib folder
$xoTheme->addScript('modules/yourmodule/js/yourscript.js');// you can use full path or path relative to root


Use this after including xoops_cp_header();
and before including xoops_cp_footer();

Top

trabis
Core Developer
Core Developer
Joined:
2006/9/1 13:10
From Portugal
Group:
Registered Users
Webmaster
Posts: 2198
(Show More) (Show Less)


#4 Posted on: 2009/10/22 3:33 Re: adding jquery in admin <head>
I already tried that mate! i'm using a function to show the admin side. I set $xoTheme as global and then try that line of code that you suggested. all i get is this error!

Fatal error: Call to a member function addScript()

Not sure how to get the instance of $xoTheme. Is it set in admin area? Do i have to initiate it? I'm using XOOPS 2.3.3. Thanks for the help mate.

Top

kerkyra
Just can't stay away
Just can't stay away
Joined:
2005/2/14 15:55
From Athens
Group:
Registered Users
Posts: 535
(Show More) (Show Less)


#5 Posted on: 2009/10/22 7:50 Re: adding jquery in admin <head>
You should move this topic to 2.3 support.

There is no way to add scripts into 2.3 admin header, sorry.

Top

trabis
Core Developer
Core Developer
Joined:
2006/9/1 13:10
From Portugal
Group:
Registered Users
Webmaster
Posts: 2198
(Show More) (Show Less)


#6 Posted on: 2009/10/22 7:57 Re: adding jquery in admin <head>
Simply type :
echo "<script type="text/javascript" src="http://www.example.org/myscript.js"></script>";


It does not change anything to call it from the head or from the "bottom".
Yahoo even advice to call JS scripts in the bottom of the pages ...

Top

hervet
Friend of XOOPS
Friend of XOOPS
Joined:
2003/11/4 7:49
From France
Group:
Registered Users
Posts: 1948
(Show More) (Show Less)


#7 Posted on: 2009/10/23 1:34 Re: adding jquery in admin <head>
Quote:
You should move this topic to 2.3 support.


Done

Top

sailjapan
Moderator
Moderator
Joined:
2005/11/16 5:27
From Osaka
Group:
Registered Users
Posts: 1667
(Show More) (Show Less)


#8 Posted on: 2009/10/23 3:26 Re: adding jquery in admin <head>
actually it was my mistake! the version is 2.4.0 RC in which i'm writing this module.

I guess i should just echo the script for the module to be compatible with 2.3..

but i would also like to know how this could be done in 2.4 and why the $xoTheme didnt work.
Quote:

It does not change anything to call it from the head or from the "bottom".
Yahoo even advice to call JS scripts in the bottom of the pages ...

@hervet : mate i just want the code to be tidy. If i echo the script then it will be echoed somewhere between the body tags and not in the head or the bottom. Thats why i'm asking this. I know its not important, its what i've done so far to make the code work. I was just wondering how this could be done differently.


Thanks for your answers and the help guys. Have a nice one.

Top

kerkyra
Just can't stay away
Just can't stay away
Joined:
2005/2/14 15:55
From Athens
Group:
Registered Users
Posts: 535
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]