ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailAttachmentGUI Class Reference
+ Collaboration diagram for ilMailAttachmentGUI:

Public Member Functions

 executeCommand ()
 cancelSaveAttachments ()
 deleteAttachments ()
 confirmDeleteAttachments ()
 uploadFile ()

Private Attributes

 $tpl
 $ctrl
 $lng
 $umail
 $mfile

Detailed Description

Author
Jens Conze
Version
$Id$

Definition at line 12 of file class.ilMailAttachmentGUI.php.

Member Function Documentation

ilMailAttachmentGUI::cancelSaveAttachments ( )

Definition at line 104 of file class.ilMailAttachmentGUI.php.

{
$this->ctrl->setParameter($this, 'type', 'attach');
$this->ctrl->returnToParent($this);
}
ilMailAttachmentGUI::confirmDeleteAttachments ( )

Definition at line 137 of file class.ilMailAttachmentGUI.php.

References $_POST, $files, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendSuccess().

{
if(!isset($_POST['filename']) || !is_array($_POST['filename']) || !$_POST['filename'])
{
ilUtil::sendInfo($this->lng->txt('mail_select_one_mail'));
$this->showAttachments();
return true;
}
$files = array();
foreach($_POST['filename'] as $value)
{
$files[] = urldecode($value);
}
if(strlen(($error = $this->mfile->unlinkFiles($files))))
{
ilUtil::sendFailure($this->lng->txt('mail_error_delete_file') . ' ' . $error);
}
else
{
$mailData = $this->umail->getSavedData();
if(is_array($mailData['attachments']))
{
$tmp = array();
for($i = 0; $i < count($mailData['attachments']); $i++)
{
if(!in_array($mailData['attachments'][$i], $files))
{
$tmp[] = $mailData['attachments'][$i];
}
}
$this->umail->saveAttachments($tmp);
}
ilUtil::sendSuccess($this->lng->txt('mail_files_deleted'));
}
$this->showAttachments();
}

+ Here is the call graph for this function:

ilMailAttachmentGUI::deleteAttachments ( )

Definition at line 110 of file class.ilMailAttachmentGUI.php.

References $_POST, $filename, ilUtil\sendInfo(), and ilUtil\stripSlashes().

{
if(!isset($_POST['filename']) || !is_array($_POST['filename']) || !$_POST['filename'])
{
ilUtil::sendInfo($this->lng->txt('mail_select_one_file'));
$this->showAttachments();
return;
}
$this->tpl->setTitle($this->lng->txt('mail'));
require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirmation = new ilConfirmationGUI();
$confirmation->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteAttachments'));
$confirmation->setConfirm($this->lng->txt('confirm'), 'confirmDeleteAttachments');
$confirmation->setCancel($this->lng->txt('cancel'), 'showAttachments');
$confirmation->setHeaderText($this->lng->txt('mail_sure_delete_file'));
foreach($_POST['filename'] as $filename)
{
$confirmation->addItem('filename[]', ilUtil::stripSlashes($filename), urldecode(ilUtil::stripSlashes($filename)));
}
$this->tpl->setContent($confirmation->getHtml());
$this->tpl->show();
}

+ Here is the call graph for this function:

ilMailAttachmentGUI::executeCommand ( )

Definition at line 59 of file class.ilMailAttachmentGUI.php.

References $cmd.

{
$forward_class = $this->ctrl->getNextClass($this);
switch($forward_class)
{
default:
if(!($cmd = $this->ctrl->getCmd()))
{
$cmd = 'showAttachments';
}
$this->$cmd();
break;
}
return true;
}
ilMailAttachmentGUI::uploadFile ( )

Definition at line 178 of file class.ilMailAttachmentGUI.php.

References ilFormat\formatSize(), and ilUtil\sendFailure().

{
if(strlen(trim($_FILES['userfile']['name'])))
{
if($this->mfile->storeUploadedFile($_FILES['userfile']) == 1)
{
ilUtil::sendFailure($this->lng->txt('mail_maxsize_attachment_error') . ' ' . ilFormat::formatSize($this->mfile->getUploadLimit()));
}
}
$this->showAttachments();
}

+ Here is the call graph for this function:

Field Documentation

ilMailAttachmentGUI::$ctrl
private

Definition at line 22 of file class.ilMailAttachmentGUI.php.

ilMailAttachmentGUI::$lng
private

Definition at line 27 of file class.ilMailAttachmentGUI.php.

ilMailAttachmentGUI::$mfile
private

Definition at line 37 of file class.ilMailAttachmentGUI.php.

ilMailAttachmentGUI::$tpl
private

Definition at line 17 of file class.ilMailAttachmentGUI.php.

ilMailAttachmentGUI::$umail
private

Definition at line 32 of file class.ilMailAttachmentGUI.php.


The documentation for this class was generated from the following file: