ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjChatServerGUI Class Reference

Class ilObjChatServerGUI. More...

+ Inheritance diagram for ilObjChatServerGUI:
+ Collaboration diagram for ilObjChatServerGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
executeCommand ()
 execute command
 initForm ($a_mode)
 uploadSmileyObject ()
 deleteMultipleObject ()
 confirmedDeleteMultipleObject ()
 initSmiliesForm ()
 initSmiliesEditForm ()
 getValues ()
 editObject ()
 edit object
 showEditSmileyEntryFormObject ()
 showDeleteSmileyFormObject ()
 deleteSmileyObject ()
 editSmiliesObject ()
 updateSmiliesObject ()
 updateObject ()
 updates object entry in object_data
 getAdminTabs (&$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
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Private Attributes

 $form_gui = null

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
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 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)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 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
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __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="")
 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.
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Class ilObjChatServerGUI.

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Id:
lass.ilObjChatServerGUI.php 12853 2006-12-15 13:36:31 +0000 (Fr, 15 Dez 2006) smeyer

ilObjChatServerGUI: ilPermissionGUI

Definition at line 38 of file class.ilObjChatServerGUI.php.

Constructor & Destructor Documentation

ilObjChatServerGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Constructor public.

Definition at line 46 of file class.ilObjChatServerGUI.php.

References ilObjectGUI\ilObjectGUI().

{
#define('ILIAS_MODULE','chat');
$this->type = 'chac';
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, $a_prepare_output);
$this->lng->loadLanguageModule('chat');
}

+ Here is the call graph for this function:

Member Function Documentation

ilObjChatServerGUI::confirmedDeleteMultipleObject ( )

Definition at line 331 of file class.ilObjChatServerGUI.php.

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, and ilChatSmilies\_deleteMultipleSmilies().

{
global $rbacsystem, $ilSetting, $lng, $ilCtrl;
if(!$rbacsystem->checkAccess('write', $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
}
$ids = $_REQUEST["sel_ids"];
$parts = explode(",", $ids);
if (count($parts) == 0)
{
$ilCtrl->redirect($this, "editSmilies");
}
include_once "Modules/Chat/classes/class.ilChatSmilies.php";
//$this->editSmiliesObject();
$ilCtrl->redirect($this, "editSmilies");
}

+ Here is the call graph for this function:

ilObjChatServerGUI::deleteMultipleObject ( )

Definition at line 293 of file class.ilObjChatServerGUI.php.

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilChatSmilies\_getSmiliesById(), and ilUtil\sendInfo().

{
global $rbacsystem, $ilSetting, $lng, $ilCtrl;
$this->tabs_gui->setTabActive('edit_smilies');
if(!$rbacsystem->checkAccess('write', $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
}
$items = $_REQUEST["smiley_id"];
if (count($items) == 0)
{
ilUtil::sendInfo($lng->txt('select_one'), true);
$ilCtrl->redirect($this, "editSmilies");
}
include_once 'Modules/Chat/classes/class.ilChatSmilies.php';
$smilies = ilChatSmilies::_getSmiliesById($items);
$tpl = new ilTemplate("tpl.chat_smilies_delete_multiple_confirm.html", true, true, "Modules/Chat");
$tpl->setVariable("SMILIES_DELETE_INTRO", $lng->txt('chat_confirm_delete_smiley'));
$tpl->setVariable("TXT_SUBMIT", $lng->txt('submit'));
$tpl->setVariable("TXT_CANCEL", $lng->txt('cancel'));
$tpl->setVariable("SMILIES_IDS", join(",", $items));
$tpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this,'update'));
$i = 0;
foreach($smilies as $s) {
$tpl->setCurrentBlock("smilies_list");
$tpl->setVariable("SMILEY_PATH", $s["smiley_fullpath"]);
$tpl->setVariable("SMILEY_KEYWORDS", $s["smiley_keywords"]);
$tpl->setVariable("ROW_CNT", ($i++ % 2) + 1);
$tpl->parseCurrentBlock();
}
$this->tpl->setContent($tpl->get());
}

+ Here is the call graph for this function:

ilObjChatServerGUI::deleteSmileyObject ( )

Definition at line 518 of file class.ilObjChatServerGUI.php.

References $ilCtrl, and ilChatSmilies\_deleteSmiley().

{
global $rbacsystem, $ilCtrl;
if(!$rbacsystem->checkAccess('write', $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
}
include_once 'Modules/Chat/classes/class.ilChatSmilies.php';
ilChatSmilies::_deleteSmiley($_REQUEST["chat_smiley_id"]);
//$this->editSmiliesObject();
$ilCtrl->redirect($this, "editSmilies");
}

+ Here is the call graph for this function:

ilObjChatServerGUI::editObject ( )

edit object

public

Reimplemented from ilObjectGUI.

Definition at line 445 of file class.ilObjChatServerGUI.php.

References getValues(), and initForm().

Referenced by updateObject().

{
global $rbacsystem;
$this->tabs_gui->setTabActive('settings');
if(!$rbacsystem->checkAccess('read', $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
}
if(null === $this->form_gui)
{
$this->initForm('edit');
$this->getValues();
}
$this->tpl->setContent($this->form_gui->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjChatServerGUI::editSmiliesObject ( )

Definition at line 531 of file class.ilObjChatServerGUI.php.

References ilObjectGUI\$tpl, ilChatSmilies\_checkSetup(), ilChatSmiliesGUI\_getExistingSmiliesTable(), and initSmiliesForm().

{
global $rbacsystem;
$this->tabs_gui->setTabActive('edit_smilies');
if(!$rbacsystem->checkAccess('read', $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
}
include_once 'Modules/Chat/classes/class.ilChatSmilies.php';
$this->initSmiliesForm('edit');
include_once "Modules/Chat/classes/class.ilChatSmiliesGUI.php";
$tpl = new ilTemplate("tpl.chat_edit_smilies.html", true, true, "Modules/Chat");
$tpl->setVariable("SMILEY_TABLE", $table);
$tpl->setVariable("SMILEY_FORM", $this->form_gui->getHTML());
$this->tpl->setContent($tpl->get());
}

+ Here is the call graph for this function:

& ilObjChatServerGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 56 of file class.ilObjChatServerGUI.php.

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

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
include_once('Services/AccessControl/classes/class.ilPermissionGUI.php');
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if(!$cmd)
{
$cmd = 'view';
}
if ($cmd != 'update')
{
if(!$this->object->server_conf->isAlive())
{
(
$this->lng->txt('chat_cannot_connect_to_server') .
($cmd != 'edit' ? ' ' . $this->lng->txt('check_configuration') : '')
);
}
}
$cmd .= 'Object';
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjChatServerGUI::getAdminTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 654 of file class.ilObjChatServerGUI.php.

References $_GET.

{
global $rbacsystem,$rbacreview;
$this->ctrl->setParameter($this,'ref_id',$this->object->getRefId());
if($rbacsystem->checkAccess('read',$this->object->getRefId()))
{
$force_active = ($_GET['cmd'] == '' || $_GET['cmd'] == 'view')
? true
: false;
$tabs_gui->addTarget('chat_rooms',
$this->ctrl->getLinkTarget($this, 'view'), array('view', ''), get_class($this),
'', $force_active);
}
if($rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$force_active_edit = ($_GET["cmd"] == "edit") ? true : false;
$force_active_smilies = ($_GET["cmd"] == "edit") ? true : false;
$tabs_gui->addTarget("settings", $this->ctrl->getLinkTarget($this, "edit"), "edit", get_class($this),"", $force_active_edit);
$tabs_gui->addTarget("edit_smilies", $this->ctrl->getLinkTarget($this, "editSmilies"), "edit_smilies", get_class($this),"", $force_active_smilies);
}
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');
}
}
ilObjChatServerGUI::getValues ( )

Definition at line 418 of file class.ilObjChatServerGUI.php.

References ilObjectGUI\$data, and $ilSetting.

Referenced by editObject().

{
global $ilSetting;
$data = array();
$data['chat_internal_ip'] = $this->object->server_conf->getInternalIp();
$data['chat_external_ip'] = $this->object->server_conf->getExternalIp();
$data['chat_port'] = $this->object->server_conf->getPort();
$data['chat_ssl_status'] = $this->object->server_conf->getSSLStatus();
$data['chat_ssl_port'] = $this->object->server_conf->getSSLPort();
$data['chat_moderator'] = $this->object->server_conf->getModeratorPassword();
$data['chat_moderator_retype'] = $this->object->server_conf->getModeratorPassword();
$data['chat_logfile'] = $this->object->server_conf->getLogfile();
$data['chat_loglevel'] = $this->object->server_conf->getLogLevel();
$data['chat_allowed'] = $this->object->server_conf->getAllowedHosts();
$data['chat_active'] = $this->object->server_conf->getActiveStatus();
$data['chat_new_invitation_sound_status'] = (bool)$ilSetting->get('chat_new_invitation_sound_status');
$data['chat_new_message_sound_status'] = (bool)$ilSetting->get('chat_new_message_sound_status');
$data['chat_sound_status'] = (int)$ilSetting->get('chat_sound_status');
$data['chat_message_notify_status'] = (int) $ilSetting->get('chat_message_notify_status');
$data['chat_smilies_status'] = (int)$ilSetting->get('chat_smilies_status');
$data['chat_export_status'] = (int)$ilSetting->get('chat_export_status');
$data['chat_export_period'] = (int)$ilSetting->get('chat_export_period');
$this->form_gui->setValuesByArray($data);
}

+ Here is the caller graph for this function:

ilObjChatServerGUI::initForm (   $a_mode)

Definition at line 96 of file class.ilObjChatServerGUI.php.

References ilRadioOption\addSubItem(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilCheckboxInputGUI\setOptionTitle(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilRadioGroupInputGUI\setValue().

Referenced by editObject(), and updateObject().

{
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'update'));
if($this->object->server_conf->isAlive() or $this->object->server_conf->getActiveStatus())
{
// activation/deactivation of chat module
$sec_cd = new ilFormSectionHeaderGUI();
$sec_cd->setTitle($this->lng->txt('chat_ilias'));
$this->form_gui->addItem($sec_cd);
$sel = new ilSelectInputGUI($this->lng->txt('chat_status'), 'chat_active');
$options = array(
1 => $this->lng->txt('chat_active'),
0 => $this->lng->txt('chat_inactive')
);
$sel->setOptions($options);
$sel->setValue(1);
$this->form_gui->addItem($sel);
}
# else if(!$this->object->server_conf->isAlive() && $this->ctrl->getCmd() != 'update')
# {
# ilUtil::sendFailure($this->lng->txt('chat_cannot_connect_to_server'));
# }
// chat server settings
$sec_l = new ilFormSectionHeaderGUI();
$sec_l->setTitle($this->lng->txt('chat_server_settings'));
$this->form_gui->addItem($sec_l);
// sever internal ip
$inp = new ilTextInputGUI($this->lng->txt('chat_server_internal_ip'), 'chat_internal_ip');
$inp->setRequired(true);
$inp->setSize(40);
$inp->setMaxLength(128);
$this->form_gui->addItem($inp);
// server address
$inp = new ilTextInputGUI($this->lng->txt('chat_server_external_ip'), 'chat_external_ip');
$inp->setRequired(true);
$inp->setSize(40);
$inp->setMaxLength(128);
$this->form_gui->addItem($inp);
// server port
$inp = new ilTextInputGUI($this->lng->txt('chat_server_port'), 'chat_port');
$inp->setRequired(true);
$inp->setSize(5);
$inp->setMaxLength(5);
$this->form_gui->addItem($inp);
// ssl
$chb = new ilCheckboxInputGUI($this->lng->txt('chat_server_ssl_settings'), 'chat_ssl_status');
$chb->setOptionTitle($this->lng->txt('chat_server_ssl_active'));
$chb->setChecked(false);
$inp = new ilTextInputGUI($this->lng->txt('chat_server_ssl_port'), 'chat_ssl_port');
$inp->setSize(5);
$inp->setMaxLength(5);
$chb->addSubItem($inp);
$this->form_gui->addItem($chb);
// moderator password
$inp = new ilPasswordInputGUI($this->lng->txt('chat_moderator_password'), 'chat_moderator');
$inp->setRequired(true);
$inp->setSize(9);
$inp->setMaxLength(16);
$this->form_gui->addItem($inp);
// logfile path
$inp = new ilTextInputGUI($this->lng->txt('chat_server_logfile'), 'chat_logfile');
$inp->setSize(40);
$inp->setMaxLength(256);
$this->form_gui->addItem($inp);
// log level
$sel = new ilSelectInputGUI($this->lng->txt('chat_server_loglevel'), 'chat_loglevel');
$options = array(
1 => $this->lng->txt('chat_level_fatal'),
2 => $this->lng->txt('chat_level_error'),
3 => $this->lng->txt('chat_level_info'),
5 => $this->lng->txt('chat_level_debug'),
6 => $this->lng->txt('chat_level_all')
);
$sel->setOptions($options);
$sel->setValue(1);
$this->form_gui->addItem($sel);
// allowed hosts
$inp = new ilTextInputGUI($this->lng->txt('chat_server_allowed'), 'chat_allowed');
$inp->setInfo($this->lng->txt('chat_server_allowed_b'));
$inp->setRequired(true);
$inp->setSize(40);
$inp->setMaxLength(256);
$this->form_gui->addItem($inp);
// chat general settings
$sec_cd = new ilFormSectionHeaderGUI();
$sec_cd->setTitle($this->lng->txt('chat_general_settings'));
$this->form_gui->addItem($sec_cd);
// sound activation/deactivation for new chat invitations and messages
$rg = new ilRadioGroupInputGUI($this->lng->txt('chat_sounds'), 'chat_sound_status');
$rg->setValue(0);
$ro = new ilRadioOption($this->lng->txt('chat_sound_status_activate'), 1);
$chb = new ilCheckboxInputGUI('', 'chat_new_invitation_sound_status');
$chb->setOptionTitle($this->lng->txt('chat_new_invitation_sound_status'));
$chb->setChecked(false);
$ro->addSubItem($chb);
$chb = new ilCheckBoxInputGUI('','chat_new_message_sound_status');
$chb->setOptionTitle($this->lng->txt('chat_new_message_sound_status'));
$chb->setChecked(false);
$ro->addSubItem($chb);
$rg->addOption($ro);
$ro = new ilRadioOption($this->lng->txt('chat_sound_status_deactivate'), 0);
$rg->addOption($ro);
$this->form_gui->addItem($rg);
// chat message notification in ilias
$rg = new ilRadioGroupInputGUI($this->lng->txt('chat_message_notify'), 'chat_message_notify_status');
$rg->setValue(0);
$ro = new ilRadioOption($this->lng->txt('chat_message_notify_activate'), 1);
$rg->addOption($ro);
$ro = new ilRadioOption($this->lng->txt('chat_message_notify_deactivate'), 0);
$rg->addOption($ro);
$this->form_gui->addItem($rg);
// smilies
$rg = new ilRadioGroupInputGUI($this->lng->txt('chat_smilies_status'), 'chat_smilies_status');
$rg->setValue(0);
$ro = new ilRadioOption($this->lng->txt('chat_smilies_activate'), 1);
$rg->addOption($ro);
$ro = new ilRadioOption($this->lng->txt('chat_smilies_deactivate'), 0);
$rg->addOption($ro);
$this->form_gui->addItem($rg);
// message export permissions
$rg = new ilRadioGroupInputGUI($this->lng->txt('chat_export_status'), 'chat_export_status');
$ro = new ilRadioOption($this->lng->txt('chat_export_all'), 0);
$rg->addOption($ro);
$ro = new ilRadioOption($this->lng->txt('chat_export_moderator'), 1);
$rg->addOption($ro);
$rg->setInfo($this->lng->txt('chat_export_info'));
$this->form_gui->addItem($rg);
// message export period
$inp = new ilTextInputGUI($this->lng->txt('chat_export_period'), 'chat_export_period');
$inp->setInfo($this->lng->txt('chat_export_period_info'));
$inp->setValidationRegexp('/[1-9][0-9]{0,2}/');
$inp->setRequired(true);
$inp->setSize(5);
$inp->setMaxLength(3);
$this->form_gui->addItem($inp);
$this->form_gui->addCommandButton('update', $this->lng->txt('save'));
$this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjChatServerGUI::initSmiliesEditForm ( )

Definition at line 379 of file class.ilObjChatServerGUI.php.

References ilFormPropertyGUI\setRequired(), and ilTextAreaInputGUI\setUseRte().

Referenced by showEditSmileyEntryFormObject(), and updateSmiliesObject().

{
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form_gui = new ilPropertyFormGUI();
$table_nav = $_REQUEST["_table_nav"] ? "&_table_nav=".$_REQUEST["_table_nav"] : "";
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'update') . $table_nav);
// chat server settings
$sec_l = new ilFormSectionHeaderGUI();
$sec_l->setTitle($this->lng->txt('chat_edit_smiley'));
$this->form_gui->addItem($sec_l);
include_once "Modules/Chat/classes/class.ilChatSmiliesCurrentSmileyFormElement.php";
$inp = new ilChatSmiliesCurrentSmileyFormElement($this->lng->txt('chat_current_smiley_image_path'), 'chat_current_smiley_image_path');
$this->form_gui->addItem($inp);
$inp = new ilImageFileInputGUI($this->lng->txt('chat_image_path'), 'chat_image_path');
$inp->setRequired(false);
$inp->setInfo($this->lng->txt('chat_smiley_image_only_if_changed'));
$this->form_gui->addItem($inp);
$inp = new ilTextAreaInputGUI($this->lng->txt('chat_smiley_keywords'), 'chat_smiley_keywords');
$inp->setUseRte(false);
$inp->setRequired(true);
$inp->setInfo($this->lng->txt('chat_smiley_keywords_one_per_line_note'));
$this->form_gui->addItem($inp);
$inp = new ilHiddenInputGUI('chat_smiley_id');
$this->form_gui->addItem($inp);
$this->form_gui->addCommandButton('editSmilies', $this->lng->txt('cancel'));
$this->form_gui->addCommandButton('updateSmilies', $this->lng->txt('submit'));
//$this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjChatServerGUI::initSmiliesForm ( )

Definition at line 352 of file class.ilObjChatServerGUI.php.

References ilFormPropertyGUI\setRequired().

Referenced by editSmiliesObject(), and uploadSmileyObject().

{
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form_gui = new ilPropertyFormGUI();
$table_nav = $_REQUEST["_table_nav"] ? "&_table_nav=".$_REQUEST["_table_nav"] : "";
$this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'update'). $table_nav);
// chat server settings
$sec_l = new ilFormSectionHeaderGUI();
$sec_l->setTitle($this->lng->txt('chat_add_smiley'));
$this->form_gui->addItem($sec_l);
$inp = new ilImageFileInputGUI($this->lng->txt('chat_image_path'), 'chat_image_path');
$inp->setRequired(true);
$this->form_gui->addItem($inp);
$inp = new ilTextAreaInputGUI($this->lng->txt('chat_smiley_keywords'), 'chat_smiley_keywords');
$inp->setRequired(true);
$inp->setUseRte(false);
$inp->setInfo($this->lng->txt('chat_smiley_keywords_one_per_line_note'));
$this->form_gui->addItem($inp);
//$this->form_gui->addCommandButton('initialDB', $this->lng->txt('setup'));
$this->form_gui->addCommandButton('uploadSmiley', $this->lng->txt('chat_upload_smiley'));
//$this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjChatServerGUI::showDeleteSmileyFormObject ( )

Definition at line 489 of file class.ilObjChatServerGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilChatSmilies\_getSmiley().

{
global $rbacsystem, $lng, $ilCtrl;
$this->tabs_gui->setTabActive('edit_smilies');
if(!$rbacsystem->checkAccess('write', $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
}
$tpl = new ilTemplate("tpl.chat_smiley_confirm_delete.html", true, true, "Modules/Chat");
$tpl->setVariable("TXT_CONFIRM_DELETE_SMILEY", $lng->txt('chat_confirm_delete_smiley'));
$tpl->setVariable("TXT_CONFIRM_DELETE", $lng->txt('submit'));
$tpl->setVariable("TXT_CANCEL_DELETE", $lng->txt('cancel'));
$tpl->setVariable("SMILEY_ID", $_REQUEST["smiley_id"]);
//$tpl->setVariable("TABLE_NAV", $_REQUEST["_table_nav"]);
include_once 'Modules/Chat/classes/class.ilChatSmilies.php';
$smiley = ilChatSmilies::_getSmiley($_REQUEST["smiley_id"]);
$tpl->setVariable("SMILEY_PATH", $smiley["smiley_fullpath"]);
$tpl->setVariable("SMILEY_KEYWORDS", $smiley["smiley_keywords"]);
$table_nav = $_REQUEST["_table_nav"] ? "&_table_nav=".$_REQUEST["_table_nav"] : "";
$tpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this). $table_nav);
$tpl->parseCurrentBlock();
$this->tpl->setContent($tpl->get());
}

+ Here is the call graph for this function:

ilObjChatServerGUI::showEditSmileyEntryFormObject ( )

Definition at line 465 of file class.ilObjChatServerGUI.php.

References ilObjectGUI\$tpl, ilChatSmilies\_getSmiley(), and initSmiliesEditForm().

{
global $rbacsystem;
$this->tabs_gui->setTabActive('edit_smilies');
if(!$rbacsystem->checkAccess('read', $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
}
include_once "Modules/Chat/classes/class.ilChatSmilies.php";
$smiley = ilChatSmilies::_getSmiley($_REQUEST["smiley_id"]);
$form_data = array(
"chat_smiley_id" => $smiley["smiley_id"],
"chat_smiley_keywords" => $smiley["smiley_keywords"],
"chat_current_smiley_image_path" => $smiley["smiley_fullpath"],
);
$this->form_gui->setValuesByArray($form_data);
$tpl = new ilTemplate("tpl.chat_edit_smilies.html", true, true, "Modules/Chat");
$tpl->setVariable("SMILEY_FORM", $this->form_gui->getHTML());
$this->tpl->setContent($tpl->get());
}

+ Here is the call graph for this function:

ilObjChatServerGUI::updateObject ( )

updates object entry in object_data

public

Reimplemented from ilObjectGUI.

Definition at line 589 of file class.ilObjChatServerGUI.php.

References $_POST, $ilSetting, editObject(), initForm(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
global $rbacsystem, $ilSetting;
if(!$rbacsystem->checkAccess('write', $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
}
$this->tabs_gui->setTabActive('settings');
$this->initForm('edit');
if(!$this->form_gui->checkInput())
{
$this->form_gui->setValuesByPost();
$this->tpl->setContent($this->form_gui->getHtml());
return;
}
else
{
$this->object->server_conf->setInternalIp(ilUtil::stripSlashes($_POST['chat_internal_ip']));
$this->object->server_conf->setExternalIp(ilUtil::stripSlashes($_POST['chat_external_ip']));
$this->object->server_conf->setPort(ilUtil::stripSlashes($_POST['chat_port']));
$this->object->server_conf->setSSLStatus((int)$_POST['chat_ssl_status'] ? 1 : 0);
$this->object->server_conf->setSSLPort(ilUtil::stripSlashes($_POST['chat_ssl_port']));
$this->object->server_conf->setModeratorPassword(ilUtil::stripSlashes($_POST['chat_moderator']));
$this->object->server_conf->setLogfile(ilUtil::stripSlashes($_POST['chat_logfile']));
$this->object->server_conf->setLogLevel(ilUtil::stripSlashes($_POST['chat_loglevel']));
$this->object->server_conf->setAllowedHosts(ilUtil::stripSlashes($_POST['chat_allowed']));
$this->object->server_conf->validate();
$ilSetting->set('chat_sound_status', (int)$_POST['chat_sound_status']);
$ilSetting->set('chat_new_invitation_sound_status', (int)$_POST['chat_new_invitation_sound_status']);
$ilSetting->set('chat_new_message_sound_status', (int)$_POST['chat_new_message_sound_status']);
$ilSetting->set('chat_message_notify_status', (int)$_POST['chat_message_notify_status']);
$ilSetting->set('chat_smilies_status', (int)$_POST['chat_smilies_status']);
$ilSetting->set('chat_export_status', (int)$_POST['chat_export_status']);
$ilSetting->set('chat_export_period', (int)$_POST['chat_export_period']);
$this->object->server_conf->setActiveStatus((bool)$_POST['chat_active']);
$this->object->server_conf->updateStatus();
if(!$this->object->server_conf->update())
{
ilUtil::sendFailure($this->object->server_conf->getErrorMessage());
$this->form_gui->setValuesByPost();
$this->tpl->setContent($this->form_gui->getHtml());
return;
}
else
{
$this->form_gui->setValuesByPost();
}
}
ilUtil::sendSuccess($this->lng->txt('chat_settings_saved'), true);
return $this->editObject();
}

+ Here is the call graph for this function:

ilObjChatServerGUI::updateSmiliesObject ( )

Definition at line 555 of file class.ilObjChatServerGUI.php.

References ilObjectGUI\$data, $ilCtrl, ilChatSmilies\_getSmiliesBasePath(), ilChatSmilies\_prepareKeywords(), ilChatSmilies\_updateSmiley(), initSmiliesEditForm(), and ilUtil\stripSlashes().

{
global $rbacsystem, $ilCtrl;
if(!$rbacsystem->checkAccess('write', $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
}
include_once "Modules/Chat/classes/class.ilChatSmilies.php";
$keywords = ilChatSmilies::_prepareKeywords(ilUtil::stripSlashes($_REQUEST["chat_smiley_keywords"]));
$keywordscheck = count($keywords) > 0;
if(!$this->form_gui->checkInput() || !$keywordscheck) {
$this->tabs_gui->setTabActive('edit_properties');
$this->form_gui->setValuesByPost();
$this->tpl->setContent($this->form_gui->getHtml());
return;
}
else {
$data = array();
$data["smiley_keywords"] = join("\n", $keywords);
$data["smiley_id"] = $_REQUEST["chat_smiley_id"];
if ($_FILES["chat_image_path"]) {
move_uploaded_file($_FILES["chat_image_path"]["tmp_name"], ilChatSmilies::_getSmiliesBasePath() . $_FILES["chat_image_path"]["name"]);
$data["smiley_path"] = $_FILES["chat_image_path"]["name"];
}
}
//$this->editSmiliesObject();
$ilCtrl->redirect($this, "editSmilies");
}

+ Here is the call graph for this function:

ilObjChatServerGUI::uploadSmileyObject ( )

Definition at line 262 of file class.ilObjChatServerGUI.php.

References $ilCtrl, $ilSetting, ilChatSmilies\_getSmiliesBasePath(), ilChatSmilies\_prepareKeywords(), ilChatSmilies\_storeSmiley(), initSmiliesForm(), and ilUtil\stripSlashes().

{
global $rbacsystem, $ilSetting, $ilCtrl;
if(!$rbacsystem->checkAccess('write', $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
}
$this->initSmiliesForm();
include_once "Modules/Chat/classes/class.ilChatSmilies.php";
$keywords = ilChatSmilies::_prepareKeywords(ilUtil::stripSlashes($_REQUEST["chat_smiley_keywords"]));
$keywordscheck = count($keywords) > 0;
if(!$this->form_gui->checkInput())
{
$this->tabs_gui->setTabActive('edit_smilies');
$this->form_gui->setValuesByPost();
$this->tpl->setContent($this->form_gui->getHtml());
return;
}
$pathinfo = pathinfo($_FILES["chat_image_path"]["name"]);
$target_file = md5(time() + $pathinfo['basename']).".".$pathinfo['extension'];
move_uploaded_file($_FILES["chat_image_path"]["tmp_name"], ilChatSmilies::_getSmiliesBasePath() . $target_file);
ilChatSmilies::_storeSmiley(join("\n", $keywords), $target_file);
//$this->editSmiliesObject();
$ilCtrl->redirect($this, "editSmilies");
}

+ Here is the call graph for this function:

Field Documentation

ilObjChatServerGUI::$form_gui = null
private

Definition at line 40 of file class.ilObjChatServerGUI.php.


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