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

Public Member Functions

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

Protected Member Functions

 getToolbarForm ()

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 114 of file class.ilMailAttachmentGUI.php.

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

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

References $_POST, 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 120 of file class.ilMailAttachmentGUI.php.

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

{
if(!isset($_POST['filename']) || !is_array($_POST['filename']) || !$_POST['filename'])
{
ilUtil::sendFailure($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), ilUtil::stripSlashes(urldecode($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::getToolbarForm ( )
protected
Returns
ilPropertyFormGUI

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

References ilFormPropertyGUI\setRequired().

{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$attachment = new ilFileInputGUI($this->lng->txt('upload'), 'userfile');
$attachment->setRequired(true);
$attachment->setSize(20);
$form->addItem($attachment);
return $form;
}

+ 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: