/** * public static function getDropdown( $label_name, $id, $name, $all_value , $selected = '', $other_after = '', $other_before = '' ) * * @param string $label_name text contained into the label * @param string $id the id of the element * @param string $name the name of the element * @param string $all_value all the possible value of the select element * @param string $selected the element selected * @param string $other_after html code added after the select element * @param string $other_before html code added before the label element * * @return string with the html code for a line with the select element */ public static function getDropdown($label_name, $id, $name, $all_value, $selected = '', $other_after = '', $other_before = '', $other_param = '') { return Form::getLineDropdown('form_line_l', 'floating', $label_name, 'dropdown', $id, $name, $all_value, $selected, $other_param, $other_after, $other_before); }
function addmessage() { $send_all = true; // checkPerm('send_all', true); $send_upper = true; // checkPerm('send_upper', true); if (!$send_all && !$send_upper) { die("You can't access"); } require_once _base_ . '/lib/lib.userselector.php'; require_once _lms_ . '/lib/lib.course.php'; $lang =& DoceboLanguage::createInstance('message', 'lms'); $out = $GLOBALS['page']; $out->setWorkingZone('content'); $from = importVar('out'); $um =& UrlManager::getInstance("message"); $aclManager = new DoceboACLManager(); $user_select = new UserSelector(); $user_select->show_user_selector = TRUE; $user_select->show_group_selector = FALSE; $user_select->show_orgchart_selector = FALSE; $user_select->show_fncrole_selector = FALSE; $user_select->nFields = 0; if (isset($_POST['message']['recipients'])) { $recipients = unserialize(urldecode($_POST['message']['recipients'])); $user_select->resetSelection($recipients); } $me = array(getLogUserId()); $course_man = new Man_Course(); $all_value = array(0 => Lang::t('_ALL_COURSES')); $all_courses = $course_man->getUserCourses(getLogUserId()); $all_value = $all_value + $all_courses; if (count($all_value) > 0) { $drop = Form::getLineDropdown('form_line_right', 'label_padded', Lang::t('_FILTER_MESSAGE_FOR'), 'dropdown_nowh', 'msg_course_filter', 'msg_course_filter', $all_value, isset($_POST['msg_course_filter']) ? $_POST['msg_course_filter'] : (isset($_SESSION['idCourse']) ? $_SESSION['idCourse'] : 0), '', ' ' . Form::getButton('refresh_msg_filter', 'refresh_msg_filter', Lang::t('_REFRESH'), 'button_nowh'), ''); $drop .= "\r\n\t\t\t\t<script type=\"text/javascript\"><!--\r\n\t\t\t\t\tvar hide_refresh = document.getElementById('refresh_msg_filter');\r\n\t\t\t\t\thide_refresh.style.display = 'none';\r\n\t\t\t\t\tvar option_elem = document.getElementById('msg_course_filter');\r\n\t\t\t\t\toption_elem.onchange = function() {\r\n\t\t\t\t\t\tvar hide_refresh = document.getElementById('refresh_msg_filter');\r\n\t\t\t\t\t\thide_refresh.click();\r\n\t\t\t\t\t}\r\n\t\t\t\t--></script>"; $user_select->addFormInfo($drop); } else { $user_select->addFormInfo(Form::getHidden("msg_course_filter", "msg_course_filter", 0)); } $user_select->setUserFilter('exclude', $me); if (isset($_POST['msg_course_filter'])) { $filter = $_POST['msg_course_filter']; } elseif (isset($_GET['set_course_filter'])) { $filter = $_GET['set_course_filter']; } else { $filter = 0; } $_SESSION['message_filter'] = $filter; $user_select->learning_filter = 'message'; //$user_select->requested_tab = PEOPLEVIEW_TAB; $id_forward = importVar('id_forward', true, 0); $title_url = $this->mvc_urls ? "index.php?r=message/show" . ($from == 'out' ? '&active_tab=outbox' : '') : $um->getUrl($from == 'out' ? '&active_tab=outbox' : ''); $user_select->setPageTitle($this->messageGetTitleArea(array($title_url => Lang::t('_MESSAGES'), Lang::t('_SEND')), 'forum')); $load_url = $this->mvc_urls ? 'index.php?r=message/add&id_forward=' . $id_forward . '' . ($from == 'out' ? '&from=out' : '') : $um->getUrl('op=addmessage&id_forward=' . $id_forward . '' . ($from == 'out' ? '&from=out' : '')); $user_select->loadSelector($load_url, false, Lang::t('_RECIPIENTS'), true); }