[ERROR#1] Direct access to the module files — Documentation — DIAFAN.CMS

Direct access to the module files

To work off-site file structure described modules/module_name/module_name.function.php. This file can be called directly as: http://site.com/модуль/function/.

Direct access to the module may be needed for the following reasons:

  1. Page module should exist regardless of whether the corresponding page in the site structure is created. Thus the need to protect against accidental deletion functionality page.
  2. Page module has a business nature and should not be displayed on the site map, in the file sitemap.xml, menu and so on.
  3. When working with a part of the module you need to get rid of extra requests for page definition.

The file modules/module_name/module_name.function.php available basic system class $this->diafan. Through this variable, you can access to the users, cache, router, and connect the templates, as well as connections to the modules.

In addition, before connecting the files is the start of the session, determined the requested language version of the site, a temporary site and the user area. All these data can be used in the file of module.

If the requested address http://site.com​/module_name/function/some_data/, the data is inherent in the link, the module will be available in the form: $_GET["rewrite"] = 'some_data';

Examples of the implementation of a direct appeal to the module in DIAFAN.CMS:

modules/captcha/captcha.get.php – http://site.com/captcha/get/ – генерирует изображение защитного кода;
the modules / news / news.rss.php - http://site.com/news/rss/ - generates RSS-feed news;
modules/payment/payment.get.php – http://site.com/payment/get/ – работа с платежными системами;
modules/useradmin/useradmin.edit.php – http://site.com/useradmin/edit/ – форма редактирования данных из пользовательской части;
the modules / the attachments / attachments.get.php - http://site.com/attachments/get/ - gives attachment.
  • modules/captcha/captcha.get.phphttp://site.com/captcha/get/ – generates image of captcha;
  • modules/news/news.rss.phphttp://site.com/news/rss/ – generates RSS-feed of news;
  • modules/payment/payment.get.phphttp://site.com/payment/get/ – works with payment systems;
  • modules/useradmin/useradmin.edit.phphttp://site.com/useradmin/edit/ – form of editing from quick edit panel;
  • modules/attachments/attachments.get.phphttp://site.com/attachments/get/ – get attached file.
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( To work off-site file structure described *modules/module_name/module_name.function.php*. This file can be called directly as: *http://site.com/модуль/function/*. Direct access to the module m...) 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]