How to override Moodle Core functionality? - moodle

I would like to override the core functionality in Moodle. Just like we did on Opencart by writing its XML. is there any way to do that, Because I don't want to touch the core functionality.

Related

How to use a RESTful API as ORM in CakePHP 3?

In CakePHP 1.x/2.x, it was fairly simple to have a model's data come from a REST API (as opposed to a relational database), by defining a custom datasource. (Neil Crookes' CakePHP-ReST-DataSource-Plugin was a great place to start.) Slap your custom datasource on your model, and you're making calls like $this->MyModel->find() just like you were querying a MySQL table called my_models.
I'm trying to figure out how to achieve this same effect under CakePHP 3.0. That is, make find()/save()/set()/get() calls against a Table/Entity driven by a REST API.
Since 3.0's ORM system is A) fairly new, and B) a rather large departure from the old way of doing things, I haven't found any information about how to do something like this. In fact, based on this SlideShare from
José Lorenzo Rodríguez, it sounds like it might not be possible.
This means:
not going to connect to stuff that is not a relational database.
Is there someone more familiar with CakePHP 3.0 that could clarify if what I'm looking for is possible under the new ORM system? If so, could you explain what classes you'd have to extend or implement to achieve such a function?
If you want to create a complete adapter for your Rest datasource using the interfaces and classes provided by CakePHP, take a look at this early experiment fro the CakePHP team on making a datasource for Elastic Search.
Elastic Search uses a Rest API and this plugin attempts to create classes that work similar to the CakePHP ORM:
https://github.com/cakephp/elastic-search
What it implements is basically the following:
A Type class that implements the RepositoryInterface
A Document class that implements the EntityInterface
A Query class that can be used as a collection object and has similar methods
In the near future it will provide a paginator adaptor and a form helper adaptor.
If you want to save yourself this trouble, because there for you there is little value in exposing your datasource as something ORM-like, you can just use guzzle or any similar library to interface with your API and use it as a service instead of a full-blown layer.
In the year since I asked this question, UseMuffin has built a Webservice plugin that purports to "bring [...] the power of the CakePHP ORM to your favourite webservices." This sounds like exactly what I wanted at the time.

Event Handling in Joomla Custom Component

I want to ask expert joomla devs out there, about event handling(dropdown values etc.) On how is it coded? In .NET(VB/C#) there is a custom event handler for every control in the User Interface during development (e.g button1_click). Any references?
There are aspects to this answer.
Firstly, I need to make sue that you are comparing .net web development with Joomla web development here. I would be surprised that every click on a .net control can be hooked into with a callback architecture, but then again I am not a .net developer.
Joomla has an event trigger system, which can be used in conjunction with Joomla plugins, see here: http://docs.joomla.org/Plugin/Events
On top of this, many more complex components define their own events, good examples are jEvents and jSeblod
This isn't built in the core of Joomla! and you would need to write some JavaScript/jQuery to handle this.
Alternatively, you could look at the likes of RS Forms which allows conditional displays for many field types.

Does there exist a PHP event observer framework

I'm looking to create a re-distributable PHP script and provide the ability to extend the application with plugins. The basic architecture should work just like magento.
Is there a PHP event / observer framework available ?
I would expect each framework to handle those events in their unique way. I've implemented observer / events through object-level callback hooks which can be multi-purpose and higher performance than the Spl Implementation.

jqGrid vs. Html.Grid Helper

I have been using jqGrid as my grid view to my data for some time now. It works well and it was easy to implement into my solution. However, due to some refactoring going on within the project right now, I have been looking into it again.
The project itself is built around ASP.NET MVC 2 (.NET 4.0). We need some extra functionality such as:
Being able to add columns.
Inline editing of columns.
Sorting
Filter
Paging
Searching
jqGrid does all of this (although, not all of this functionality is implemented yet - some of it is new based on new needs). But, given that I am using ASP.NET MVC, I was wondering if it would make more sense to switch to the Html.Grid helper. It looks just as easy to implement for the things I know it can do (Sorting/Filtering/Paging), but I do not know if it can even do the other tasks (in a fairly straightforward manner) - anything I have found seems somewhat "hackish."
Can anybody enlighten me on A.) the capabilities of Html.Grid to jqGrid and B.) if there is any reason I'd want to take Html.Grid.
I use jqGrid successfully with ASP.NET MVC 2 (.NET 4.0) and have all the features which you describe in your question. Moreover all pages having jqGrid looks like very simple.
I don't use Html.Grid or any MVC controls. I include just pure HTML fragment <table id="list"></table><div id="pager"></div> on the page. Additionally I include the JavaScript which initialize the "list" table and the "pager" div as the jqGrid. So the implementation is independent from MVC concept. The most important part of the jqGrid integrations is the actions which get back pure JSON output and which implement GET/PUT/POST/DELETE operations with the jqGrid. You can read more about the approach here (see also many links with code examples included in the answer).
To be exactly I prefer to use WCF as a part on my ASP.NET MVC solution and the WCF methods provide the data needed for jqGrid (see here more details), but you can implement all as pure ASP.NET MVC actions.
If you use Unit testes for you ASP.NET MVC site you can successfully write tests for WFC methods or controller actions used by jqGrid. In the way you will test the most parts of jqGrid implementation.
After looking at both approach, I decided the jqGrid was a far easier (and simpler) approach for what I was attempting to do.

create a very specialised interface sugarcrm

I need a very specialized CRM
Do I
I want to recode the entire layout of sugar crm. whats the best way to start.
write a separate application and update SugarCRM via API calls
Can you be more specific about "very specialized CRM" ?
1.) You can customize all the field, drop down menus, layouts using the studio.
Check out:
http://developers.sugarcrm.com/docs/OS/6.1/-docs-Developer_Guides-Sugar_Developer_Guide_6.1.0-Chapter%204%20Customizing%20Sugar.html
Since you have decided to use SugarCRM don't develop UI outside SugarCRM. Since SugarCRM is very extensible and basicly every view in it can be replaced with any smarty tempalte/html page then there is no reason not to use it's functionalities especialy something like privilidges, home dashboards etc.
So my answer is go with SugarCRM customization.
If you are looking to re-write the whole MVC architecture of Sugar, I would write your own system based off a PHP MVC framework like Zend or CakePHP, if you are just looking to create specialized fields, and maybe tweak some layouts or something, I would recommend SugarCRM, because created fields and adding them to a basic 2 column form layout is quite simple. Even extending the current views is pretty easy if you have a solid grasp of OOPHP and the MVC architecture. Without knowing all your needs here, I'd be very surprised if you had to write a whole custom system. Almost Everything can be extended and customized in an upgrade safe way, which leaves you open to gaining the benefits of the new SugarCRM releases when they come out with out losing your custom enhancements.