PLUGINS
-------

playSMS plugin's files and folders are under directory web/plugins and categorized
into 5 different categories, they are:
- feature
- gateway
- themes
- language


Tools
-----

Here are installed plugins with no specific SMS related features but used by playSMS.

Core functions that you can 'hook' from tools plugins:
- playsmsd()
- billing_post($smslog_id,$rate,$credit,$count,$charge)
- billing_rollback($smslog_id)
- billing_finalize($smslog_id)
- billing_getdata($smslog_id)
- phonebook_groupid2code($gpid)
- phonebook_groupcode2id($uid,$gp_code)
- phonebook_number2name($p_num)
- phonebook_getmembercountbyid($gpid)
- phonebook_getdatabyid($gpid, $orderby="")
- phonebook_getdatabyuid($uid, $orderby="")
- phonebook_getsharedgroup($uid)
- phonebook_getgroupbyuid($uid, $orderby="")
- rate_setusercredit($uid, $remaining=0)
- rate_getusercredit($username)
- rate_cansend($username, $sms_to)
- rate_deduct($smslog_id)
- rate_refund($smslog_id)
- sendmail($mail_from,$mail_to,$mail_subject="",$mail_body="")
- setsmsdeliverystatus($smslog_id,$uid,$p_status)
- recvsms_intercept($sms_datetime,$sms_sender,$message,$sms_receiver)
- recvsms_inbox_add_intercept($sms_datetime,$sms_sender,$target_user,$message)
- sendsms_intercept($sms_sender,$sms_footer,$sms_to,$sms_msg,$uid,$gpid=0,$sms_type='text',$unicode=0)
- webservices_output($ta,$_REQUEST)
- call($_REQUEST)


Feature
-------

Here are installed plugins which contain specific SMS related features and directly handle
incoming or outgoing SMS.

Core functions that you can 'hook' from feature plugins:
- playsmsd()
- checkavailablekeyword($keyword)
- setsmsdeliverystatus($smslog_id,$uid,$p_status)
- setsmsincomingaction($sms_datetime,$sms_sender,$target_keyword,$message,$sms_receiver,$raw_message)
- recvsms_intercept($sms_datetime,$sms_sender,$message,$sms_receiver)
- recvsms_inbox_add_intercept($sms_datetime,$sms_sender,$target_user,$message)
- sendsms_intercept($sms_sender,$sms_footer,$sms_to,$sms_msg,$uid,$gpid=0,$sms_type='text',$unicode=0)
- webservices_output($ta,$_REQUEST)
- call($_REQUEST)


Gateway
-------

Here are installed plugins that have ability to actually send and/or receive SMS, and directly
connected to SMS gateway applications or services.

Core functions that you can 'hook' from gateway plugins:
- playsmsd()
- getsmsinbox()
- getsmsstatus($gpid=0,$uid="",$smslog_id="",$p_datetime="",$p_update="")
- sendsms($sms_sender,$sms_footer,$sms_to,$sms_msg,$uid='',$gpid=0,$smslog_id=0,$sms_type='text',$unicode=0)
- setsmsdeliverystatus($smslog_id,$uid,$p_status)
- webservices_output($ta,$_REQUEST)
- call($_REQUEST)


Themes
------

Here are installed playSMS's themes.

Core functions that you can 'hook' from themes plugins:
- themes_buildmenu($menu_config)
- themes_navbar($num, $nav, $max_nav, $url, $page)
- call($_REQUEST)


Language
--------

Here are installed language database based on gettext for core/main files only. But each plugin's
language files are reside under each plugin's directory.


Plugin Anatomy
---------------
Each plugin will need to have below structure:

<playsms_web_root>/plugin/<category>/<plugin_name>/config.php
                                                  /fn.php
                                                  /docs/VERSION
                                                  /docs/README
                                                  /docs/CHANGELOG
                                                  /lib
                                                  /<plugin_name>.php

For example, plugin with purpose to serve connecting playsms to your own Content Provider,
called 'mycp'. Since its a gateway, the category would be 'gateway'.

The plugin structure will be:

<playsms_web_root>/plugin/gateway/mycp/config.php
                                      /fn.php
                                      /docs/VERSION
                                      /docs/README
                                      /docs/CHANGELOG
                                      /lib
                                      /mycp.php


DIRECT ACCESS
-------------

Since version 0.9.5.1 playSMS will use single gate for all its routines.
For example, prior to 0.9.5.1 accessing menus referenced to menu.php, now its changed.

Access to menus, you will need to use URL index.php?app=menu
Access to webservices, you will need to use URL index.php?app=webservices
Access to callback functions, or functions in plugins, you will need to use index.php?app=call

Notes:
- access to menu.php has been replaced with index.php?app=menu
- access to input.php and output.php has been replaced with index.php?app=webservices
- access to callback.php, dlr.php and geturl.php has been replaced with
  index.php?app=call&cat=[plugin's category]&plugin=[plugin's name]
- access to dlr.php in kannel will require additional parameter access=dlr
- access to geturl.php in kannel will require additional parameter access=geturl

For example:

Prior to 0.9.5.1:
http://localhost/playsms/menu.php?inc=user_outgoing&op=user_outgoing
Since 0.9.5.1:
http://localhost/playsms/index.php?app=menu&inc=user_outgoing&op=user_outgoing

Prior to 0.9.5.1:
http://localhost/playsms/input.php?u=admin&p=admin&ta=ds&last=100
Since 0.9.5.1:
http://localhost/playsms/index.php?app=webservices&u=admin&p=admin&ta=ds&last=100

Prior to 0.9.5.1:
http://localhost/playsms/plugin/gateway/kannel/geturl.php?t=%t&q=%q&a=%a
Since 0.9.5.1:
http://localhost/playsms/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a
