[Xerte-dev] Re: Using Wordpress code in XOT

Smith, John J.J.Smith at gcu.ac.uk
Thu Feb 21 08:09:45 GMT 2013


Oh and i meant to say that wordpress files are really fragmented too - i'd say more than yours Pat although you could say the structure is better in Wordpress but that's evolved over a lot more versions...

I know what you mean about everything going through index though but the action and filter hooks are spread throughout all the includes so we in comparison have less files to hook - the do_action needs to be in the function doing the work so it shouldn't really matter where it is as long as we know where and hoe to use it...

I think we need to look at the terminology though as we have so many different terms - LOs, modules, projects, templates, pods, and now potentially plugins and possibly widgets (although would/should that replace pods) and would we then want themes????

Regards

John Smith
Learning Technologist
School of Health and Life Sciences

Sent from Samsung Galaxy SII



"Pat @ Pgogy" <xerte at pgogywebstuff.com> wrote:


Hello,

I think the Wordpress hooks work better as all Wordpress code goes through one file, whereas XOT code is more fragmented (I blame the developer)

For example all Ajax could go through one file - and then it feels a bit neater?

I'd also need to look at modules as well.

Filters work ok as long as code is returned, but most XOT is echoed.

I think if you include the licence for the file intact it is fine.

Would still like to think a bit architecturally though

Pgogy Webstuff - http://www.pgogywebstuff.com
Makers of web things of a fair to middling quality

On 20 Feb 2013, at 19:16, "Smith, John" <J.J.Smith at gcu.ac.uk> wrote:

> Hi
>
> I was concerned about the ajax stuff too but thinking about it, all you do is stick a do_action('TAG_TO_DESCRIBE_AJAX_CALL') in the php code that the ajax calls. This  could then be hooked...
>
> And with the filters you would just do apply_filters('FILTER_TAG', _translate('English to translate')); - i'm sure this isn't the function name and agree that it might be of little use anyway...
>
> Mostly the filters can be used to do various things like wrap code in extra markup or something like you've done with properties; you pass in an associative array of tabs, if the filter is hooked then you could augment it based on any condition...
>
> I've thought if another great use that i'd love to use and should now be relatively easy to do. We hook the save xml and load xml from the editor. On save we run it through a filter - the plungin adds in a new title page with the university/organisation logo and passes it back to be written to a file (possibly here we also do some stats for the api. Then we hook the load xml and pass through the read xml and remove the page with the logo so that it doesn't appear in the editor... Would be simple to implement now..
>
> Can we use the wordpress files like that under their license? They're very mature - would take us a while to write alternative similar functionality.
>
> Regards
>
> John Smith
> Learning Technologist
> School of Health and Life Sciences
>
> Sent from Samsung Galaxy SII
>
>
>
> "Pat @ Pgogy" <xerte at pgogywebstuff.com> wrote:
>
>
> Hi John
>
> Think it's great for index - just wondering what we do with the Ajax requests and the other stuff?
>
> The Wordpress action model is ok, but I am not sure if the filters translate as well.
>
> I think you could make every part of the site an api request?
>
> I think it'd make sense to think of architectures around this?
>
>
> Pgogy Webstuff - http://www.pgogywebstuff.com<http://www.pgogywebstuff.com/>
> Makers of web things of a fair to middling quality
>
> On 20 Feb 2013, at 15:24, "Smith, John" <J.J.Smith at gcu.ac.uk<mailto:J.J.Smith at gcu.ac.uk>> wrote:
>
> Hi Pat,
>
> Well I’ve started writing some code for the api, mainly helper functions to process the request formats and return formats as I’ve not fully though through what methods I’d want or yours… but then I was thinking about whether we could (and how we could) absorb the data within XOT too…
>
> Then I remembered a discussion I had with you (I think) about hooks and started writing some helpers (add_action/do_action etc) but obviously Wordpress already has that functionality. So I’ve instead included their whole plugins.php file…some plugin discovery and management code of my own and voila I have action and filter hooks all working in test and about 30 odd hook events wired up in my index.php file. Now I’m able to insert css/js into the head, change image urls, text (such as My Projects changed to Johnny’s Projects) within the page… but all from the plugin.
>
> Obviously we could write our own library but the Wordpress plugin.php is so polished that it works flawlessly with a minimum of new xerte code… Obviously it needs more work but it will allow us to add widgets (I’m currently playing with the Wordpress widgets.php file too) which could show api data. Obviously if we go forward with this (that’s my question really) then I’d be looking at the best fit with your recent code but I think if we can use the Wordpress files “as is” then it saves a lot of work ironing out issues…
>
> What do you think? Wasting my time or worth a go?
>
> Regards,
>
> John Smith
> Learning Technologist
> School of Health & Life Sciences
> Glasgow Caledonian University
>
> From: xerte-dev-bounces at lists.nottingham.ac.uk<mailto:xerte-dev-bounces at lists.nottingham.ac.uk> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Pat @ Pgogy
> Sent: Wednesday, February 20, 2013 2:17 PM
> To: For Xerte technical developers
> Subject: [Xerte-dev] Re: Using Wordpress code in XOT
>
> What kind of Wordpress file?
>
> Pgogy Webstuff - http://www.pgogywebstuff.com<http://www.pgogywebstuff.com/>
> Makers of web things of a fair to middling quality
>
> On 20 Feb 2013, at 12:31, "Smith, John" <J.J.Smith at gcu.ac.uk<mailto:J.J.Smith at gcu.ac.uk>> wrote:
> Please ignore last diagram sent… too many things going on in my head..
>
> My question, for Pat or Julian probably… if I wanted to use a Wordpress file (php) in XOT, would there be any license issues etc? can the file go in the SVN etc and be distributed with XOT or should there just be advice on where to get it from on Wordpress site?
>
> John
>
>
>
> Glasgow Caledonian University is a registered Scottish charity, number SC021474
>
> Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html
>
> Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html
>
>
> _______________________________________________
> Xerte-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk<mailto:Xerte-dev at lists.nottingham.ac.uk>
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
>
>
> Glasgow Caledonian University is a registered Scottish charity, number SC021474
>
> Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html
>
> Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html
> _______________________________________________
> Xerte-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk<mailto:Xerte-dev at lists.nottingham.ac.uk>
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
>
>
>
> Glasgow Caledonian University is a registered Scottish charity, number SC021474
>
> Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html
>
> Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html
> _______________________________________________
> Xerte-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev

_______________________________________________
Xerte-dev mailing list
Xerte-dev at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev

Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html


More information about the Xerte-dev mailing list