[svn r19597] first part of consistency improvements: form with form titles, no api_display_tool_title, actions bar, icons for actions.

skala
Patrick Cool 16 years ago
parent 0d5e7e9c42
commit 9240a20d6c
  1. 36
      main/admin/add_courses_to_session.php
  2. 12
      main/admin/calendar.lib.php
  3. 7
      main/admin/calendar.php
  4. 3
      main/admin/course_add.php
  5. 20
      main/admin/course_category.php
  6. 7
      main/admin/course_import.php
  7. 3
      main/admin/course_list.php
  8. 23
      main/admin/course_user_import.php
  9. 20
      main/admin/session_add.php
  10. 2
      main/admin/session_list.php
  11. 18
      main/admin/subscribe_user2course.php
  12. 26
      main/admin/system_announcements.php
  13. 3
      main/admin/user_add.php
  14. 3
      main/admin/user_edit.php
  15. 3
      main/admin/user_export.php
  16. 3
      main/admin/user_fields_add.php
  17. 3
      main/admin/user_import.php
  18. 3
      main/admin/user_list.php
  19. BIN
      main/img/multiple.gif
  20. BIN
      main/img/single.gif

@ -24,6 +24,7 @@
/**
==============================================================================
* @package dokeos.admin
* @todo use formvalidator
==============================================================================
*/
@ -36,6 +37,7 @@ $cidReset=true;
// including some necessary dokeos files
require('../inc/global.inc.php');
// including additonal libraries
require_once ('../inc/lib/xajax/xajax.inc.php');
require_once (api_get_path(LIBRARY_PATH).'sessionmanager.lib.php');
$xajax = new xajax();
@ -234,8 +236,27 @@ if ($_POST['formSent']) {
//header('Location: '.$_GET['page'].'?id_session='.$id_session);
}
// display the dokeos header
Display::display_header($tool_name);
api_display_tool_title($tool_name);
// display the tool title
// api_display_tool_title($tool_name);
if($add_type == 'multiple') {
$link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['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').'&nbsp;&nbsp;&nbsp;';
$link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>';
}
echo '<div class="actions">';
echo $link_add_type_unique.$link_add_type_multiple;
echo '</div>';
// the form header
echo '<div class="row"><div class="form_header">'.$tool_name.'</div></div>';
/*$sql = 'SELECT COUNT(1) FROM '.$tbl_course;
$rs = api_sql_query($sql, __FILE__, __LINE__);
$count_courses = mysql_result($rs, 0, 0);*/
@ -311,20 +332,11 @@ if ($ajax_search) {
unset($Courses);
if($add_type == 'multiple') {
$link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=unique">'.get_lang('SessionAddTypeUnique').'</a>';
$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
} else {
$link_add_type_unique = get_lang('SessionAddTypeUnique');
$link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.get_lang('SessionAddTypeMultiple').'</a>';
}
?>
<div style="text-align: left;">
<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
</div>
<br><br>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $_GET['page'] ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
<input type="hidden" name="formSent" value="1" />

@ -1340,14 +1340,12 @@ function show_add_form($id = '')
<input type="hidden" name="action" value="<?php if (isset($_GET['action'])) echo $_GET['action']; ?>" />
<input type="hidden" name="sort" value="asc" />
<input type="hidden" name="submit_event" value="ok" />
<?php
echo '<div class="row"><div class="form_header">';
echo (isset($id) AND $id<>'')?get_lang('ModifyCalendarItem'):get_lang("AddCalendarItem");
echo '</div></div>';
?>
<table border="0" cellpadding="5" cellspacing="0" width="80%" id="newedit_form">
<!-- the title -->
<tr class="title">
<td colspan="2" align="left">
<span style="font-weight: bold;"><?php echo (isset($id) AND $id<>'')?get_lang('ModifyCalendarItem'):get_lang("AddCalendarItem"); ?></span>
</td>
</tr>
<!-- START date and time -->
<tr>
<div>

@ -188,11 +188,8 @@ $tbl_session_course_user= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USE
// permission stuff - also used by loading from global in agenda.inc.php
$is_allowed_to_edit = is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous());
/* ==============================================================================
TITLE
============================================================================== */
// Displaying the title of the tool
api_display_tool_title($nameTools);
// api_display_tool_title($nameTools);
// tool introduction
//Display::display_introduction_section(TOOL_CALENDAR_EVENT);
@ -224,7 +221,7 @@ if (empty($select_year) && empty($select_month))
$select_month = $today['mon'];
}
echo '<div class="actions" style="float:left">';
echo '<div class="actions">';
if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous()))
{
display_student_links();

@ -1,5 +1,5 @@
<?php
// $Id: course_add.php 18230 2009-02-04 15:45:13Z juliomontoya $
// $Id: course_add.php 19597 2009-04-07 14:38:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -85,6 +85,7 @@ $maxlength = 40 - $dbnamelength;
// Build the form
$form = new FormValidator('update_course');
$form->addElement('header', '', $tool_name);
$form->add_textfield( 'visual_code', get_lang('CourseCode'),false,array('size'=>'20','maxlength'=>20));
$form->applyFilter('visual_code','strtoupper');
$form->addRule('wanted_code',get_lang('Max'),'maxlength',$maxlength);

@ -1,4 +1,4 @@
<?php // $Id: course_category.php 19261 2009-03-25 00:10:44Z cvargas1 $
<?php // $Id: course_category.php 19597 2009-04-07 14:38:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -24,6 +24,7 @@
/**
==============================================================================
* @package dokeos.admin
* @todo use formvalidator for the form
==============================================================================
*/
@ -35,6 +36,8 @@ $cidReset=true;
require('../inc/global.inc.php');
$this_section=SECTION_PLATFORM_ADMIN;
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
api_protect_admin_script();
$category=$_GET['category'];
$action=$_GET['action'];
@ -139,7 +142,20 @@ if($action == 'add' || $action == 'edit')
<a href="<?php echo api_get_self(); ?>?category=<?php echo Security::remove_XSS($category); ?>"><?php echo Display::return_icon('folder_up.gif').get_lang("Back"); if(!empty($category)) echo ' ('.Security::remove_XSS($category).')'; ?></a>
</div>
<h3><?php echo ($action == 'add')?get_lang('AddACategory'):get_lang('EditNode'); if(!empty($category)) echo ' '.get_lang('Into').' '.Security::remove_XSS($category); ?></h3>
<?php
$form_title = ($action == 'add')?get_lang('AddACategory'):get_lang('EditNode');
if(!empty($category))
{
$form_title .= ' '.get_lang('Into').' '.Security::remove_XSS($category);
}
$form = new FormValidator('course_category');
$form->addElement('header', '', $form_title);
$form->display();
?>
<form method="post" action="<?php echo api_get_self(); ?>?action=<?php echo Security::remove_XSS($action); ?>&category=<?php echo Security::remove_XSS($category); ?>&amp;id=<?php echo Security::remove_XSS($_GET['id']); ?>">
<input type="hidden" name="formSent" value="1" />

@ -148,6 +148,7 @@ require_once (api_get_path(LIBRARY_PATH).'import.lib.php');
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
require_once (api_get_path(CONFIGURATION_PATH).'add_course.conf.php');
require_once (api_get_path(LIBRARY_PATH).'add_course.lib.inc.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$formSent = 0;
$errorMsg = '';
$defined_auth_sources[] = PLATFORM_AUTH_SOURCE;
@ -162,7 +163,11 @@ $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAd
set_time_limit(0);
Display :: display_header($tool_name);
api_display_tool_title($tool_name);
$form = new FormValidator('update_course');
$form->addElement('header', '', $tool_name);
$form->display();
if ($_POST['formSent'])
{
if(empty($_FILES['import_file']['tmp_name']))

@ -1,4 +1,4 @@
<?php // $Id: course_list.php 19261 2009-03-25 00:10:44Z cvargas1 $
<?php // $Id: course_list.php 19597 2009-04-07 14:38:36Z pcool $
/* For licensing terms, see /dokeos_license.txt */
/**
* This script shows a list of courses and allows searching for courses codes
@ -192,6 +192,7 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced')
Display :: display_header($tool_name);
//api_display_tool_title($tool_name);
$form = new FormValidator('advanced_course_search', 'get');
$form->addElement('header', '', $tool_name);
$form->add_textfield('keyword_code', get_lang('CourseCode'), false);
$form->add_textfield('keyword_title', get_lang('Title'), false);
$categories = array();

@ -168,8 +168,13 @@ $language_file = array ('admin', 'registration');
$cidReset = true;
// including the global Dokeos file
include ('../inc/global.inc.php');
// protecting the admin section
api_protect_admin_script();
// including additional libraries
require_once (api_get_path(LIBRARY_PATH).'fileManage.lib.php');
require_once (api_get_path(LIBRARY_PATH).'import.lib.php');
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
@ -183,7 +188,10 @@ $tool_name = get_lang('AddUsersToACourse').' CSV';
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
set_time_limit(0);
// creating the form
$form = new FormValidator('course_user_import');
$form->addElement('header', '', $tool_name);
$form->addElement('file','import_file', get_lang('ImportFileLocation'));
$form->addElement('checkbox','subscribe',get_lang('Action'),get_lang('SubscribeUserIfNotAllreadySubscribed'));
$form->addElement('checkbox','unsubscribe','',get_lang('UnsubscribeUserIfSubscriptionIsNotInFile'));
@ -214,8 +222,14 @@ if ($form->validate()) {
exit ();
}
}
// displaying the header
Display :: display_header($tool_name);
api_display_tool_title($tool_name);
// displaying the tool title
// api_display_tool_title($tool_name);
if (count($errors) != 0) {
$error_message = '<ul>';
foreach ($errors as $index => $error_course) {
@ -227,6 +241,7 @@ if (count($errors) != 0) {
Display :: display_error_message($error_message);
}
// displaying the form
$form->display();
?>
<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
@ -243,10 +258,6 @@ echo STUDENT.': '.get_lang('Student').'<br />';
?>
</blockquote>
<?php
/*
==============================================================================
FOOTER
==============================================================================
*/
// footer
Display :: display_footer();
?>

@ -19,12 +19,22 @@
==============================================================================
*/
/**
==============================================================================
* @package dokeos.admin
* @todo use formvalidator for the form
==============================================================================
*/
// name of the language file that needs to be included
$language_file='admin';
$cidReset=true;
// including the global Dokeos file
require_once('../inc/global.inc.php');
// including additional libraries
require_once(api_get_path(LIBRARY_PATH).'sessionmanager.lib.php');
require_once('../inc/lib/xajax/xajax.inc.php');
$xajax = new xajax();
@ -139,15 +149,21 @@ $thisDay=date('d');
$tool_name = get_lang('AddSession');
//display the header
Display::display_header($tool_name);
api_display_tool_title($tool_name);
// display the tool title
// api_display_tool_title($tool_name);
if (!empty($return)) {
Display::display_error_message($return,false);
}
?>
<form method="post" name="form" action="<?php echo api_get_self(); ?>" style="margin:0px;">
<input type="hidden" name="formSent" value="1">
<div class="row"><div class="form_header"><?php echo $tool_name; ?></div></div>
<table border="0" cellpadding="5" cellspacing="0" width="550">
<tr>
<td width="30%"><?php echo get_lang('SessionName') ?>&nbsp;&nbsp;</td>

@ -119,7 +119,7 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
$nbr_results=sizeof($Sessions);
$tool_name = get_lang('SessionList');
Display::display_header($tool_name);
api_display_tool_title($tool_name);
//api_display_tool_title($tool_name);
if (!empty($_GET['warn'])) {
Display::display_warning_message(urldecode($_GET['warn']));

@ -1,5 +1,5 @@
<?php
// $Id: subscribe_user2course.php 19311 2009-03-25 15:40:27Z cvargas1 $
// $Id: subscribe_user2course.php 19597 2009-04-07 14:38:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -31,6 +31,7 @@
* 'Add to this(these) course(s)'.
*
* @package dokeos.admin
* @todo use formvalidator for the form
==============================================================================
*/
@ -47,7 +48,12 @@ $cidReset = true;
require ('../inc/global.inc.php');
$this_section=SECTION_PLATFORM_ADMIN;
// including additional libraries
require_once(api_get_path(LIBRARY_PATH).'course.lib.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
include_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
// security
api_protect_admin_script();
/*
-----------------------------------------------------------
@ -88,8 +94,15 @@ function validate_filter() {
</script>';
// displaying the header
Display :: display_header($tool_name);
api_display_tool_title($tool_name);
// displaying the tool title
// api_display_tool_title($tool_name);
$form = new FormValidator('subscribe_user2course');
$form->addElement('header', '', $tool_name);
$form->display();
/*
==============================================================================
@ -99,7 +112,6 @@ api_display_tool_title($tool_name);
//checking for extra field with filter on
include_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
$extra_field_list= UserManager::get_extra_fields();
$new_field_list = array();
if (is_array($extra_field_list)) {

@ -1,4 +1,4 @@
<?php // $Id: system_announcements.php 19566 2009-04-06 14:56:19Z juliomontoya $
<?php // $Id: system_announcements.php 19597 2009-04-07 14:38:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -39,8 +39,10 @@ $language_file = array ('admin', 'agenda');
// resetting the course id
$cidReset = true;
// including some necessary dokeos files
// including the global dokeos files
include ('../inc/global.inc.php');
// including additional libraries
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
include (api_get_path(LIBRARY_PATH).'system_announcements.lib.php');
include_once(api_get_path(LIBRARY_PATH).'WCAG/WCAG_rendering.php');
@ -63,11 +65,7 @@ if(empty($_GET['lang']))
$_GET['lang']=$_SESSION['user_language_choice'];
}
/*
-----------------------------------------------------------
Header
-----------------------------------------------------------
*/
// displaying the header
Display :: display_header($tool_name);
/*
@ -165,7 +163,17 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit')
if ($action_todo)
{
if ($_GET['action'] == 'add')
{
$form_title = get_lang('AddSystemAnnouncement');
}
elseif ($_GET['action'] == 'edit')
{
$form_title = get_lang('EditSystemAnnouncement');
}
$form = new FormValidator('system_announcement');
$form->addElement('header', '', $form_title);
$form->add_textfield('title', get_lang('Title'));
$language_list = api_get_languages();
$language_list_with_keys = array();
@ -191,9 +199,7 @@ if ($action_todo)
$form->addElement('hidden', 'action');
$form->addElement('hidden', 'id');
$form->addElement('checkbox', 'send_mail', get_lang('SendMail'));
$form->addElement('style_submit_button', 'submit', get_lang('Ok'),'class="save"');
$form->addElement('submit', 'submit', get_lang('Ok'));
if (api_get_setting('wcag_anysurfer_public_pages')=='true')
{
$values['content'] = WCAG_Rendering::HTML_to_text($values['content']);

@ -1,4 +1,4 @@
<?php // $Id: user_add.php 19251 2009-03-24 21:23:16Z cfasanando $
<?php // $Id: user_add.php 19597 2009-04-07 14:38:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -92,6 +92,7 @@ $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAd
$tool_name = get_lang('AddUsers');
// Create the form
$form = new FormValidator('user_add');
$form->addElement('header', '', $tool_name);
// Lastname
$form->addElement('text','lastname',get_lang('LastName'));
$form->applyFilter('lastname','html_filter');

@ -1,4 +1,4 @@
<?php // $Id: user_edit.php 19257 2009-03-24 23:17:44Z aportugal $
<?php // $Id: user_edit.php 19597 2009-04-07 14:38:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -96,6 +96,7 @@ $user_data = array_merge($user_data, Usermanager :: get_extra_user_data($user_id
// Create the form
$form = new FormValidator('user_add','post','','',array('style' => 'width: 60%; float: '.($text_dir=='rtl'?'right;':'left;')));
$form->addElement('header', '', $tool_name);
$form->addElement('hidden','user_id',$user_id);
// Lastname

@ -1,5 +1,5 @@
<?php
// $Id: user_export.php 19257 2009-03-24 23:17:44Z aportugal $
// $Id: user_export.php 19597 2009-04-07 14:38:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -73,6 +73,7 @@ while ($course = mysql_fetch_object($result))
$courses[$course->code] = $course->visual_code.' - '.$course->title;
}
$form = new FormValidator('export_users');
$form->addElement('header', '', $tool_name);
$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'XML','xml');
$form->addElement('radio', 'file_type', null, 'CSV','csv');
$form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang('YesAddCSVHeader'),'1');

@ -1,4 +1,4 @@
<?php // $Id: user_fields_add.php 19261 2009-03-25 00:10:44Z cvargas1 $
<?php // $Id: user_fields_add.php 19597 2009-04-07 14:38:36Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -102,6 +102,7 @@ else
}
// Create the form
$form = new FormValidator('user_fields_add');
$form->addElement('header', '', $tool_name);
// Field variable name
$form->addElement('hidden','fieldid',(int)$_GET['field_id']);
$form->addElement('text','fieldlabel',get_lang('FieldLabel'));

@ -1,4 +1,4 @@
<?php // $Id: user_import.php 19261 2009-03-25 00:10:44Z cvargas1 $
<?php // $Id: user_import.php 19597 2009-04-07 14:38:36Z pcool $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -350,6 +350,7 @@ if ($error_kind_file===true) {
Display :: display_error_message(get_lang('YouMustImportAFileAccordingToSelectedOption'));
}
$form = new FormValidator('user_import');
$form->addElement('header', '', $tool_name);
$form->addElement('hidden', 'formSent');
$form->addElement('file', 'import_file', get_lang('ImportFileLocation'));
$form->addRule('import_file', get_lang('ThisFieldIsRequired'), 'required');

@ -1,4 +1,4 @@
<?php // $Id: user_list.php 19534 2009-04-03 20:23:32Z aportugal $
<?php // $Id: user_list.php 19597 2009-04-07 14:38:36Z pcool $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -549,6 +549,7 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced')
Display :: display_header($tool_name);
//api_display_tool_title($tool_name);
$form = new FormValidator('advanced_search','get');
$form->addElement('header', '', $tool_name);
$form->add_textfield('keyword_firstname',get_lang('FirstName'),false);
$form->add_textfield('keyword_lastname',get_lang('LastName'),false);
$form->add_textfield('keyword_username',get_lang('LoginName'),false);

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Loading…
Cancel
Save