Xataface Email Module  0.3.2
Email/Mailmerge Module for Xataface
 All Data Structures Files Functions Variables Pages
Email.php
Go to the documentation of this file.
1 <?php
2 class modules_Email {
3 
10  private $baseURL = null;
16  public function getBaseURL(){
17  if ( !isset($this->baseURL) ){
18  $this->baseURL = Dataface_ModuleTool::getInstance()->getModuleURL(__FILE__);
19  }
20  return $this->baseURL;
21  }
22 
23 
24  function __construct(){
25  $base = 'xataface__email_';
26  $tables = array(
27  $base.'templates',
28  $base.'newsletters',
29  $base.'log',
30  $base.'attachments',
31  'dataface__email_blacklist'
32  );
33 
34  $dirpath = dirname(__FILE__);
35  foreach ($tables as $table){
36  Dataface_Table::setBasePath($table, $dirpath);
37  }
38 
39  Dataface_Application::getInstance()->_conf['_allowed_tables']['email module'] = '/^xataface__email_/';
40  Dataface_Application::getInstance()->_conf['_allowed_tables']['email blacklist'] = '/^dataface__email_blacklist$/';
41 
42  }
43 
44 
45  private $pathsAdded = false;
46  public function addPaths(){
47  if ( !$this->pathsAdded ){
48  $this->pathsAdded = true;
49  Dataface_JavascriptTool::getInstance()->addPath(
50  dirname(__FILE__).'/js',
51  $this->getBaseURL().'/js'
52  );
53  Dataface_CSSTool::getInstance()->addPath(
54  dirname(__FILE__).'/css',
55  $this->getBaseURL().'/css'
56  );
57  df_register_skin('email', dirname(__FILE__).'/templates');
58 
59  }
60 
61  }
62 
63 
64 }