Xataface Email Module 0.3
Email/Mailmerge Module for Xataface
Email.php
Go to the documentation of this file.
00001 <?php
00002 class modules_Email {
00003 
00010         private $baseURL = null;
00016         public function getBaseURL(){
00017                 if ( !isset($this->baseURL) ){
00018                         $this->baseURL = Dataface_ModuleTool::getInstance()->getModuleURL(__FILE__);
00019                 }
00020                 return $this->baseURL;
00021         }
00022 
00023 
00024         function __construct(){
00025                 $base = 'xataface__email_';
00026                 $tables = array(
00027                         $base.'templates',
00028                         $base.'newsletters',
00029                         $base.'log',
00030                         $base.'attachments',
00031                         'dataface__email_blacklist'
00032                 );
00033                 
00034                 $dirpath = dirname(__FILE__);
00035                 foreach ($tables as $table){
00036                         Dataface_Table::setBasePath($table, $dirpath);
00037                 }
00038                 
00039                 Dataface_Application::getInstance()->_conf['_allowed_tables']['email module'] = '/^xataface__email_/';
00040                 Dataface_Application::getInstance()->_conf['_allowed_tables']['email blacklist'] = '/^dataface__email_blacklist$/';
00041                 
00042         }
00043         
00044         
00045         private $pathsAdded = false;
00046         public function addPaths(){
00047                 if ( !$this->pathsAdded ){
00048                         $this->pathsAdded = true;
00049                         Dataface_JavascriptTool::getInstance()->addPath(
00050                                 dirname(__FILE__).'/js',
00051                                 $this->getBaseURL().'/js'
00052                         );
00053                         Dataface_CSSTool::getInstance()->addPath(
00054                                 dirname(__FILE__).'/css',
00055                                 $this->getBaseURL().'/css'
00056                         );
00057                         df_register_skin('email', dirname(__FILE__).'/templates');
00058                         
00059                 }
00060                 
00061         }
00062         
00063         
00064 }
 All Data Structures Files Functions Variables Enumerations