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

Smith, John J.J.Smith at gcu.ac.uk
Wed Feb 20 19:16:13 GMT 2013


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


More information about the Xerte-dev mailing list