0
Welcome Guest!
Login
0
items
Join Now
Login
Join Now
Search
Home
Grav
Themes
Joomla!
Templates
Extensions
WordPress
Themes
Plugins
Docs
Forum
Perks
Index
Recent Topics
Rules
Search Forum
Premier Support
ROCKETTHEME IS CLOSING ON JUNE 30, 2025.
As a thank-you to our community, enjoy
50% off all themes
with the promo code
THANKYOU
before we shut down. Read our
Farewell Blog Post
for more details.
You are here:
Forum
General
The Water Cooler
Topic
Mootools from Google
Last Post
Search Topic
asink3
Newbie
Posts:
2
Thanks:
0
Mootools from Google
Posted 13 years 10 months ago
I tried to access mootools from the google library to speed up joomla using the gantry frameowork new feature capability. No luck with the following code. - Any thoughts?
<?php
02./**
03. * @package gantry
04. * @subpackage features
05. * @version @VERSION@ @BUILD_DATE@
06. * @author RocketTheme
www.rockettheme.com
07. * @copyright Copyright (C) 2007 - @COPYRIGHT_YEAR@ RocketTheme, LLC
08. * @license
www.gnu.org/licenses/gpl-2.0.html
GNU/GPLv2 only
09. *
10. * Gantry uses the Joomla Framework (
www.joomla.org
), a GNU/GPLv2 content management system
11. *
12. */
13.
14.defined('JPATH_BASE') or die();
15.
16.gantry_import('core.gantryfeature');
17.
18./**
19. * @package gantry
20. * @subpackage features
21. */
22.class GantryFeatureMoo12 extends GantryFeature {
23. var $_feature_name = 'moo12';
24.
25. function isEnabled(){
26. return true;
27. }
28.
29. function isInPosition($position) {
30. return false;
31. }
32.
33. function isOrderable(){
34. return false;
35. }
36.
37. function init() {
38. global $gantry;
39.
40. $doc =& $gantry->document;
41.
42. JHTML::_( 'behavior.mootools' );
43.
44. //remove default mootools from default includes
45. $oldmoo = JURI::root(true) .'/media/system/js/mootools.js';
46. $newmoo = $gantry->Url.'
ajax.googleapis.com/ajax/libs/mootools/1...ls-yui-compressed.js
';
47.
48. $a = array();
49. foreach ($doc->_scripts as $k => $v) {
50. if ($k == $oldmoo) { $a[$newmoo] = $v; }
51. else { $a[$k] = $v; }
52. }
53. $doc->_scripts = $a;
54. }
55.
56.}
#691887
Time to create page: 0.065 seconds
Powered by
Kunena Forum