![]() |
Xataface Email Module 0.3
Email/Mailmerge Module for Xataface
|
00001 <?php 00002 class tables_xataface__email_attachments { 00003 00004 00005 function init($table){ 00006 00007 $field =& $table->getField('file'); 00008 $app = Dataface_Application::getInstance(); 00009 if ( @$app->_conf['modules_Email'] ){ 00010 $conf = $app->_conf['modules_Email']; 00011 if ( @$conf['attachments'] ){ 00012 $field['savepath'] = $conf['attachments']; 00013 00014 } 00015 if ( @$conf['attachments_url']){ 00016 $field['url'] = $conf['attachments_url']; 00017 } 00018 } 00019 00020 $savepath = $field['savepath']; 00021 00022 if ( !is_dir($savepath) or !is_writable($savepath) ){ 00023 00024 $field['widget']['type'] = 'hidden'; 00025 } 00026 00027 } 00028 00042 public function getPermissions($record){ 00043 // Create a record for a table we know exists so we can get 00044 // the default application permissions. 00045 $dummy = new Dataface_Record('dataface__version', array()); 00046 if ( $dummy->checkPermission('email') ){ 00047 $perms = array( 00048 'view' => 1, 00049 '__partial__' => 1, 00050 'edit'=>1, 00051 'new' => 1, 00052 'import' => 0, 00053 'copy' => 0, 00054 'update_set'=>0 00055 ); 00056 00057 return $perms; 00058 } else { 00059 return Dataface_PermissionsTool::NO_ACCESS(); 00060 } 00061 } 00062 }