Xataface Email Module  0.3.2
Email/Mailmerge Module for Xataface
 All Data Structures Files Functions Variables Pages
xataface__email_templates.php
Go to the documentation of this file.
1 <?php
3 
4 
5 
6  public function getPermissions($record){
7  $dummy = new Dataface_Record('dataface__version', array());
8  if ( $dummy->checkPermission('email') ){
9  return array(
10  'view' => 1,
11  'list' => 1,
12  'find' => 1,
13  '__partial__' => 1,
14  'edit'=> 1,
15  'new' => 1,
16  'delete' => 1
17  );
18  } else {
19  return Dataface_PermissionsTool::NO_ACCESS();
20  }
21 
22  }
23 
24 
25  public function block__before_main_column(){
26  echo "<h1>Manage Email Templates</h1>";
27  echo "<div class=\"portalHelp\">This section allows you to manage your email templates. An email template can be used when sending email to found sets to import a pre-formatted email message, subject, and from heading.</div>";
28  echo '<div>[<a href="'.DATAFACE_SITE_HREF.'?-action=email_manage">Back to Email Management</a>]</div>';
29  }
30 
32  Dataface_JavascriptTool::getInstance()->import('xataface/modules/ckeditor/plugins/SchemaBrowser.js');
33  Dataface_ModuleTool::getInstance()->loadModule('modules_Email')->addPaths();
34  Dataface_JavascriptTool::getInstance()->import('xataface/modules/Email/email_template_form.js');
35  }
36 
37 
38 
39  private $tablenames;
40  public function valuelist__tablenames(){
41  if ( !isset($this->tablenames) ){
42  $this->tablenames = array();
43  $app = Dataface_Application::getInstance();
44 
45 
46  if ( isset($app->_conf['_email_tables']) ){
47  foreach ($app->_conf['_email_tables'] as $k=>$v){
48  $this->tablenames[$k] = $v;
49  }
50  } else {
51  foreach ($app->_conf['_tables'] as $k=>$v){
52  $this->tablenames[$k] = $v;
53  }
54  }
55  }
56  return $this->tablenames;
57  }
58 
59 
60 
61  public function getTitle($record){
62  return $record->val('template_name');
63  }
64 
65  public function titleColumn(){
66  return 'template_name';
67  }
68 
69 
70 
71 }