[ERROR#1] JS-scripts — Documentation — DIAFAN.CMS

JS-scripts

For operation of the module often requires a separate JavaScript-script. There are several options to connect JS-files. Consider the example of them.

  • modules/shop/admin/js/shop.admin.js connect to products edit (on all pages).
  • modules/shop/admin/js/shop.admin.category.js connect to categories edit

You can also add edit, then file connect only to edit or add an item. For example, modules/bs/admin/js/bs.admin.edit.js only connect to form editing / adding banner.

Also automatically connect to the module-connections:

  • modules/images/admin/js/images.admin.inc.js – action edit when editing the attached images in the item;
  • modules/images/admin/js/images.admin.inc.config.js – action edit when editing images settings in the module.

Once the files are automatically loaded for the functions of the file adm/includes/edit_functions.php:

  • adm/js/edit/admin.edit.field.js – for the treatment of the "field";
  • adm/js/edit/admin.edit.config.field.js – for the treatment of "fields" in the module settings.

Well, you can also manually set:

$this->diafan->_admin->js_view[] = 'modules/images/admin/js/images.admin.inc.js';

The JS-code also need to take its own characteristics.

To correct the request, checked identification hash, Ajax-requests should be sent through the function diafan_ajax.init():

diafan_ajax.init({
    
data: Transmitted_data_in_JSON_format,
    
url: Address_to_which_data_is_transmitted,
    
success: function(response) {
        
// response processing
    
}
});

All data are not binding. If returned response.redirect, the redirection takes place irrespective of what is defined success.

Methods with the same name as their class will not be constructors in a future version of PHP; Markdown_Parser has a deprecated constructor
#1 include_once() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499]
#2 Docs_model->prepare_text( For operation of the module often requires a separate JavaScript-script. There are several options to connect JS-files. Consider the example of them. * *modules/shop/admin/js/shop.admin.js* connect...) called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:94]
#3 Docs_model->show() called at [/var/www/diafan/data/www/diafancms.com/modules/docs/docs.php:29]
#4 Docs->init() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:474]
#5 Init->module() called at [/var/www/diafan/data/www/diafancms.com/includes/init.php:119]
#6 Init->start() called at [/var/www/diafan/data/www/diafancms.com/index.php:62]
/var/www/diafan/data/www/diafancms.com/modules/docs/docs.model.php:499