Almost every customer has at least one special request which is not feasible with HTML. Then offer a solution with PHP. Unlike other systems, you must not pay attention too much in WEButler when programming an extension.
An extension is simply loaded via include in a page. Thus, the extension is a part of the page and all paths of enlargement must be adjusted accordingly (modules/__MODULEDIRECTORY__/...).
A separate module can be integrated into the WEButler search function. This, the file search.php must exist and in search.php the searchinmodcontent_ __MODULEDIRECTORY__ function. The function must provide an array of title, content and URL back. Example:
$result = array(
'title' => 'page title',
'contents' => 'Page content with keyword',
'url' => '__PAGENAME__&var=value'
);
return $result;
Thus the WEButler search also find the module must be entered in the file /settings/searching.php there.
Include your own module in the sitemap works in the same way as the integration into the search. The file sitemap.php must exist in module directory and in the file the function modulessitemap_ __MODULEDIRECTORY__.
The function has to provide an arrays containing the URLs of the module and optionally a timestamp of the last edit as well as hreflang URLs - more Infos
In addition, the module must be entered in the file /settings/sitemaps.php.
Javascripts and CSS files of a module must be entered in the file /settings/compress.php. Additional data for the header or footer can be loaded into the page using $webutlercouple->autoheaderdata[] or $webutlercouple->autofooterdata[].
$webutlercouple->autoheaderdata[] = '<meta name="designation" content="description" />';
$webutlercouple->autofooterdata[] = '<script src="external_script.js"></script>';
The title of the WEButler page can be replaced with the variable $webutlercouple->setnewtitlefrommod by a more specific title from the module.
$webutlercouple->setnewtitlefrommod = 'My new page title';
If you want the module has an administration area, there are 2 ways for a login:
For admins an admintoken is placed into the session. The admintoken can be checked with $webutlercouple->checktoken() and be extended with "&admintoken=<?PHP echo $_SESSION['admintoken']; ?>".
For the realization of a read and/or write access WEButler a registered user following session data of a user can be queried:
Groups-ID: $_SESSION['userauth']['groupid']
ID of the user: $_SESSION['userauth']['userid']
User name: $_SESSION['userauth']['username']
email address: $_SESSION['userauth']['usermail']
In the user manager users can be enabled, disabled or deleted. When the state is needed in a module, it must be scanned in the user DB. Return values:
Enabled: status='enabled'
Disabled: status='disabled'
Deleted: status='deleted'