Extension Framework

Extensions / Customization for JoomLeague 1.6.
And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Extension Framework

Postby And_One » Sun Jan 31, 2010 1:14 am

I made some changes/improvements to the standard Joomleague extension Framework:

changed css/js include

Standard Joomleague Includes:
1. include assets/css/joomleague.css
2. include assets/css/.css
3. include assets/js/joomleague.js
4. include assets/js/.js

Standard Extension Includes:
5. include

Code: Select all

/extensions/<extensionname>/assets/css/<filename>.css

6. include

Code: Select all

/extensions/<extensionname>/assets/js/<filename>.js


Overrides for the Standard Includes:

7. include

Code: Select all

/extensions/<extensionname>/assets/css/<filename>.css

8. include

Code: Select all

/extensions/<extensionname>/assets/js/<filename>.css


changes are made in JLGView.php

Language Overrides:

Frontend:

Code: Select all

components/com_joomleague/extensions/<extensionname>/language/en-GB/en-GB.com_joomleague_<extensionname>.ini


Backend:

Code: Select all

components/com_joomleague/extensions/<extensionname>/admin/language/en-GB/en-GB.com_joomleague_<extensionname>.ini


Any other Feature Requests to the Extension Framework?
Joomla 1.5.x
Joomleague 1.6 Final
Working on Joomleague 2.0
[url=http://forum.joomleague.net/viewforum.php?f=109]Joomleague 1.6 Extended Data Editor[/url]
[url=https://opentranslators.transifex.com]
[img]https://ds0k0en9abmn1.cloudfront.net/static/widgets/images/transifex-userbar.1d82cbde2ade.png[/img]
[/url]

User avatar
teddy
.
Posts: 304
Joined: Wed Feb 28, 2007 12:01 pm

Re:Extension Framework

Postby teddy » Mon Feb 01, 2010 11:36 am

I guess this post is aimed to testers as well, so I'm asking this to overcome a low level of comprehension of the work you've done (low in comprehension, but high in appreciation!!), please pardon my ignorance:
what are the extensions exactly supposed to do?
would you include an example extension for us to tinker with and maybe give suggestions?
Joomla 1.5.22
Joomleague 1.5.1

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re:Extension Framework

Postby And_One » Mon Feb 01, 2010 1:10 pm

Extensions in JL1.5 are aimed to be the next level of how to customize Joomleague. My goal is that noone have to edit Joomleague original files if he wants to integrate Joomleague output into his own Page Design. Joomleague 1.5 brings us a standard design (a bit ugly at the moment ;)) and the great possibilty to customize it with css and template changes, so that it can fit into a custom webpage design. the old way was to edit the Joomleague, let me call it "core" files. Everone changed the css files, the template files and so on. With this changes it is now possible to overwrite or extend extisting css classes and also the standard template files.

if you want to customize the look and feel of a specific view, you can simply create an

Code: Select all

/extensions/<extensionname>/assets/css/<filename>.css
. this css file will be included in the html after all standard includes. but don´t forget to assign the extension to the current project!
Joomla 1.5.x
Joomleague 1.6 Final
Working on Joomleague 2.0
[url=http://forum.joomleague.net/viewforum.php?f=109]Joomleague 1.6 Extended Data Editor[/url]
[url=https://opentranslators.transifex.com]
[img]https://ds0k0en9abmn1.cloudfront.net/static/widgets/images/transifex-userbar.1d82cbde2ade.png[/img]
[/url]

User avatar
teddy
.
Posts: 304
Joined: Wed Feb 28, 2007 12:01 pm

Re:Extension Framework

Postby teddy » Mon Mar 01, 2010 1:59 pm

Astonishing work, thanks!!!
It gives the Joomla overrides power to Joomleague, in other words you can customize completely each league's appearence!
There's no comparable sport product doing this!
I'm still testing it and I didn't discover all the endless possibilities it gives...
Joomla 1.5.22
Joomleague 1.5.1

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re:Extension Framework

Postby And_One » Sat Mar 06, 2010 2:44 pm

i found out that in the codebase extension settings were left to be in a folder called "config_xml". thats "bad" and inconsistent and i will refactor this to the new "/settings" path to be consistent with the latest templates settings changes.

*edit*

svn up2date!
Last edited by And_One on Sat Mar 06, 2010 4:51 pm, edited 1 time in total.
Joomla 1.5.x
Joomleague 1.6 Final
Working on Joomleague 2.0
[url=http://forum.joomleague.net/viewforum.php?f=109]Joomleague 1.6 Extended Data Editor[/url]
[url=https://opentranslators.transifex.com]
[img]https://ds0k0en9abmn1.cloudfront.net/static/widgets/images/transifex-userbar.1d82cbde2ade.png[/img]
[/url]

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re:Extension Framework

Postby And_One » Tue Mar 23, 2010 2:49 pm

question for us all: has anyone build an extension based on the "new" framework?
Joomla 1.5.x
Joomleague 1.6 Final
Working on Joomleague 2.0
[url=http://forum.joomleague.net/viewforum.php?f=109]Joomleague 1.6 Extended Data Editor[/url]
[url=https://opentranslators.transifex.com]
[img]https://ds0k0en9abmn1.cloudfront.net/static/widgets/images/transifex-userbar.1d82cbde2ade.png[/img]
[/url]

User avatar
trfc
Donator
Donator
Posts: 267
Joined: Sun Jan 03, 2010 12:58 pm
Location: Taunton, UK
Contact:

Re:Extension Framework

Postby trfc » Fri Apr 02, 2010 1:19 pm

I have an extension running on Rev 5228 is that's what you mean...
Joomla Version 2.5.4
Testing JL 2.0

http://twitter.com/tauntonrfc
http://facebook.com/tauntonrfc

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re:Extension Framework

Postby And_One » Fri Apr 02, 2010 1:52 pm

would you like to share this as sample?
Joomla 1.5.x
Joomleague 1.6 Final
Working on Joomleague 2.0
[url=http://forum.joomleague.net/viewforum.php?f=109]Joomleague 1.6 Extended Data Editor[/url]
[url=https://opentranslators.transifex.com]
[img]https://ds0k0en9abmn1.cloudfront.net/static/widgets/images/transifex-userbar.1d82cbde2ade.png[/img]
[/url]

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: Extension Framework

Postby julienV » Wed May 12, 2010 10:04 am

Hi all,

I am in the process of enhancing yet again the extension framework (thanks and_one for your work on css and js, this was a missing part indeed).

I created a JLGModel that inherits from JModel.
In it, i changed the getInstance function so that when require a model 'name', it will try to find 'nameMyextension' class in the models of the extension.

This way, we will be able to create models in extension that inherits the one from the core, which is a lot better than having to plain copy the whole model: we can then modify/adapt only the class function needed !

here is an exemple of admin match model for a cricket extension

Code: Select all

(com_joomleague/extensions/cricket/admin/models/match.php
)

Code: Select all

<?php
/**
 * @copyright    Copyright (C) 2006-2009 Joomleague.de. All rights reserved.
 * @license        GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );

require_once ( JLG_PATH_ADMIN . DS . 'models' . DS . 'match.php' );

class JoomleagueModelMatchCricket extends JoomleagueModelMatch
{        
    var $_name 
= 'match'; // necessary because of getName()
    
    
// function save_array changed for date per match and period results
    function save_array( $cid = null, $post = null, $usecidpostfix = false, $project_id )
    {
 ............
         }
 


I modified jlgview to work the same, so, same thing, the view name class must be the core one + extension.

here is a dummy example

Code: Select all

<?php
/**
 * @copyright    Copyright (C) 2006-2009 Joomleague.de. All rights reserved.
 * @license        GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// Check to ensure this file is included in Joomla!
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );

require_once ( JLG_PATH_ADMIN . DS . 'views' . DS . 'matches' . DS . 'view.html.php' );

/**
 * overrides JoomleagueViewMatches View class 
 *
 */
class JoomleagueViewMatchesCricket extends JoomleagueViewMatches
{
    var $_name = 'matches'; // needed so that getName works as expected
    
    function display
( $tpl = null )
    {
        $mainframe    =& JFactory::getApplication();

        if ( $this->getLayout() == 'default' )
        {
            $this->_displayDefault( $tpl );
            return;
        }

        parent::display( $tpl );
    }
}
 


I expect to push this today or tomorrow
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: Extension Framework

Postby julienV » Wed May 12, 2010 6:14 pm

pushed !
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension Framework

Postby And_One » Tue Aug 24, 2010 4:34 pm

Edited my posts to make to more clear what needs to be done to build a joomleague extension with overrides.

mikescho24
Newbie
Posts: 2
Joined: Mon Jul 26, 2010 10:13 am

Re: Extension Framework

Postby mikescho24 » Sat Aug 28, 2010 3:38 pm

You do not have the required permissions to view the files attached to this post.

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: Extension Framework

Postby timoline » Sat Aug 28, 2010 5:37 pm



yeah, great
i really like your new roster view, maybe we could implement as default...

thx

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension Framework

Postby And_One » Sat Aug 28, 2010 6:02 pm

yeah great site, congratulations!

thank you very much for sharing us the extension code as example!

it would be really nice if you can share your development experience with joomleague 1.5. give us feedback, doesn´t matter if its good or bad! ;)

mikescho24
Newbie
Posts: 2
Joined: Mon Jul 26, 2010 10:13 am

Re: Extension Framework

Postby mikescho24 » Mon Aug 30, 2010 10:57 am

Ich mach mal auf Deutsch ;). Also das Extension Framework ist ziemlich leicht zu verstehen und man sehr gut damit arbeiten, wenn man es einmal Verstanden hat. Ich hab auch keine großen Konflikte feststellen können. Außer das der Cache von Joomla/Joomleague manchmal daran gehindert hat, dass die Änderungen nicht direkt angezeigt wurden, sodass ich manchmal verzweifelt bin :bash: .

Den Code könnt ihr frei verwenden und wenn ihr wollt auch mit einfließen lassen in Joomleague 1.5. Aber das müsst ihr machen ich hab keine Ahnung von Git und bekommt das auch irgendwie nicht gebacken :confused:

Aber das Framwork ist :D zumal man auch admin dateien bearbeiten kann :cool:

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension Framework

Postby And_One » Mon Aug 30, 2010 10:59 am

thx for your feedback, mike!!

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension Framework

Postby And_One » Sun Sep 05, 2010 1:16 am

reworked the extension include mechanism. every existing extension is now included per default. if you dont want an extension to be included is it possible to configure it on the project settings page. you can select multiple extensions to be excluded. pls take care that all configured extension bevore this update are now on the exclude list!

here is a sql statement to remove existing extensions from every projects exclude list.
[syntax="sql"]
update `jos_joomleague_project` set extension = null
[/syntax]

User avatar
Kurt
Donator
Donator
Posts: 932
Joined: Mon Mar 19, 2007 7:40 pm
Location: Germany
Contact:

Re: Extension Framework

Postby Kurt » Sun Sep 05, 2010 7:21 am

And_One wrote:reworked the extension include mechanism. every existing extension is now included per default. if you dont want an extension to be included is it possible to configure it on the project settings page. you can select multiple extensions to be excluded. pls take care that all configured extension bevore this update are now on the exclude list!

here is a sql statement to remove existing extensions from every projects exclude list.
[syntax="sql"]
update `jos_joomleague_project` set extension = null
[/syntax]


Shouldn't we also set

Code: Select all

`extension` VARCHAR(80) NOT NULL DEFAULT 'default' ,

to

Code: Select all

`extension` VARCHAR(80) NULL DEFAULT NULL ,

inside the install-sql-file for `#__joomleague_project` too???

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension Framework

Postby And_One » Mon Sep 06, 2010 6:35 am

yes!

User avatar
Kurt
Donator
Donator
Posts: 932
Joined: Mon Mar 19, 2007 7:40 pm
Location: Germany
Contact:

Re: Extension Framework

Postby Kurt » Mon Sep 06, 2010 5:07 pm

Kurt wrote:Shouldn't we also set

Code: Select all

`extension` VARCHAR(80) NOT NULL DEFAULT 'default' ,

to

Code: Select all

`extension` VARCHAR(80) NULL DEFAULT NULL ,

inside the install-sql-file for `#__joomleague_project` too???


Done...

But also needs to be adapted inside import and upgrade

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: Extension Framework

Postby timoline » Sun Sep 12, 2010 5:15 pm

on git I created an extra folder extensions.
Here we can put some extensions :whistling:
I added a new roster based on the work of mikescho24 (thx for the example)
Its just an example....what you can with extensions ;)

Just copy the "new roster" folder to the correct extensions folder.....et voila

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: Extension Framework

Postby julienV » Mon Sep 13, 2010 11:08 am

I am not really sure about the 'include all' by default, because extension can be not compatible together and/or override the same thing.
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: Extension Framework

Postby julienV » Mon Sep 13, 2010 11:15 am

and it leads to some issue: for now, the ranking ovveride, doens't work,
the models/templates.php checklist function neither... and i JUST started to look at it :{
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: Extension Framework

Postby julienV » Mon Sep 13, 2010 11:18 am

in admin.joomleague.php:

Code: Select all

$extension = JoomleagueHelper::getExtension();
if (!empty($extension))
{
   DEFINE ('JLG_EXTENSION', $extension);
   DEFINE ('JLGPATH_EXTENSION', JPATH_COMPONENT_SITE . DS . 'extensions' . DS . $extension);
   DEFINE ('JLGPATH_EXTENSION_ADMIN', JLGPATH_EXTENSION . DS . 'admin');
   $path = JLGPATH_EXTENSION_ADMIN . DS . 'controllers' . DS . $controller . '.php';
   if ( file_exists( $path ) )
   {
      require_once $path;
      if (class_exists($controller.ucfirst($extension))) {
         $classname = $controller.ucfirst($extension);
      }
   }
   // language file
   $lang = &JFactory::getLanguage();
   $lang->load('com_joomleague_'.$extension, JLGPATH_EXTENSION_ADMIN);
}


all of this doesn't work as expected any more either... seriously, this should have been implemented first on a development branch and better implemented/tested
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension Framework

Postby And_One » Mon Sep 13, 2010 12:02 pm

i have already prepared some improvements which will fix some issues i found but unfortunately not commitet yet (80% finished). i think i will commit it this week after a short testing phase.

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: Extension Framework

Postby timoline » Sun Sep 19, 2010 11:09 am

I created a wiki for the extension framework

http://wiki.joomleague.at/doku.php?id=faq:framework

Can you guys help to improve it?
thx

User avatar
zeta65
.
Posts: 965
Joined: Fri Aug 10, 2007 4:40 pm
Location: Italia
Contact:

Re: Extension Framework

Postby zeta65 » Sat Oct 02, 2010 3:57 pm

deleted. Now I know :p
website: www.uscosio.org
joomla vers.: Joomla 1.5.x
joomleague vers.:Joomleague 1.5 (latest git build)

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension Framework

Postby And_One » Wed Nov 24, 2010 6:32 pm

updated the wiki article with frontend settings.

User avatar
diddipoeler
.
Posts: 1151
Joined: Sun Feb 04, 2007 3:29 pm
Joomleague version: 2.0.x
Contact:

Re: Extension Framework

Postby diddipoeler » Thu Aug 04, 2011 9:53 am

hallo,

ich bekomme keinen menüeintrag zu sehen :(
wenn ich eine extension baue, dann möchte ich auch einen menüeintrag generieren.
rufe ich aber unter einem menü, den punkt neuen menüeintrag auf, und klicke
dann auf joomleague erscheinen keine menüeinträge aus dem extension ordner :(

die verzeichnisstruktur, frontend, ist ja diese:
components/com_joomleague/extensions/<extensionname>/views/<extensionname>/
in diesem verzeichnis befindet sich die datei: metadata.xml
components/com_joomleague/extensions/<extensionname>/views/<extensionname>/tmpl/
in diesem verzeichnis befindet sich dann die datei: default.xml
die einträge aus dieser datei müssten eigentlich als menüpunkt erscheinen.
tun sie aber nicht :(

ist das ein neuer bug oder wurde es nur vergessen zu programmieren ?
oder muss man in irgendeiner datei etwas anderes mitgeben ?
über 8 Mio. Spielpaarungen auf http://www.laola-fussball-international.de/
über 8 Mio. Spielpaarungen auf http://www.**************.de/
Joomlaversion: 1.5.26
Testserver mit Joomleague Version 0.93
Tippspieltestseite: http://joomleague16.**************/
Das Komplettpaket: https://github.com/diddipoeler/joomleague-komplett
Das Komplettpaket 2.0: https://github.com/diddipoeler/joomleague-2-komplettpaket

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension Framework

Postby And_One » Thu Aug 04, 2011 10:04 am

diddipoeler wrote:hallo,

ich bekomme keinen menüeintrag zu sehen :(
wenn ich eine extension baue, dann möchte ich auch einen menüeintrag generieren.
rufe ich aber unter einem menü, den punkt neuen menüeintrag auf, und klicke
dann auf joomleague erscheinen keine menüeinträge aus dem extension ordner :(

die verzeichnisstruktur, frontend, ist ja diese:
components/com_joomleague/extensions/<extensionname>/views/<extensionname>/
in diesem verzeichnis befindet sich die datei: metadata.xml
components/com_joomleague/extensions/<extensionname>/views/<extensionname>/tmpl/
in diesem verzeichnis befindet sich dann die datei: default.xml
die einträge aus dieser datei müssten eigentlich als menüpunkt erscheinen.
tun sie aber nicht :(

ist das ein neuer bug oder wurde es nur vergessen zu programmieren ?
oder muss man in irgendeiner datei etwas anderes mitgeben ?


ist ein bug im joomla, da nur der components/<component name>/views/<a view> ordner nach der metadata.xml durchsucht wird. wenn man eigene view ordner registriert nimmt joomla darauf keine rücksicht beim menütree aufbauen. daraus folgt, dass eine joomleague extension sich selber um das menü kümmern muss. vielleicht wird das ja mit joomla 1.7 besser, ...


Return to “Extensions / Customizations”

Who is online

Users browsing this forum: No registered users and 3 guests