2018-02-09 03:49:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* All modules in Friendica should extend BaseModule, although not all modules
|
|
|
|
* need to extend all the methods described here
|
|
|
|
*
|
2018-04-03 14:33:39 +00:00
|
|
|
* The filename of the module in src/Module needs to match the class name
|
|
|
|
* exactly to make the module available.
|
|
|
|
*
|
2018-09-15 23:28:38 +00:00
|
|
|
* @author Hypolite Petovan <hypolite@mrpetovan.com>
|
2018-02-09 03:49:49 +00:00
|
|
|
*/
|
|
|
|
abstract class BaseModule extends BaseObject
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @brief Initialization method common to both content() and post()
|
|
|
|
*
|
|
|
|
* Extend this method if you need to do any shared processing before both
|
|
|
|
* content() or post()
|
|
|
|
*/
|
|
|
|
public static function init()
|
|
|
|
{
|
2018-09-30 20:47:28 +00:00
|
|
|
}
|
2018-02-09 03:49:49 +00:00
|
|
|
|
2018-09-30 20:47:28 +00:00
|
|
|
/**
|
|
|
|
* @brief Module GET method to display raw content from technical endpoints
|
|
|
|
*
|
|
|
|
* Extend this method if the module is supposed to return communication data,
|
|
|
|
* e.g. from protocol implementations.
|
|
|
|
*/
|
|
|
|
public static function rawContent()
|
|
|
|
{
|
2018-02-09 03:49:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Module GET method to display any content
|
|
|
|
*
|
|
|
|
* Extend this method if the module is supposed to return any display
|
|
|
|
* through a GET request. It can be an HTML page through templating or a
|
|
|
|
* XML feed or a JSON output.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function content()
|
|
|
|
{
|
|
|
|
$o = '';
|
|
|
|
|
|
|
|
return $o;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Module POST method to process submitted data
|
|
|
|
*
|
|
|
|
* Extend this method if the module is supposed to process POST requests.
|
|
|
|
* Doesn't display any content
|
|
|
|
*/
|
|
|
|
public static function post()
|
|
|
|
{
|
|
|
|
// goaway('module');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Called after post()
|
|
|
|
*
|
|
|
|
* Unknown purpose
|
|
|
|
*/
|
|
|
|
public static function afterpost()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|