Xataface Email Module  0.3.2
Email/Mailmerge Module for Xataface
 All Data Structures Files Functions Variables Pages
xataface__email_attachments.php
Go to the documentation of this file.
1 <?php
3 
4 
5  function init($table){
6 
7  $field =& $table->getField('file');
8  $app = Dataface_Application::getInstance();
9  if ( @$app->_conf['modules_Email'] ){
10  $conf = $app->_conf['modules_Email'];
11  if ( @$conf['attachments'] ){
12  $field['savepath'] = $conf['attachments'];
13 
14  }
15  if ( @$conf['attachments_url']){
16  $field['url'] = $conf['attachments_url'];
17  }
18  }
19 
20  $savepath = $field['savepath'];
21 
22  if ( !is_dir($savepath) or !is_writable($savepath) ){
23 
24  $field['widget']['type'] = 'hidden';
25  }
26 
27  }
28 
42  public function getPermissions($record){
43  // Create a record for a table we know exists so we can get
44  // the default application permissions.
45  $dummy = new Dataface_Record('dataface__version', array());
46  if ( $dummy->checkPermission('email') ){
47  $perms = array(
48  'view' => 1,
49  '__partial__' => 1,
50  'edit'=>1,
51  'new' => 1,
52  'import' => 0,
53  'copy' => 0,
54  'update_set'=>0
55  );
56 
57  return $perms;
58  } else {
59  return Dataface_PermissionsTool::NO_ACCESS();
60  }
61  }
62 }