ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjMailGUI Class Reference

Class ilObjMailGUI for admin panel. More...

+ Inheritance diagram for ilObjMailGUI:
+ Collaboration diagram for ilObjMailGUI:

Public Member Functions

 ilObjMailGUI ($a_data, $a_id, $a_call_by_reference)
 Constructor public.
 viewObject ()
 list childs of current object
 importObject ()
 import new object form
 performImportObject ()
 uploadObject ()
 __initFileObject ()
 __initParserObject ($a_xml, $a_mode)
executeCommand ()
 execute command
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getTabs (&$tabs_gui)
 get tabs public
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 showMountWebfolderIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 getHTML ()
 setActions ($a_actions="")
 set possible actions for objects in list.
 setSubObjects ($a_sub_objects="")
 set possible subobjects for this object.
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 undeleteObject ()
 get object back from trash
 insertSavedNodes ($a_source_id, $a_dest_id, $a_tree_id, &$a_affected_ids)
 recursive method to insert all saved nodes of the clipboard (maybe this function could be moved to a rbac class ?)
 confirmedDeleteObject ()
 confirmed deletion if object -> objects are moved to trash
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 removeDeletedNodes ($a_node_id, $a_checked, $a_delete_objects, &$a_affected_ids)
 remove already deleted objects within the objects in trash recursive function
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 editObject ()
 edit object
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 updateObject ()
 updates object entry in object_data
 afterUpdate ()
 permObject ()
 show permissions of current node
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 permSaveObject ()
 save permissions
 isVisible ($a_ref_id, $a_type)
 displayList ()
 display object list
 deleteObject ($a_error=false)
 display deletion confirmation screen only for referenced objects.
 trashObject ()
 show trash content of object
 addRoleObject ()
 adds a local role This method is only called when choose the option 'you may add local roles'.
 showActions ($with_subobjects=false)
 show possible action (form buttons)
 getActions ()
 Get Actions.
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 infoObject ()
 __buildRoleFilterSelect ()
 __filterRoles ($a_roles, $a_filter)
 ownerObject ()
 changeOwnerObject ()
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false
- Protected Member Functions inherited from ilObjectGUI
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)

Detailed Description

Class ilObjMailGUI for admin panel.

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Id:
class.ilObjMailGUI.php 16857 2008-06-23 11:35:08Z mjansen

ilObjMailGUI: ilPermissionGUI

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

Member Function Documentation

ilObjMailGUI::__initFileObject ( )

Definition at line 311 of file class.ilObjMailGUI.php.

Referenced by importObject(), performImportObject(), and uploadObject().

{
include_once "./classes/class.ilFileDataImportMail.php";
$this->file_obj =& new ilFileDataImportMail();
return true;
}

+ Here is the caller graph for this function:

ilObjMailGUI::__initParserObject (   $a_xml,
  $a_mode 
)

Definition at line 319 of file class.ilObjMailGUI.php.

Referenced by performImportObject(), and uploadObject().

{
include_once "Services/Mail/classes/class.ilMailImportParser.php";
if(!$a_xml)
{
return false;
}
$this->parser_obj =& new ilMailImportParser($a_xml,$a_mode);
return true;
}

+ Here is the caller graph for this function:

& ilObjMailGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 333 of file class.ilObjMailGUI.php.

References $cmd, $ret, and ilObjectGUI\prepareOutput().

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
include_once("./classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if(!$cmd)
{
$cmd = "view";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjMailGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 360 of file class.ilObjMailGUI.php.

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjMailGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 370 of file class.ilObjMailGUI.php.

Referenced by getAdminTabs().

{
global $rbacsystem;
if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this, "view"), array("view",""), "", "");
}
if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
if ($rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$tabs_gui->addTarget("import",
$this->ctrl->getLinkTarget($this, "import"), "import", "", "");
}
}

+ Here is the caller graph for this function:

ilObjMailGUI::ilObjMailGUI (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Constructor public.

Definition at line 43 of file class.ilObjMailGUI.php.

References ilObjectGUI\ilObjectGUI().

{
$this->type = "mail";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
}

+ Here is the call graph for this function:

ilObjMailGUI::importObject ( )

import new object form

public

Reimplemented from ilObjectGUI.

Definition at line 215 of file class.ilObjMailGUI.php.

References ilObjectGUI\$lng, and __initFileObject().

{
global $rbacsystem,$lng;
if (!$rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->WARNING);
}
#$this->getTemplateFile("import");
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_import.html", "Services/Mail");
// GET ALREADY CREATED UPLOADED XML FILE
$this->__initFileObject();
if($this->file_obj->findXMLFile())
{
$this->tpl->setVariable("TXT_IMPORTED_FILE",$lng->txt("checked_files"));
$this->tpl->setVariable("XML_FILE",basename($this->file_obj->getXMLFile()));
$this->tpl->setVariable("BTN_IMPORT",$this->lng->txt("import"));
}
$this->tpl->setVariable("FORMACTION",
$this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_IMPORT_MAIL",$this->lng->txt("table_mail_import"));
$this->tpl->setVariable("TXT_IMPORT_FILE",$this->lng->txt("mail_import_file"));
$this->tpl->setVariable("BTN_CANCEL",$this->lng->txt("cancel"));
$this->tpl->setVariable("BTN_UPLOAD",$this->lng->txt("upload"));
return true;
}

+ Here is the call graph for this function:

ilObjMailGUI::performImportObject ( )

Definition at line 246 of file class.ilObjMailGUI.php.

References ilObjectGUI\$lng, __initFileObject(), __initParserObject(), and ilUtil\sendInfo().

{
global $rbacsystem,$lng;
if (!$rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->WARNING);
}
$this->__initFileObject();
$this->file_obj->findXMLFile();
$this->__initParserObject($this->file_obj->getXMLFile(),"import");
$this->parser_obj->startParsing();
$number = $this->parser_obj->getCountImported();
ilUtil::sendInfo($lng->txt("import_finished")." ".$number,true);
$this->ctrl->redirect($this, "import");
}

+ Here is the call graph for this function:

ilObjMailGUI::uploadObject ( )

Definition at line 266 of file class.ilObjMailGUI.php.

References ilObjectGUI\$lng, __initFileObject(), __initParserObject(), and ilUtil\sendInfo().

{
global $rbacsystem,$lng;
if (!$rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->WARNING);
}
$this->__initFileObject();
if(!$this->file_obj->storeUploadedFile($_FILES["importFile"])) // STEP 1 save file in ...import/mail
{
$this->message = $lng->txt("import_file_not_valid");
$this->file_obj->unlinkLast();
}
else if(!$this->file_obj->unzip())
{
$this->message = $lng->txt("cannot_unzip_file"); // STEP 2 unzip uplaoded file
$this->file_obj->unlinkLast();
}
else if(!$this->file_obj->findXMLFile()) // STEP 3 getXMLFile
{
$this->message = $lng->txt("cannot_find_xml");
$this->file_obj->unlinkLast();
}
else if(!$this->__initParserObject($this->file_obj->getXMLFile(),"check"))
{
$this->message = $lng->txt("error_parser"); // STEP 4 init sax parser
}
else if(!$this->parser_obj->startParsing())
{
$this->message = $lng->txt("users_not_imported").":<br/>"; // STEP 5 start parsing
$this->message .= $this->parser_obj->getNotAssignableUsers();
}
// FINALLY CHECK ERROR
if(!$this->message)
{
$this->message = $lng->txt("uploaded_and_checked");
}
ilUtil::sendInfo($this->message,true);
$this->ctrl->redirect($this, "import");
}

+ Here is the call graph for this function:

ilObjMailGUI::viewObject ( )

list childs of current object

public

Reimplemented from ilObjectGUI.

Definition at line 49 of file class.ilObjMailGUI.php.

References IL_MAIL_BOTH, IL_MAIL_EMAIL, IL_MAIL_LOCAL, ilUtil\sendInfo(), and ilUtil\stripSlashes().

{
# parent::editObject();
$this->lng->loadLanguageModule("mail");
$this->tpl->addBlockFile("SYSTEMSETTINGS", "systemsettings", "tpl.mail_basicdata.html", "Services/Mail");
$this->tpl->setCurrentBlock("systemsettings");
$settings = $this->ilias->getAllSettings();
if (isset($_POST["save_settings"])) // formular sent
{
//init checking var
$form_valid = true;
// put any checks here!!!
if (!$form_valid) //required fields not satisfied. Set formular to already fill in values
{
// mail server
$settings["mail_server"] = $_POST["mail_server"];
$settings["mail_port"] = $_POST["mail_port"];
// internal mail
# $settings["mail_intern_enable"] = $_POST["mail_intern_enable"];
$settings["mail_maxsize_mail"] = $_POST["mail_maxsize_mail"];
$settings["mail_maxsize_attach"] = $_POST["mail_maxsize_attach"];
$settings["mail_maxsize_box"] = $_POST["mail_maxsize_box"];
$settings["mail_maxtime_mail"] = $_POST["mail_maxtime_mail"];
$settings["mail_maxtime_attach"] = $_POST["mail_maxtime_attach"];
$settings['mail_external_sender_noreply'] = ilUtil::stripSlashes($_POST['mail_external_sender_noreply']);
}
else // all required fields ok
{
// write new settings
// mail server
$this->ilias->setSetting("mail_server",$_POST["mail_server"]);
$this->ilias->setSetting("mail_port",$_POST["mail_port"]);
// internal mail
$this->ilias->setSetting("mail_incoming_mail",$_POST["mail_incoming_mail"]);
# $this->ilias->setSetting("mail_intern_enable",$_POST["mail_intern_enable"]);
$this->ilias->setSetting("mail_maxsize_mail",$_POST["mail_maxsize_mail"]);
$this->ilias->setSetting("mail_maxsize_attach",$_POST["mail_maxsize_attach"]);
$this->ilias->setSetting("mail_maxsize_box",$_POST["mail_maxsize_box"]);
$this->ilias->setSetting("mail_maxtime_mail",$_POST["mail_maxtime_mail"]);
$this->ilias->setSetting("mail_maxtime_attach",$_POST["mail_maxtime_attach"]);
$this->ilias->setSetting("pear_mail_enable",$_POST["pear_mail_enable"]);
$this->ilias->setSetting('mail_external_sender_noreply', ilUtil::stripSlashes($_POST['mail_external_sender_noreply']));
$settings = $this->ilias->getAllSettings();
// feedback
ilUtil::sendInfo($this->lng->txt("saved_successfully"));
}
}
// setting language vars
// common
$this->tpl->setVariable("TXT_DAYS",$this->lng->txt("days"));
$this->tpl->setVariable("TXT_KB",$this->lng->txt("kb"));
// mail server
$this->tpl->setVariable("TXT_MAIL_SMTP", $this->lng->txt("mail")." (".$this->lng->txt("smtp").")");
$this->tpl->setVariable("TXT_MAIL_SERVER", $this->lng->txt("server"));
$this->tpl->setVariable("TXT_MAIL_PORT", $this->lng->txt("port"));
// Pear Mail extension
// Note: We use the include statement to determine whether PEAR MAIL is
// installed. We use the @ operator to prevent PHP from issuing a
// warning while we test for PEAR MAIL.
$is_pear_mail_installed = @include_once 'Mail/RFC822.php';
$this->tpl->setVariable("TXT_PEAR_MAIL", $this->lng->txt("mail_use_pear_mail"));
if ($settings['pear_mail_enable'] && $is_pear_mail_installed)
{
$this->tpl->setVariable("PEAR_MAIL_CHECKED", 'checked="checked"');
}
if ($is_pear_mail_installed)
{
$this->tpl->setVariable("TXT_PEAR_MAIL_INFO",
$this->lng->txt("mail_use_pear_mail_info")
);
}
else
{
$this->tpl->setVariable("TXT_PEAR_MAIL_INFO",
$this->lng->txt("mail_use_pear_mail_info").'<br>'.
$this->lng->txt("mail_pear_mail_needed")
);
$this->tpl->setVariable("PEAR_MAIL_DISABLED", 'disabled="disabled"');
}
// internal mail
include_once "Services/Mail/classes/class.ilMailOptions.php";
$this->tpl->setVariable("TXT_GENERAL_SETTINGS", $this->lng->txt("general_settings"));
$this->tpl->setVariable("TXT_MAIL_INCOMING", $this->lng->txt("mail_incoming"));
$types = array(
array(
"name" => $this->lng->txt("mail_incoming_local"),
"value" => IL_MAIL_LOCAL
),
array(
"name" => $this->lng->txt("mail_incoming_smtp"),
"value" => IL_MAIL_EMAIL
),
array(
"name" => $this->lng->txt("mail_incoming_both"),
"value" => IL_MAIL_BOTH
)
);
for ($i = 0; $i < count($types); $i++)
{
$this->tpl->setCurrentBlock("loop_incoming_mail");
$this->tpl->setVariable("LOOP_INCOMING_MAIL_VALUE", $types[$i]["value"]);
$this->tpl->setVariable("LOOP_INCOMING_MAIL_NAME", $types[$i]["name"]);
if ($settings["mail_incoming_mail"] == $types[$i]["value"])
{
$this->tpl->setVariable("LOOP_INCOMING_MAIL_SELECTED", "selected");
}
$this->tpl->parseCurrentBlock("loop_incoming_mail");
}
# $this->tpl->setVariable("TXT_MAIL_INTERN", $this->lng->txt("mail")." (".$this->lng->txt("internal_system").")");
$this->tpl->setVariable("TXT_MAIL_INTERN", $this->lng->txt("internal_system"));
# $this->tpl->setVariable("TXT_MAIL_INTERN_ENABLE", $this->lng->txt("mail_intern_enable"));
$this->tpl->setVariable("TXT_MAIL_MAXSIZE_MAIL", $this->lng->txt("mail_maxsize_mail"));
$this->tpl->setVariable("TXT_MAIL_MAXSIZE_ATTACH", $this->lng->txt("mail_maxsize_attach"));
$this->tpl->setVariable("TXT_MAIL_MAXSIZE_BOX", $this->lng->txt("mail_maxsize_box"));
$this->tpl->setVariable("TXT_MAIL_MAXTIME_MAIL", $this->lng->txt("mail_maxtime_mail"));
$this->tpl->setVariable("TXT_MAIL_MAXTIME_ATTACH", $this->lng->txt("mail_maxtime_attach"));
$this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
// display formula data
// mail server
$this->tpl->setVariable("MAIL_SERVER",$settings["mail_server"]);
$this->tpl->setVariable("MAIL_PORT",$settings["mail_port"]);
// internal mail
# if ($settings["mail_intern_enable"] == "y")
# {
# $this->tpl->setVariable("MAIL_INTERN_ENABLE","checked=\"checked\"");
# }
$this->tpl->setVariable("MAIL_MAXSIZE_MAIL", $settings["mail_maxsize_mail"]);
$this->tpl->setVariable("MAIL_MAXSIZE_ATTACH", $settings["mail_maxsize_attach"]);
$this->tpl->setVariable("MAIL_MAXSIZE_BOX", $settings["mail_maxsize_box"]);
$this->tpl->setVariable("MAIL_MAXTIME_MAIL", $settings["mail_maxtime_mail"]);
$this->tpl->setVariable("MAIL_MAXTIME_ATTACH", $settings["mail_maxtime_attach"]);
// noreply
$this->tpl->setVariable('TXT_MAIL_EXTERNAL_SENDER_NOREPLY', $this->lng->txt('mail_external_sender_noreply'));
$this->tpl->setVariable('MAIL_EXTERNAL_SENDER_NOREPLY', $settings['mail_external_sender_noreply']);
$this->tpl->setVariable('INFO_MAIL_EXTERNAL_SENDER_NOREPLY', $this->lng->txt('info_mail_external_sender_noreply'));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:


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