Browse Source

Minor UI improvements.

Julio Montoya 11 years ago
parent
commit
dd6bba3d05
3 changed files with 8 additions and 9 deletions
  1. 6 4
      main/work/add_document.php
  2. 1 4
      main/work/add_user.php
  3. 1 1
      main/work/work_list_all.php

+ 6 - 4
main/work/add_document.php

@@ -56,10 +56,10 @@ switch ($action) {
 Display :: display_header(null);
 
 if (empty($docId)) {
-    echo Display::page_subheader(get_lang('DocumentsAdded'));
-
     $documents = getAllDocumentToWork($workId, api_get_course_int_id());
     if (!empty($documents)) {
+
+        echo Display::page_subheader(get_lang('DocumentsAdded'));
         echo '<div class="well">';
         foreach ($documents as $doc) {
             $documentId = $doc['document_id'];
@@ -75,7 +75,7 @@ if (empty($docId)) {
     }
 
     $document_tree = DocumentManager::get_document_preview($courseInfo, null, null, 0, false, '/', api_get_path(WEB_CODE_PATH).'work/add_document.php?id='.$workId);
-    echo Display::page_subheader(get_lang('DocumentToAdd'));
+    echo Display::page_subheader(get_lang('Documents'));
     echo $document_tree;
     echo '<hr /><div class="clear"></div>';
 
@@ -99,7 +99,9 @@ if (empty($docId)) {
 
         if (empty($data)) {
             addDocumentToWork($docId, $workId, api_get_course_int_id());
-            Display::display_confirmation_message(get_lang('Added'));
+            $url = api_get_path(WEB_CODE_PATH).'work/add_document.php?id='.$workId;
+            header('Location: '.$url);
+            exit;
         } else {
             Display::display_warning_message(get_lang('DocumentAlreadyAdded'));
         }

+ 1 - 4
main/work/add_user.php

@@ -44,7 +44,6 @@ $error_message = null;
 
 switch ($action) {
     case 'add':
-
         $data = getUserToWork($userId, $workId, api_get_course_int_id());
         if (empty($data)) {
             addUserToWork($userId, $workId, api_get_course_int_id());
@@ -52,7 +51,6 @@ switch ($action) {
         $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?id='.$workId;
         header('Location: '.$url);
         exit;
-
         break;
     case 'delete':
         if (!empty($workId) && !empty($userId)) {
@@ -66,11 +64,10 @@ switch ($action) {
 
 Display :: display_header(null);
 
-echo Display::page_subheader(get_lang('UsersAdded'));
-
 $items = getAllUserToWork($workId, api_get_course_int_id());
 $usersAdded = array();
 if (!empty($items)) {
+    echo Display::page_subheader(get_lang('UsersAdded'));
     echo '<div class="well">';
     foreach ($items as $data) {
         $myUserId = $data['user_id'];

+ 1 - 1
main/work/work_list_all.php

@@ -73,7 +73,7 @@ if (api_is_allowed_to_session_edit(false, true) && !empty($workId)) {
         echo Display::return_icon('new_document.png', get_lang('AddDocument'), '', ICON_SIZE_MEDIUM).'</a>';
 
         echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_user.php?'.api_get_cidreq().'&id='.$workId.'">';
-        echo Display::return_icon('user.png', get_lang('AddUser'), '', ICON_SIZE_MEDIUM).'</a>';
+        echo Display::return_icon('user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>';
     }
 
     $display_output .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/work_missing.php?'.api_get_cidreq().'&amp;id='.$workId.'&amp;curdirpath='.$cur_dir_path.'&amp;origin='.$origin.'&amp;gradebook='.$gradebook.'&amp;list=without">'.