# New Functionality for Moodle E-Learning Platform: Files Communication by Chat Window
## 4 Approaching the Solution by Implementing the Newly Developed Plugin
Under Classes/Task, it mentions the scheduling task that is scheduled by default to run hourly; however, it can be configured from the site administration. Below is shown lib.php, the code that is injected on the message screen, to provide the loading functionality. The code for adding the multimedia message setting to site administration is described below in Algorithm 1. ```
<?php defined('MOODLE_INTERNAL') | | die(); if($ADMIN>fulltree) { } Ssettings = new admin_settingpage('local_mutiplefiles,'MultiMedia Message Settings'); Ssettings->add(new admin_setting_configtextarea('local_mimemessage/extension',' Allowed Extensions',' comma separated extension','.jpg.jpeg_png',PARAM_RAW )); Scurrentmaxbytes = get_config('local_mutiplefiles,'maxbytes'); if(isset($CFG->maxbytes)) {  Schoices = get_max_upload_sizes($CFG->maxbytes,0,0,$currentmaxbytes); } Ssettings->add(new admin_setting_configselect('local_mimemessage/maxbytes', new lang_string('maximumupload'),',key($choices),' ); Schoices ); //'Email Footer',PARAM_RAW)); SADMIN->add('root',$settings);
```  
**Algorithm 1**File upload process, managing upload size and allowed file extensions  
Below is the method and command line for the attached \"clip\" icon. Under lib.php, the following code is used for this and is described below in Algorithm 2. ```
$('<a href=\"#mutiplefilesmodal\" class=\"mutiplefileslinkbtnbtn-linkbtn-iconicon-size-3\" data-toggle=\"modal\" data-target=\"#mutiplefilesmodal\"><i class=\"fafa-paperclipfa-2x\" aria-hidden=\"true\"></i></a>? ).insertBefore('button[data-action=\"send-message\"],'{data-region=\"content-messages-footet-container\"});
```  
**Algorithm 2**Displaying the loading button (clip) and setting its shape The developed plugin must be imported into the Moodle database [23; 24]. The setting of the new solution for the site was done as follows: From site administration, plugins were selected, followed by installing plugins. In the Install plugin from the ZIP file, select the file in question from your computer and upload it. Then, a plugin check is done to see if it meets the criteria of the database, and if everything is fine, a confirmation message appears, and the user moves on to the next step of upgrading the Moodle database. Here, it is confirmed that upgrading to the new version is in progress. The 'confirm' button is clicked, and after a few seconds, the successful completion message appears. The installation is done like any other plugin; it connects to the platform with the administrator account, after which it is selected from Site Administration, Plugin, plugin installation, the zip file is searched, the zip plugin installation command is given, and the database is updated with the new plugin, as can be seen in the image below, Figure 2[25; 26]. The following lines describe what php and zip files contain and their role: classes, db, lang, get, Php, and others. *.php file contains PHP code,
* /local/mutiplefiles/version.php-version of the script,
* /local/mutiplefiles/db/install.xml-executed during installation,
* /local/mutiplefiles/lang/en/local_pluginname.php-language file,
* /local/mutiplefiles/lib.php-function library, automatically included with config.php. * /local/mutiplefiles/settings.php-configuration options. These are added to the Admin menu. Returning to the default method was also considered, a situation in which the plugin will be uninstalled without affecting the database or reinstalling the platform, which is a reversible process [26]. Below, the way of working and how the created solution was put into practice is presented. There have been several improvements to the file submission. * Control the size of the file, which can be reduced or enlarged as needed. * Managing file extensions that can be uploaded by adding or removing them. * Inline viewing of images directly in the chat to facilitate communication, but also the possibility that the link is also available for download. * Only one file is attached, as each file has its download link.