How to edit moodle core files with plugins? - php

I was trying to make some features inside my version of Moodle but that requires to alter or edit the core files or add new functions to the core files and for sure if I tried to upgrade my version all edits will be gone so I was trying to create a plugin for this edits but couldn't find any how to do it .. and most of the documents for older version .. so my question now is how to modify core files with a plugin?
Thanks

how to modify core files with a plugin
You cannot do it directly, but you may use the CustomScripts functionality to substitute executable files with your own

Related

How to add functionality in payroll plugin of OrangeHrm?

I have made a "Payroll" module and the functionality of that module also made with php files but I need to integrate that php files into orange hrm. so now here the problem comes for because I can't understand where to start in orangehrm to integrate it. I know start from index.php after that edit where to get my module withing the footer and header of the OrangeHRM.
And can anyone explain me to find the path of this line
orangehrm is based in symfony (framework MVC), if you wanna add a module, need:
create a folder in (symfony\plugins...)
enable the plugin in setting.yml (\apps\orangehrm\config\setting.yml)
add the module in databases ( use phpmyadmin for this)
add the module in lib
logout, delete cache and login back.
this is way for 3.1 versions. That version of the software you are using?

What is use of /app/code/local/ folder in magento ? Can we put our core php file in it?

I am developing mobile application for existing magento website and the mobile application has its own web admin and web admin developed in core php (not in magento). Can we put the core php web admin code to magento /app/code/local/ folder ? and is it work with magento ?
Please help me on this.
We can consider Magento as an application that is constituted by modules. Each of this module does different functionalities, but still they are independent to each other. This property makes Magento highly extendable and powerful.
By default, Magento comes with lot of such individual modules. These modules are located inside app/code/core. Note that, this folder only holds Model and Controller logic parts. View logics are separated from this and it normally lies in app/design and skin folders.
If you need to extend Magento core functionality or if you need to add any new functionality, you have two options available.
Use an extension
Develop your own custom modules
For extension/pluggin, Magento uses app/code/community directory. This way core modules are seperated from extensions and it gives us lot of flexibility.
When you use your own modules to add any functionality, you probably need to add your module in app/code/local. This way, custom modules are seperated from both core and extensions.
When Magento looks for a module, it will first check that module in local directory. If it is not there, then it will check in community directory. If it is not there, again it will check in core directory. Finally it will check it in lib directory. This callback mechanism is the core concept that you need to understand , before start to develop your own extensions.
It is not necessary to put your custom module in app/code/local directory. You can put it in community or in core directory. This is because, the callback mechanism can pick up your module, irrespective of these three locations. However as I said earlier, three of this directories has its own purpose. So better use them properly as it demands.
Hope that makes lot of sense
From Magento Wiki,
Every custom module will be created in the directory:
/app/code/local
And this is the directory structure that you use to create one:
/app/code/local/<Namespace>/<Module>/
That way, we can have multiple modules under a single namespace.
Naresh, /app/code/local/ is used to put your custom developed plugin/extension for magento. it's main aim to have custom developed code and core code separate.
If in future you upgrade the version of magento than it overwrite/delete the code written in /app/code/core/ but leave the code as it is in /app/code/local/ and it's place where you can override the core block/helper/model as well.
you can't copy your code directly in to core, you have to create module/plugin to club your existing code with magento.

How to add a menu item in admin console - [OPEN CART] [Best practice]

How should I be doing the following
- adding new form fields to the product edit page
- adding a new menu item to the admin console main menu
Are there any hooks that can be called from my extension?
Or
Should I be editing the core files itself to add this functionality?
OpenCart is not a Wordpress and has no hooks You could use to Your purpose, nor it has no events nor event listeners that could be used as well.
When implementing some functionality for OpenCart for long time we only had the possibility to edit the core files directly which led to work lost when we updated to newer version, also installing plugins/extensions modifying core files was possible only in way open file A, go to line XYZ and place this code there. Then go to file B ....
In past few years we have a possibility to use vQmod which was improved rapidly and using this You are possible to inject Your new code into existing core files and remove or modify some of the source code in the core files with the certainty Your changes are not lost after the update to a newer version. Of course, Your extension may stop working but it is a lot easier just to modify the changes in XML file then to re-implement all the lost work again (and again).
Similar to vQmod there is also some Override Engine that should also help You to implement extensions apart from OC's core files but I haven't tried it yet.

NetBeans intellisense and tapping into WordPress API

I'm working with WordPress within my project. and I'm using the Netbeans 7.3.1
WordPress has a ton of includes... and the current file I'm working on ( functions.php) cannot know which other files are involved. So, when I type in say $is_IE ( which is a global) or wp_register_nav which is a wordpress function), because they are not defined within the context of the current functions.php, it cannot give me intelisense support.
In this case, what do we do?
Is there a way in NetBeans which allows me to point to a few specific PHP files in my project so that NetBeans would know about the functions and constants defined in those files and hence, it can extend its intellisense support? - just like it does to native PHP functions, even those those functions are not within the current file.
Is it possible?
You can use WordPress native functions and objects in external files on the same webserver by requiring wp_load.php in your header. Just add this at the top:
require_once('relative/path/to/wp-load.php');
Edit: Just realized I read your question completely wrong. This link details how to add intellisense support for your Wordpress project. There is also a WordPress plugin for Netbeans that may do what you want.
I also know there is a plugin for Sublime Text for WordPress snippets and autocompletions - you can find it here on Github.

Edit system extensions in TYPO3

I am using the felogin system extensions. Those extensions are part of the default TYPO3 installation and they are stored in typo3/sysext. I know that I can edit them by editing its code directly but I guess it is not the best way of doing it.
How can I "overwrite" those extensions without changing their code?
Shall I create a new custom plugin and copy & paste code of a system plugin I wish to alter?
You could just modify the extension and place a copy in typo3conf/ext/. This directory (so called "local extensions") override the system extensions.
However, you will probably run into trouble when you want to upgrade TYPO3.
Did you find a bug, if so, please report it. If you know, how to fix, then it would be great, if you would push the change into the review system
If you just want to change functionality, modifying existing code is not a really could solution. There's the concept of hooks (which is a clean one) and of XLCASSes, which is somehow dirty (as it can also cause trouble with newer TYPO3 versions). So basically the same as with every other extension.
Steffen

Categories