本文整理汇总了PHP中Display::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Display::url方法的具体用法?PHP Display::url怎么用?PHP Display::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: openid_form
function openid_form()
{
$form = new FormValidator('openid_login', 'post', null, null, array('class' => 'form-vertical form_login'));
$form->addElement('text', 'openid_url', array(get_lang('OpenIDURL'), Display::url(get_lang('OpenIDWhatIs'), 'main/auth/openid/whatis.php')), array('class' => 'openid_input'));
$form->addElement('button', 'submit', get_lang('Login'));
return $form->return_form();
}
示例2: prepare_skill_box
function prepare_skill_box($skill, $position, $class)
{
$block_id = $skill['id'];
$extra_class = 'third_window';
if ($skill['parent_id'] == 0) {
$extra_class = 'second_window';
}
$this->html .= '<div id="block_' . $block_id . '" class = "open_block window ' . $extra_class . ' ' . $class . '" style = "top:' . $position['y'] . 'px; left:' . $position['x'] . 'px;">';
/*$gradebook_string = '';
if (!empty($skill['gradebooks'])) {
foreach ($skill['gradebooks'] as $gradebook) {
//uncomment this to show the gradebook tags
$gradebook_string .= Display::span($gradebook['name'], array('class'=>'label_tag gradebook','style'=>'width:50px')).'<br />';
}
} */
$content = $skill['name'];
$content .= '<div class="btn-group">';
$content .= Display::url(get_lang('Edit'), '#', array('id' => 'edit_block_' . $block_id, 'class' => 'edit_block btn'));
$content .= Display::url('+', '#', array('id' => 'edit_block_' . $block_id, 'class' => 'edit_block btn'));
$content .= '</div>';
$this->html .= $content . ' ' . $gradebook_string;
if ($this->type == 'edit' && $skill['parent_id'] != 0) {
//$this->html .= Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), '#', array('id'=>'edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('add.png', get_lang('Add'), array(), ICON_SIZE_SMALL), '#', array('id'=>'edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL), '#', array('id=>"edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('up.png', get_lang('Close'), array(), ICON_SIZE_SMALL), '#', array('id'=>'close_block_'.$block_id,'class'=>'close_block'));
//$this->html .= Display::url(Display::return_icon('down.png', get_lang('Open'), array(), ICON_SIZE_SMALL), '#', array('id'=>'open_block_'.$block_id,'class'=>'open_block'));
}
$this->html .= '</div>';
}
示例3: display
/**
* Displays the title + grid
*/
function display()
{
// action links
echo '<div class="actions">';
echo '<a href="../admin/index.php">' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('PlatformAdmin'), '', '32') . '</a>';
echo '<a href="' . api_get_self() . '?action=add">' . Display::return_icon('new_class.png', get_lang('AddClasses'), '', '32') . '</a>';
echo Display::url(Display::return_icon('import_csv.png', get_lang('Import'), array(), ICON_SIZE_MEDIUM), 'usergroup_import.php');
echo Display::url(Display::return_icon('export_csv.png', get_lang('Export'), array(), ICON_SIZE_MEDIUM), 'usergroup_export.php');
echo '</div>';
echo Display::grid_html('usergroups');
}
示例4: getTopMenu
public static function getTopMenu()
{
$menu_items = array();
$menu_items[] = Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "auth/my_progress.php");
$menu_items[] = Display::url(Display::return_icon('teacher.png', get_lang('TeacherInterface'), array(), 32), api_get_path(WEB_CODE_PATH) . 'mySpace/?view=teacher');
$menu_items[] = Display::url(Display::return_icon('star_na.png', get_lang('AdminInterface'), array(), 32), '#');
$menu_items[] = Display::url(Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), 32), api_get_path(WEB_CODE_PATH) . 'tracking/exams.php');
$menu = null;
foreach ($menu_items as $item) {
$menu .= $item;
}
$menu .= '<br />';
return $menu;
}
示例5: openid_form
function openid_form()
{
//get_lang('OpenIdAuthentication')
$form = new FormValidator('openid_login', 'post', null, null, array('class' => 'form-vertical form_login'));
$form->addElement('text', 'openid_url', array(get_lang('OpenIDURL'), Display::url(get_lang('OpenIDWhatIs'), 'main/auth/openid/whatis.php')), array('class' => 'openid_input'));
$form->addElement('button', 'submit', get_lang('Login'));
return $form->return_form();
/*
return '<label for="openid_url">'.get_lang('OpenIDURL').' <a href="main/auth/openid/whatis.php" title="'.get_lang('OpenIDWhatIs').'">'.Display::return_icon('info3.gif',get_lang('Info')).'</a></label>
<input type="text" id="openid_url" name="openid_url" style="background: url(main/img/openid_small_logo.png) no-repeat; background-color: #fff; background-position: 0 50%; padding-left:18px;" value="http://"></input>
* <input type="submit" name="openid_login" value="'.get_lang('Enter').'" /><br /><br /></form></div>';
*
*/
}
示例6: prepare_skill_box
function prepare_skill_box($skill, $position, $class)
{
$block_id = $skill['id'];
$extra_class = 'third_window';
if ($skill['parent_id'] == 0) {
$extra_class = 'second_window';
}
$this->html .= '<div id="block_' . $block_id . '" class = "open_block window ' . $extra_class . ' ' . $class . '" style = "top:' . $position['y'] . 'px; left:' . $position['x'] . 'px;">';
$content = $skill['name'];
$content .= '<div class="btn-group">';
$content .= Display::url(get_lang('Edit'), '#', array('id' => 'edit_block_' . $block_id, 'class' => 'edit_block btn'));
$content .= Display::url('+', '#', array('id' => 'edit_block_' . $block_id, 'class' => 'edit_block btn'));
$content .= '</div>';
$this->html .= $content . ' ' . $gradebook_string;
if ($this->type == 'edit' && $skill['parent_id'] != 0) {
//$this->html .= Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), '#', array('id'=>'edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('add.png', get_lang('Add'), array(), ICON_SIZE_SMALL), '#', array('id'=>'edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL), '#', array('id=>"edit_block_'.$block_id,'class'=>'edit_block'));
//$this->html .= Display::url(Display::return_icon('up.png', get_lang('Close'), array(), ICON_SIZE_SMALL), '#', array('id'=>'close_block_'.$block_id,'class'=>'close_block'));
//$this->html .= Display::url(Display::return_icon('down.png', get_lang('Open'), array(), ICON_SIZE_SMALL), '#', array('id'=>'open_block_'.$block_id,'class'=>'open_block'));
}
$this->html .= '</div>';
}
示例7: get_activities_data
/**
* Get activities data to display
*/
static function get_activities_data($from, $number_of_items, $column, $direction)
{
global $dateTimeFormatLong;
$track_e_default = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$current_url_id = api_get_current_access_url_id();
$column = intval($column);
$from = intval($from);
$number_of_items = intval($number_of_items);
if (!in_array($direction, array('ASC', 'DESC'))) {
$direction = 'DESC';
}
if (api_is_multiple_url_enabled()) {
$sql = "SELECT " . "default_event_type as col0, " . "default_value_type as col1, " . "default_value as col2, " . "user.username as col3, " . "user.user_id as col4, " . "default_date as col5 " . "FROM {$track_e_default} as track_default, {$table_user} as user, {$access_url_rel_user_table} as url " . "WHERE track_default.default_user_id = user.user_id AND url.user_id=user.user_id AND access_url_id='" . $current_url_id . "'";
} else {
$sql = "SELECT " . "default_event_type as col0, " . "default_value_type as col1, " . "default_value as col2, " . "user.username as col3, " . "user.user_id as col4, " . "default_date as col5 " . "FROM {$track_e_default} track_default, {$table_user} user " . "WHERE track_default.default_user_id = user.user_id ";
}
if (isset($_GET['keyword'])) {
$keyword = Database::escape_string(trim($_GET['keyword']));
$sql .= " AND (user.username LIKE '%" . $keyword . "%' OR default_event_type LIKE '%" . $keyword . "%' OR default_value_type LIKE '%" . $keyword . "%' OR default_value LIKE '%" . $keyword . "%') ";
}
if (!empty($column) && !empty($direction)) {
$sql .= " ORDER BY col{$column} {$direction}";
} else {
$sql .= " ORDER BY col5 DESC ";
}
$sql .= " LIMIT {$from}, {$number_of_items} ";
$res = Database::query($sql);
$activities = array();
while ($row = Database::fetch_row($res)) {
if (strpos($row[1], '_object') === false) {
$row[2] = $row[2];
} else {
if (!empty($row[2])) {
$row[2] = unserialize($row[2]);
if (is_array($row[2]) && !empty($row[2])) {
$row[2] = Text::implode_with_key(', ', $row[2]);
}
}
}
if (!empty($row['default_date']) && $row['default_date'] != '0000-00-00 00:00:00') {
$row['default_date'] = api_get_local_time($row['default_date']);
} else {
$row['default_date'] = '-';
}
if (!empty($row[4])) {
//user ID
$row[3] = Display::url($row[3], api_get_path(WEB_CODE_PATH) . 'admin/user_information?user_id=' . $row[5], array('title' => get_lang('UserInfo')));
$row[4] = TrackingUserLog::get_ip_from_user_event($row[4], $row[5], true);
if (empty($row[4])) {
$row[4] = get_lang('Unknown');
}
}
$activities[] = $row;
}
return $activities;
}
示例8: getQuestions
//.........这里部分代码省略.........
$inject_where = $conditions['inject_where'];
$inject_extra_fields = $conditions['inject_extra_fields'];
$order = $conditions['order'];
$limit = $conditions['limit'];
if ($get_count == true) {
$select = " SELECT count(*) as total_rows";
} else {
$select = " SELECT s.*, {$inject_extra_fields} {$inject_question_fields} 1 ";
}
$extraCondition = null;
// Used by the question manager
if (!empty($categoryId)) {
$categoryRelQuestionTable = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$extraCondition = " INNER JOIN {$categoryRelQuestionTable} c ON (s.iid = c.question_id)";
$categoryId = intval($categoryId);
$where .= " AND category_id = {$categoryId} ";
}
/*if (!empty($exerciseId)) {
$exerciseRelQuestionTable = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$extraCondition .= " INNER JOIN $exerciseRelQuestionTable e ON (s.iid = e.question_id)";
$exerciseId = intval($exerciseId);
$where .= " AND exercice_id = $exerciseId ";
}*/
// Orphan questions
if ($isOrphanQuestion) {
//$exerciseRelQuestionTable = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
//$extraCondition .= " INNER JOIN $exerciseRelQuestionTable e ON (s.iid = e.question_id)";
$where .= " OR quizexercise.active = -1 OR quiz_rel_question.exercice_id IS NULL";
}
if (!empty($courseId)) {
$courseId = intval($courseId);
$where .= " AND s.c_id = {$courseId} ";
}
if (isset($options['question'])) {
$courseList = CourseManager::get_course_list_of_user_as_course_admin(api_get_user_id());
foreach ($options['question'] as $questionOption) {
if ($questionOption['field'] == 'question_c_id') {
if (isset($questionOption['data'])) {
if (!isset($courseList[$questionOption['data']])) {
return array();
}
}
}
}
}
//var_dump(CourseManager::get_teacher_list_from_course_code())
//var_dump($inject_joins);
$query = " {$select} FROM {$questionTable} s {$inject_joins} {$extraCondition} WHERE 1=1 {$where} {$inject_where} {$order} {$limit}";
//echo $query.'<br />';
//var_dump($extraCondition);
//var_dump($where);
$result = Database::query($query);
$questions = array();
$exerciseList = null;
if (!empty($exerciseId)) {
$exercise = new Exercise();
$exercise->read($exerciseId);
$exerciseList = $exercise->questionList;
}
if (Database::num_rows($result)) {
$questions = Database::store_result($result, 'ASSOC');
if ($get_count) {
return $questions[0]['total_rows'];
}
$previewIcon = Display::return_icon('preview.gif', get_lang('View'), array(), ICON_SIZE_SMALL);
$copyIcon = Display::return_icon('copy.png', get_lang('Copy'), array(), ICON_SIZE_SMALL);
$reuseIcon = Display::return_icon('view_more_stats.gif', get_lang('InsertALinkToThisQuestionInTheExercise'), array(), ICON_SIZE_SMALL);
$editIcon = Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL);
//$deleteIcon = Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
//var_dump($exerciseId);
// Including actions
foreach ($questions as &$question) {
$type = self::get_question_type($question['type']);
$question['type'] = get_lang($type[1]);
$question['question_question_type'] = get_lang($type[1]);
if (empty($exerciseId)) {
// View.
$actions = Display::url($previewIcon, $app['url_generator']->generate('admin_questions_show', array('id' => $question['iid'])));
// Edit.
$actions .= Display::url($editIcon, $app['url_generator']->generate('admin_questions_edit', array('id' => $question['iid'])));
} else {
// View.
$actions = Display::url($previewIcon, $app['url_generator']->generate('question_show', array('cidReq' => api_get_course_id(), 'id_session' => api_get_session_id(), 'exerciseId' => $exerciseId, 'id' => $question['iid'])));
if (isset($exerciseList) && !empty($exerciseList) && in_array($question['iid'], $exerciseList)) {
// Copy.
//$actions .= $copyIconDisabled;
} else {
// Copy.
$actions .= Display::url($copyIcon, 'javascript:void(0);', array('onclick' => 'ajaxAction(this);', 'data-url' => $app['url_generator']->generate('exercise_copy_question', array('cidReq' => api_get_course_id(), 'id_session' => api_get_session_id(), 'questionId' => $question['iid'], 'exerciseId' => $exerciseId))));
// Reuse.
$actions .= Display::url($reuseIcon, 'javascript:void(0);', array('onclick' => 'ajaxAction(this);', 'data-url' => $app['url_generator']->generate('exercise_reuse_question', array('cidReq' => api_get_course_id(), 'id_session' => api_get_session_id(), 'questionId' => $question['iid'], 'exerciseId' => $exerciseId))));
}
// Edit.
$actions .= Display::url($editIcon, $app['url_generator']->generate('exercise_question_edit', array('cidReq' => api_get_course_id(), 'id_session' => api_get_session_id(), 'id' => $question['iid'])));
}
$question['actions'] = $actions;
}
}
return $questions;
}
示例9: display_mymonthcalendar
/**
* Show the monthcalender of the given month
* @param array Agendaitems
* @param int Month number
* @param int Year number
* @param array Array of strings containing long week day names (deprecated, you can send an empty array instead)
* @param string The month name
* @return void Direct output
*/
function display_mymonthcalendar($user_id, $agendaitems, $month, $year, $weekdaynames = array(), $monthName, $show_content = true)
{
global $DaysShort, $course_path;
//Handle leap year
$numberofdays = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if ($year % 400 == 0 or $year % 4 == 0 and $year % 100 != 0) {
$numberofdays[2] = 29;
}
//Get the first day of the month
$dayone = getdate(mktime(0, 0, 0, $month, 1, $year));
//Start the week on monday
$startdayofweek = $dayone['wday'] != 0 ? $dayone['wday'] - 1 : 6;
$g_cc = isset($_GET['courseCode']) ? $_GET['courseCode'] : '';
$prev_icon = Display::return_icon('action_prev.png', get_lang('Previous'));
$next_icon = Display::return_icon('action_next.png', get_lang('Next'));
$next_month = $month == 1 ? 12 : $month - 1;
$prev_month = $month == 12 ? 1 : $month + 1;
$next_year = $month == 1 ? $year - 1 : $year;
$prev_year = $month == 12 ? $year + 1 : $year;
if ($show_content) {
$back_url = Display::url($prev_icon, api_get_self() . "?coursePath=" . urlencode($course_path) . "&courseCode=" . Security::remove_XSS($g_cc) . "&action=view&view=month&month=" . $next_month . "&year=" . $next_year);
$next_url = Display::url($next_icon, api_get_self() . "?coursePath=" . urlencode($course_path) . "&courseCode=" . Security::remove_XSS($g_cc) . "&action=view&view=month&month=" . $prev_month . "&year=" . $prev_year);
} else {
$back_url = Display::url($prev_icon, '', array('onclick' => "load_calendar('" . $user_id . "','" . $next_month . "', '" . $next_year . "'); "));
$next_url = Display::url($next_icon, '', array('onclick' => "load_calendar('" . $user_id . "','" . $prev_month . "', '" . $prev_year . "'); "));
}
echo '<table id="agenda_list"><tr>';
echo '<th width="10%">' . $back_url . '</th>';
echo '<th width="80%" colspan="5"><br /><h3>' . $monthName . " " . $year . '</h3></th>';
echo '<th width="10%">' . $next_url . '</th>';
echo '</tr>';
echo '<tr>';
for ($ii = 1; $ii < 8; $ii++) {
echo '<td class="weekdays">' . $DaysShort[$ii % 7] . '</td>';
}
echo '</tr>';
$curday = -1;
$today = getdate();
while ($curday <= $numberofdays[$month]) {
echo "<tr>";
for ($ii = 0; $ii < 7; $ii++) {
if ($curday == -1 && $ii == $startdayofweek) {
$curday = 1;
}
if ($curday > 0 && $curday <= $numberofdays[$month]) {
$bgcolor = $class = 'class="days_week"';
$dayheader = Display::div($curday, array('class' => 'agenda_day'));
if ($curday == $today['mday'] && $year == $today['year'] && $month == $today['mon']) {
$class = "class=\"days_today\" style=\"width:10%;\"";
}
echo "<td " . $class . ">" . $dayheader;
if (!empty($agendaitems[$curday])) {
$items = $agendaitems[$curday];
$items = ArrayClass::msort($items, 'start_date_tms');
foreach ($items as $value) {
$value['title'] = Security::remove_XSS($value['title']);
$start_time = api_format_date($value['start_date'], TIME_NO_SEC_FORMAT);
$end_time = '';
if (!empty($value['end_date']) && $value['end_date'] != '0000-00-00 00:00:00') {
$end_time = '- <i>' . api_format_date($value['end_date'], DATE_TIME_FORMAT_LONG) . '</i>';
}
$complete_time = '<i>' . api_format_date($value['start_date'], DATE_TIME_FORMAT_LONG) . '</i> ' . $end_time;
$time = '<i>' . $start_time . '</i>';
switch ($value['calendar_type']) {
case 'personal':
$bg_color = '#D0E7F4';
$icon = Display::return_icon('user.png', get_lang('MyAgenda'), array(), ICON_SIZE_SMALL);
break;
case 'global':
$bg_color = '#FFBC89';
$icon = Display::return_icon('view_remove.png', get_lang('GlobalEvent'), array(), ICON_SIZE_SMALL);
break;
case 'course':
$bg_color = '#CAFFAA';
$icon_name = 'course.png';
if (!empty($value['session_id'])) {
$icon_name = 'session.png';
}
if ($show_content) {
$icon = Display::url(Display::return_icon($icon_name, $value['course_name'] . ' ' . get_lang('Course'), array(), ICON_SIZE_SMALL), $value['url']);
} else {
$icon = Display::return_icon($icon_name, $value['course_name'] . ' ' . get_lang('Course'), array(), ICON_SIZE_SMALL);
}
break;
default:
break;
}
$result = '<div class="rounded_div_agenda" style="background-color:' . $bg_color . ';">';
if ($show_content) {
//Setting a personal event to green
$icon = Display::div($icon, array('style' => 'float:right'));
//.........这里部分代码省略.........
示例10: set_header_parameters
/**
* Set header parameters
*/
private function set_header_parameters()
{
global $httpHeadXtra, $_course, $interbreadcrumb, $language_file, $noPHP_SELF, $_configuration, $this_section;
$help = $this->help;
$nameTools = $this->title;
$navigation = return_navigation_array();
$this->menu_navigation = $navigation['menu_navigation'];
$this->assign('system_charset', api_get_system_encoding());
if (isset($httpHeadXtra) && $httpHeadXtra) {
foreach ($httpHeadXtra as & $thisHttpHead) {
header($thisHttpHead);
}
}
$this->assign('online_button', Display::return_icon('online.png'));
$this->assign('offline_button',Display::return_icon('offline.png'));
// Get language iso-code for this page - ignore errors
$this->assign('document_language', api_get_language_isocode());
$course_title = isset($_course['name']) ? $_course['name'] : null;
$title_list = array();
$title_list[] = api_get_setting('Institution');
$title_list[] = api_get_setting('siteName');
if (!empty($course_title)) {
$title_list[] = $course_title;
}
if ($nameTools != '') {
$title_list[] = $nameTools;
}
$title_string = '';
for ($i = 0; $i < count($title_list); $i++) {
$title_string .= $title_list[$i];
if (isset($title_list[$i + 1])) {
$item = trim($title_list[$i + 1]);
if (!empty($item)) {
$title_string .= ' - ';
}
}
}
$this->assign('title_string', $title_string);
//Setting the theme and CSS files
$this->set_css_files();
$this->set_js_files();
//$this->set_js_files_post();
$browser = api_browser_support('check_browser');
if ($browser[0] == 'Internet Explorer' && $browser[1] >= '11') {
$browser_head = '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />';
$this->assign('browser_specific_head', $browser_head);
}
// Implementation of prefetch.
// See http://cdn.chamilo.org/main/img/online.png for details
$prefetch = '';
if (!empty($_configuration['cdn_enable'])) {
$prefetch .= '<meta http-equiv="x-dns-prefetch-control" content="on">';
foreach ($_configuration['cdn'] as $host => $exts) {
$prefetch .= '<link rel="dns-prefetch" href="'.$host.'">';
}
}
$this->assign('prefetch', $prefetch);
$this->assign('text_direction', api_get_text_direction());
$this->assign('section_name', 'section-'.$this_section);
$favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_PATH).'favicon.ico" type="image/x-icon" />';
if (isset($_configuration['multiple_access_urls']) && $_configuration['multiple_access_urls']) {
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$url_info = api_get_access_url($access_url_id);
$url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url']));
$clean_url = replace_dangerous_char($url);
$clean_url = str_replace('/', '-', $clean_url);
$clean_url .= '/';
$homep = api_get_path(REL_PATH).'home/'.$clean_url; //homep for Home Path
$icon_real_homep = api_get_path(SYS_PATH).'home/'.$clean_url;
//we create the new dir for the new sites
if (is_file($icon_real_homep.'favicon.ico')) {
$favico = '<link rel="shortcut icon" href="'.$homep.'favicon.ico" type="image/x-icon" />';
}
}
}
$this->assign('favico', $favico);
$this->set_help();
//.........这里部分代码省略.........
示例11: get_header_names
/**
* Get array containing column header names (incl user columns)
* @param int $items_start Start item offset
* @param int $items_count Number of items to get
* @param bool $show_detail whether to show the details or not
* @return array List of headers
*/
public function get_header_names($items_start = 0, $items_count = null, $show_detail = false)
{
$headers = array();
if (isset($this->params['show_official_code']) && $this->params['show_official_code']) {
$headers[] = get_lang('OfficialCode');
}
if (isset($this->params['join_firstname_lastname']) && $this->params['join_firstname_lastname']) {
if (api_is_western_name_order()) {
$headers[] = get_lang('FirstnameAndLastname');
} else {
$headers[] = get_lang('LastnameAndFirstname');
}
} else {
if (api_is_western_name_order()) {
$headers[] = get_lang('FirstName');
$headers[] = get_lang('LastName');
} else {
$headers[] = get_lang('LastName');
$headers[] = get_lang('FirstName');
}
}
if (!isset($items_count)) {
$items_count = count($this->evals_links) - $items_start;
}
$parent_id = $this->category->get_parent_id();
if ($parent_id == 0 or $this->params['only_subcat'] == $this->category->get_id()) {
$main_weight = $this->category->get_weight();
$grade_model_id = $this->category->get_grade_model_id();
} else {
$main_cat = Category::load($parent_id, null, null);
$main_weight = $main_cat[0]->get_weight();
$grade_model_id = $main_cat[0]->get_grade_model_id();
}
$use_grade_model = true;
if (empty($grade_model_id) || $grade_model_id == -1) {
$use_grade_model = false;
}
//@todo move these in a function
$sum_categories_weight_array = array();
$mainCategoryId = null;
$mainCourseCategory = $this->getMainCourseCategory();
if (!empty($mainCourseCategory)) {
$mainCategoryId = $mainCourseCategory->get_id();
}
if (isset($this->category) && !empty($this->category)) {
$categories = Category::load(null, null, null, $this->category->get_id());
if (!empty($categories)) {
foreach ($categories as $category) {
$sum_categories_weight_array[$category->get_id()] = $category->get_weight();
}
} else {
$sum_categories_weight_array[$this->category->get_id()] = $this->category->get_weight();
}
}
//No category was added
$course_code = api_get_course_id();
$session_id = api_get_session_id();
$allcat = $this->category->get_subcategories(null, $course_code, $session_id, 'ORDER BY id');
$evaluationsAdded = array();
if ($parent_id == 0 && !empty($allcat)) {
//Means there are any subcategory
foreach ($allcat as $sub_cat) {
$sub_cat_weight = round(100 * $sub_cat->get_weight() / $main_weight, 1);
$add_weight = " {$sub_cat_weight} %";
/*if (isset($this->params['export_pdf']) && $this->params['export_pdf']) {
$add_weight = null;
}*/
$headers[] = Display::url($sub_cat->get_name(), api_get_self() . '?selectcat=' . $sub_cat->get_id()) . $add_weight;
}
} else {
if (!isset($this->params['only_total_category']) || isset($this->params['only_total_category']) && $this->params['only_total_category'] == false) {
for ($count = 0; $count < $items_count && $items_start + $count < count($this->evals_links); $count++) {
$item = $this->evals_links[$count + $items_start];
$weight = round(100 * $item->get_weight() / $main_weight, 1);
$headers[] = $item->get_name() . ' ' . $weight . ' % ';
$evaluationsAdded[] = $item->get_id();
}
}
}
if (!empty($mainCategoryId)) {
for ($count = 0; $count < $items_count && $items_start + $count < count($this->evals_links); $count++) {
/** @var AbstractLink $item */
$item = $this->evals_links[$count + $items_start];
if ($mainCategoryId == $item->get_category_id() && !in_array($item->get_id(), $evaluationsAdded)) {
$weight = round(100 * $item->get_weight() / $main_weight, 1);
$headers[] = $item->get_name() . ' ' . $weight . ' % ';
}
}
}
$headers[] = api_strtoupper(get_lang('GradebookQualificationTotal'));
return $headers;
}
示例12: header
//Redirect to the reporting
header('location: ../mySpace/myStudents.php?origin=' . $origin . '&student=' . $student_id . '&details=true&course=' . $course_id . '&session_id=' . $session_id);
exit;
}
}
}
$actions = null;
if ($is_allowedToEdit && $origin != 'learnpath') {
// the form
if (api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) {
$actions .= '<a href="admin.php?exerciseId=' . intval($_GET['exerciseId']) . '">' . Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>';
$actions .= '<a href="live_stats.php?' . api_get_cidreq() . '&exerciseId=' . $exercise_id . '">' . Display::return_icon('activity_monitor.png', get_lang('LiveResults'), '', ICON_SIZE_MEDIUM) . '</a>';
$actions .= '<a href="stats.php?' . api_get_cidreq() . '&exerciseId=' . $exercise_id . '">' . Display::return_icon('statistics.png', get_lang('ReportByQuestion'), '', ICON_SIZE_MEDIUM) . '</a>';
$actions .= '<a id="export_opener" href="' . api_get_self() . '?export_report=1&exerciseId=' . intval($_GET['exerciseId']) . '" >' . Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM) . '</a>';
// clean result before a selected date icon
$actions .= Display::url(Display::return_icon('clean_before_date.png', get_lang('CleanStudentsResultsBeforeDate'), '', ICON_SIZE_MEDIUM), '#', array('onclick' => "javascript:display_date_picker()"));
// clean result before a selected date datepicker popup
$actions .= Display::span(Display::input('input', 'datepicker_start', get_lang('SelectADateOnTheCalendar'), array('onmouseover' => 'datepicker_input_mouseover()', 'id' => 'datepicker_start', 'onchange' => 'datepicker_input_changed()', 'readonly' => 'readonly')) . Display::button('delete', get_lang('Delete'), array('onclick' => 'submit_datepicker()')), array('style' => 'display:none', 'id' => 'datepicker_span'));
}
} else {
$actions .= '<a href="exercise.php">' . Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>';
}
//Deleting an attempt
if (($is_allowedToEdit || $is_tutor || api_is_coach()) && isset($_GET['delete']) && $_GET['delete'] == 'delete' && !empty($_GET['did']) && $locked == false) {
$exe_id = intval($_GET['did']);
if (!empty($exe_id)) {
$sql = 'DELETE FROM ' . $TBL_TRACK_EXERCISES . ' WHERE exe_id = ' . $exe_id;
Database::query($sql);
$sql = 'DELETE FROM ' . $TBL_TRACK_ATTEMPT . ' WHERE exe_id = ' . $exe_id;
Database::query($sql);
header('Location: exercise_report.php?' . api_get_cidreq() . '&exerciseId=' . $exercise_id);
示例13: api_get_session_id
$session_id = api_get_session_id();
}
// Breadcrumbs.
if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'session/session_list.php', 'name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . api_get_session_id(), 'name' => get_lang('SessionOverview'));
}
$nameTools = get_lang('Tracking');
// Display the header.
Display::display_header($nameTools, 'Tracking');
/* MAIN CODE */
echo '<div class="actions">';
echo Display::url(Display::return_icon('user.png', get_lang('StudentsTracking'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'tracking/courseLog.php?' . api_get_cidreq());
echo Display::url(Display::return_icon('group.png', get_lang('GroupReporting'), array(), ICON_SIZE_MEDIUM), 'course_log_groups.php?' . api_get_cidreq(true, false));
echo Display::url(Display::return_icon('course.png', get_lang('CourseTracking'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'tracking/course_log_tools.php?' . api_get_cidreq());
echo Display::return_icon('tools_na.png', get_lang('ResourcesTracking'), array(), ICON_SIZE_MEDIUM);
echo '<span style="float:right; padding-top:0px;">';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">' . Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM) . '</a>';
$addional_param = '';
if (isset($_GET['additional_profile_field'])) {
$addional_param = 'additional_profile_field=' . intval($_GET['additional_profile_field']);
}
$users_tracking_per_page = '';
if (isset($_GET['users_tracking_per_page'])) {
$users_tracking_per_page = '&users_tracking_per_page=' . intval($_GET['users_tracking_per_page']);
}
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&export=csv&' . $addional_param . $users_tracking_per_page . '">
' . Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '</span>';
echo '</div>';
示例14: api_get_self
}
}
return $xajax_response;
}
$xajax->processRequests();
Display::display_header($tool_name);
if ($add_type == 'multiple') {
$link_add_type_unique = '<a href="' . api_get_self() . '?add=' . $add . '&add_type=unique">' . Display::return_icon('single.gif') . get_lang('SessionAddTypeUnique') . '</a>';
$link_add_type_multiple = Display::return_icon('multiple.gif') . get_lang('SessionAddTypeMultiple');
} else {
$link_add_type_unique = Display::return_icon('single.gif') . get_lang('SessionAddTypeUnique');
$link_add_type_multiple = '<a href="' . api_get_self() . '?add=' . $add . '&add_type=multiple">' . Display::return_icon('multiple.gif') . get_lang('SessionAddTypeMultiple') . '</a>';
}
echo '<div class="actions">';
echo '<a href="usergroups.php">' . Display::return_icon('back.png', get_lang('Back'), array(), ICON_SIZE_MEDIUM) . '</a>';
echo Display::url(get_lang('AdvancedSearch'), '#', array('class' => 'advanced_options', 'id' => 'advanced_search'));
echo '</div>';
echo '<div id="advanced_search_options" style="display:none">';
$searchForm->display();
echo '</div>';
?>
<form name="formulaire" method="post" action="<?php
echo api_get_self();
?>
?id=<?php
echo $id;
if (!empty($_GET['add'])) {
echo '&add=true';
}
?>
示例15: modify_filter
/**
* Build the modify-column of the table
* @param int $user_id The user id
* @return string Some HTML-code
*/
function modify_filter($user_id, $row, $data)
{
global $is_allowed_to_track, $charset;
$user_id = $data[0];
$course_info = $_course = api_get_course_info();
$current_user_id = api_get_user_id();
$sessionId = api_get_session_id();
$type = isset($_REQUEST['type']) ? intval($_REQUEST['type']) : STUDENT;
$result = "";
if ($is_allowed_to_track) {
$result .= '<a href="../mySpace/myStudents.php?' . api_get_cidreq() . '&student=' . $user_id . '&details=true&course=' . $_course['id'] . '&origin=user_course&id_session=' . api_get_session_id() . '" title="' . get_lang('Tracking') . '" >
<img border="0" alt="' . get_lang('Tracking') . '" src="../img/icons/22/stats.png" />
</a>';
}
// If platform admin, show the login_as icon (this drastically shortens
// time taken by support to test things out)
if (api_is_platform_admin()) {
$result .= ' <a href="' . api_get_path(WEB_CODE_PATH) . 'admin/user_list.php?action=login_as&user_id=' . $user_id . '&sec_token=' . $_SESSION['sec_token'] . '">' . Display::return_icon('login_as.gif', get_lang('LoginAs')) . '</a> ';
}
if (api_is_allowed_to_edit(null, true)) {
if (empty($sessionId)) {
$isTutor = isset($data['is_tutor']) ? intval($data['is_tutor']) : 0;
$isTutor = empty($isTutor) ? 1 : 0;
$text = get_lang('RemoveTutorStatus');
if ($isTutor) {
$text = get_lang('SetTutor');
}
$disabled = '';
if ($data['user_status_in_course'] == STUDENT) {
$result .= Display::url($text, 'user.php?' . api_get_cidreq() . '&action=set_tutor&is_tutor=' . $isTutor . '&user_id=' . $user_id . '&type=' . $type, array('class' => 'btn btn-default ' . $disabled)) . ' ';
}
}
// edit
if (api_get_setting('allow_user_course_subscription_by_course_admin') == 'true' or api_is_platform_admin()) {
// unregister
if ($user_id != $current_user_id || api_is_platform_admin()) {
$result .= '<a class="btn btn-small btn-danger" href="' . api_get_self() . '?' . api_get_cidreq() . '&type=' . $type . '&unregister=yes&user_id=' . $user_id . '" title="' . get_lang('Unreg') . ' " onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . '\')) return false;">' . get_lang('Unreg') . '</a> ';
} else {
//$result .= Display::return_icon('unsubscribe_course_na.png', get_lang('Unreg'),'',ICON_SIZE_SMALL).'</a> ';
}
}
} else {
// Show buttons for unsubscribe
if ($course_info['unsubscribe'] == 1) {
if ($user_id == $current_user_id) {
$result .= '<a class="btn btn-small btn-danger" href="' . api_get_self() . '?' . api_get_cidreq() . '&type=' . $type . '&unregister=yes&user_id=' . $user_id . '" title="' . get_lang('Unreg') . ' " onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . '\')) return false;">' . get_lang('Unreg') . '</a> ';
}
}
}
return $result;
}