ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMailSearchCoursesTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 include_once('Services/Table/classes/class.ilTable2GUI.php');
13 
14 
16 {
17  protected $lng = null;
18  protected $ctrl;
19  protected $parentObject;
20  protected $mode;
21  protected $mailing_allowed;
22 
32  public function __construct($a_parent_obj, $type='crs', $context='mail')
33  {
34  global $lng,$ilCtrl, $ilUser, $lng, $rbacsystem;
35 
36  $lng->loadLanguageModule('crs');
37 
38  if($context == "mail")
39  {
40  // check if current user may send mails
41  include_once "Services/Mail/classes/class.ilMail.php";
42  $mail = new ilMail($_SESSION["AccountId"]);
43  $this->mailing_allowed = $rbacsystem->checkAccess('internal_mail',$mail->getMailObjectReferenceId());
44  }
45 
46  $mode = array();
47 
48  if ($type == "crs")
49  {
50  $mode["short"] = "crs";
51  $mode["long"] = "course";
52  $mode["checkbox"] = "search_crs";
53  $mode["tableprefix"] = "crstable";
54  $mode["lng_mail"] = $lng->txt("mail_my_courses");
55  $mode["view"] = "mycourses";
56  $this->setTitle($mode["lng_mail"]);
57  }
58  else if ($type == "grp")
59  {
60  $mode["short"] = "grp";
61  $mode["long"] = "group";
62  $mode["checkbox"] = "search_grp";
63  $mode["tableprefix"] = "grptable";
64  $mode["lng_mail"] = $lng->txt("mail_my_groups");
65  $mode["view"] = "mygroups";
66  $this->setTitle($mode["lng_mail"]);
67  }
68 
69  $this->setId('search_' . $mode["short"]);
70  parent::__construct($a_parent_obj);
71 
72  //$this->courseIds = $crs_ids;
73  $this->parentObject = $a_parent_obj;
74  $this->mode = $mode;
75  $this->context = $context;
76 
77  $ilCtrl->setParameter($a_parent_obj, 'view', $mode['view']);
78  if ($_GET['ref'] != '')
79  $ilCtrl->setParameter($a_parent_obj, 'ref', $_GET['ref']);
80  if (is_array($_POST[$mode["checkbox"]]))
81  $ilCtrl->setParameter($a_parent_obj, $mode["checkbox"], implode(',', $_POST[$mode["checkbox"]]));
82 
83  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
84  $ilCtrl->clearParameters($a_parent_obj);
85 
86  $this->setSelectAllCheckbox($mode["checkbox"].'[]');
87  $this->setRowTemplate('tpl.mail_search_courses_row.html', 'Services/Contact');
88 
89  $this->setShowRowsSelector(true);
90 
91  // setup columns
92  $this->addColumn('', '', '1px', true);
93  $this->addColumn($mode["lng_mail"], 'CRS_NAME', '30%');
94  $this->addColumn($lng->txt('path'), 'CRS_PATH', '30%');
95  $this->addColumn($lng->txt('crs_count_members'), 'CRS_NO_MEMBERS', '20%');
96  $this->addColumn($lng->txt('actions'), '', '19%');
97 
98  if($context == "mail")
99  {
100  if ($this->mailing_allowed)
101  $this->addMultiCommand('mail',$lng->txt('mail_members'));
102  }
103  else if($context == "wsp")
104  {
105  $lng->loadLanguageModule("wsp");
106  $this->addMultiCommand('share',$lng->txt('wsp_share_with_members'));
107  }
108  $this->addMultiCommand('showMembers',$lng->txt('mail_list_members'));
109 
110  if ($_GET['ref'] == 'mail')
111  $this->addCommandButton('cancel', $lng->txt('cancel'));
112  }
113 
121  public function fillRow($a_set)
122  {
123  if ($a_set['hidden_members'])
124  {
125  $this->tpl->setCurrentBlock('caption_asterisk');
126  $this->tpl->touchBlock('caption_asterisk');
127  $this->tpl->parseCurrentBlock();
128  }
129  foreach ($a_set as $key => $value)
130  {
131  $this->tpl->setVariable(strtoupper($key), $value);
132  }
133  $this->tpl->setVariable('SHORT', $this->mode["short"]);
134  }
135 
136  public function numericOrdering($column)
137  {
138  if($column == 'CRS_NO_MEMBERS') return true;
139  }
140 }
141 ?>
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
Class Mail this class handles base functions for mail handling.
__construct($a_parent_obj, $type='crs', $context='mail')
Constructor.
addMultiCommand($a_cmd, $a_text)
Add Command button.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="")
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
global $ilUser
Definition: imgupload.php:15
setFormAction($a_form_action)
Set Form action parameter.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.