/** * Displays the title + grid */ public function display() { // action links $content = Display::actions(array(array('url' => 'event_type.php', 'content' => Display::return_icon('new_document.png', get_lang('Add'), array(), ICON_SIZE_MEDIUM)))); $content .= Display::grid_html('event_email_template'); return $content; }
/** * Get admin actions * @return string */ public static function getAdminActions() { $actions = array( //array('url' => api_get_path(WEB_CODE_PATH).'mySpace/index.php', 'content' => get_lang('Home')), array('url' => api_get_path(WEB_CODE_PATH).'mySpace/admin_view.php?display=coaches', 'content' => get_lang('DisplayCoaches')), array('url' => api_get_path(WEB_CODE_PATH).'mySpace/admin_view.php?display=user', 'content' => get_lang('DisplayUserOverview')), array('url' => api_get_path(WEB_CODE_PATH).'mySpace/admin_view.php?display=session', 'content' => get_lang('DisplaySessionOverview')), array('url' => api_get_path(WEB_CODE_PATH).'mySpace/admin_view.php?display=course', 'content' => get_lang('DisplayCourseOverview')), array('url' => api_get_path(WEB_CODE_PATH).'tracking/question_course_report.php?view=admin', 'content' => get_lang('LPQuestionListResults')), array('url' => api_get_path(WEB_CODE_PATH).'tracking/course_session_report.php?view=admin', 'content' => get_lang('LPExerciseResultsBySession')), ); return Display :: actions($actions, null); }
$users = UserManager::get_user_list(array(), array('firstname')); $new_user_list = array(); foreach ($users as $user) { if ($user['status'] == ANONYMOUS) { continue; } $new_user_list[] = $user; } /** * Header definition */ $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => 'event_controller.php', 'name' => get_lang('Events')); $tool_name = get_lang('EventMessageManagement'); Display::display_header($tool_name); echo Display::actions($action_array); /** * JavaScript code * @todo move into HTML header */ ?> <script> var usersList = <?php echo json_encode($new_user_list); ?> ; var eventTypes = <?php echo json_encode($ets); ?> ; var eventsConfig = <?php
$objQuestion->delete(); break; } //jqgrid will use this URL to do the selects $url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_course_exercise_medias'; //The order is important you need to check the the $column variable in the model.ajax.php file $columns = array(get_lang('Name'), get_lang('Actions')); //Column config $column_model = array(array('name' => 'name', 'index' => 'name', 'width' => '200', 'align' => 'left'), array('name' => 'actions', 'index' => 'actions', 'width' => '50', 'align' => 'left', 'formatter' => 'action_formatter', 'sortable' => 'false')); //Autowidth $extra_params['autowidth'] = 'true'; //height auto $extra_params['height'] = 'auto'; //With this function we can add actions to the jgrid (edit, delete, etc) $action_links = 'function action_formatter(cellvalue, options, rowObject) { return \'<a href="?action=edit&id=\'+options.rowId+\'">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>' . ' <a onclick="javascript:if(!confirm(' . "\\'" . addslashes(get_lang("ConfirmYourChoice")) . "\\'" . ')) return false;" href="?sec_token=' . $token . '&action=delete&id=\'+options.rowId+\'">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>' . '\'; }'; ?> <script> $(function() { <?php // grid definition see the $career->display() function echo Display::grid_js('medias', $url, $columns, $column_model, $extra_params, array(), $action_links, true); ?> }); </script> <?php $items = array(array('content' => Display::return_icon('add.png'), 'url' => $page_url . '&action=add')); echo Display::actions($items); echo Display::grid_html('medias'); Display::display_footer();