Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added some documentation.
  • Loading branch information
franbenz committed May 22, 2014
1 parent b7220dc commit f404857
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
37 changes: 37 additions & 0 deletions plugins/restapi/includes/messages.php
Expand Up @@ -15,6 +15,24 @@ static function messagesGet() {
phpList_RESTAPI_Common::select( 'Messages', "SELECT * FROM " . $GLOBALS['table_prefix'] . "message ORDER BY Modified DESC;" );
}

/**
* <p>Adds a new message/campaing.</p>
* <p><strong>Parameters:</strong><br/>
* [*subject] {string} <br/>
* [*fromfield] {string} <br/>
* [*replyto] {string} <br/>
* [*textmessage] {string} <br/>
* [*footer] {string} <br/>
* [*status] {string} <br/>
* [*sendformat] {string} <br/>
* [*template] {string} <br/>
* [*embargo] {string} <br/>
* [*rsstemplate] {string} <br/>
* [*owner] {string} <br/>
* <p><strong>Returns:</strong><br/>
* The message added.
* </p>
*/
static function messageAdd(){

$sql = "INSERT INTO " . $GLOBALS['table_prefix'] . "message (subject, fromfield, replyto, message, textmessage, footer, entered, status, sendformat, template, embargo, rsstemplate, owner ) VALUES ( :subject, :fromfield, :replyto, :message, :textmessage, :footer, now(), :status, :sendformat, :template, :embargo, :rsstemplate, :owner );";
Expand Down Expand Up @@ -43,6 +61,25 @@ static function messageAdd(){

}

/**
* <p>Updates existing message/campaing.</p>
* <p><strong>Parameters:</strong><br/>
* [*id] {integer} <br/>
* [*subject] {string} <br/>
* [*fromfield] {string} <br/>
* [*replyto] {string} <br/>
* [*textmessage] {string} <br/>
* [*footer] {string} <br/>
* [*status] {string} <br/>
* [*sendformat] {string} <br/>
* [*template] {string} <br/>
* [*embargo] {string} <br/>
* [*rsstemplate] {string} <br/>
* [owner] {string} <br/>
* <p><strong>Returns:</strong><br/>
* The message added.
* </p>
*/
static function messageUpdate( $id = 0 ){

if ( $id == 0 ) $id = $_REQUEST['id'];
Expand Down
9 changes: 9 additions & 0 deletions plugins/restapi/includes/templates.php
Expand Up @@ -20,6 +20,15 @@ static function templateGetByTitle( $title='' ) {
phpList_RESTAPI_Common::select( 'Template', "SELECT * FROM " . $GLOBALS['table_prefix'] . "template WHERE title='" . $title . "';", true );
}

/**
* <p>Adds a new template.</p>
* <p><strong>Parameters:</strong><br/>
* [*title] {string} the name of the list.<br/>
* [template] {string} adds a description to the list.<br/>
* <p><strong>Returns:</strong><br/>
* The template added.
* </p>
*/
static function templateAdd(){

$sql = "INSERT INTO " . $GLOBALS['table_prefix'] . "template (title, template) VALUES (:title, :template);";
Expand Down

0 comments on commit f404857

Please sign in to comment.