[CS-Project-svn_notify] SF.net SVN: cs-project:[904] trunk/1.2/lib/notifier.class.php
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-07-22 02:04:26
|
Revision: 904 http://cs-project.svn.sourceforge.net/cs-project/?rev=904&view=rev Author: crazedsanity Date: 2008-07-22 02:04:24 +0000 (Tue, 22 Jul 2008) Log Message: ----------- New notifier class (unimplemented) to send emails... Added Paths: ----------- trunk/1.2/lib/notifier.class.php Added: trunk/1.2/lib/notifier.class.php =================================================================== --- trunk/1.2/lib/notifier.class.php (rev 0) +++ trunk/1.2/lib/notifier.class.php 2008-07-22 02:04:24 UTC (rev 904) @@ -0,0 +1,58 @@ +<?php + +/* + * Created on Jul 21, 2008 + * + * SVN INFORMATION::: + * ------------------ + * SVN Signature::::::: $Id$ + * Last Author::::::::: $Author$ + * Current Revision:::: $Revision$ + * Repository Location: $HeadURL$ + * Last Updated:::::::: $Date$ + */ + + +class notifier { + + private $obj=NULL; + private $userList=array(); + private $userListMethod=NULL; + private $recordId=NULL; + + //========================================================================= + public function __construct($obj, $recordId, $userListMethod=NULL) { + if(!is_numeric($recordId) || $recordId < 1) { + throw new exception(__METHOD__ .": invalid record id (". $recordId .")"); + } + if(!strlen($userListMethod)) { + $userListMethod = 'get_user_list'; + } + $this->userListMethod = $userListMethod; + if(is_object($obj)) { + if(!method_exists($obj, $this->userListMethod)) { + throw new exception(__METHOD__ .": method to pull list of users (". $this->userListMethod .") missing"); + } + $this->obj = $obj; + } + else { + throw new exception(__METHOD__ .": invalid data for object (". $obj .")"); + } + }//end __construct() + //========================================================================= + + + //========================================================================= + public function send_notice($subject, $bodyTemplate, array $parseArr=NULL) { + $userListMethod = $this->userListMethod; + $userList = $this->obj->$userListMethod($this->recordId); + + $retval = send_email($userList, $subject, $bodyTemplate, $parseArr); + + return($retval); + }//end send_notice() + //========================================================================= + +}//end notifier{} + +?> Property changes on: trunk/1.2/lib/notifier.class.php ___________________________________________________________________ Added: svn:keywords + Id HeadURL Date Revision Author Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |