Minor - adding "Add new X" for teachers when the list is empty

skala
Julio Montoya 14 years ago
parent 7c238249d5
commit d8da4f6588
  1. 14
      main/announcements/announcements.php
  2. 24
      main/css/base.css
  3. 10
      main/exercice/exercice.php
  4. BIN
      main/img/icons/32/import.png
  5. 100
      main/newscorm/lp_list.php

@ -1067,7 +1067,19 @@ if ($display_announcement_list) {
if (!isset($_GET['action']) || !in_array($_GET['action'], array('add', 'modify','view')))
if ($num_rows == 0) {
Display::display_warning_message(get_lang('NoAnnouncements'));
if ((api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())) and (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath')) {
echo '<div id="no-data-view">';
echo '<h2>'.get_lang('Announcements').'</h2>';
echo Display::return_icon('valves.png', '', array(), 64);
echo '<div class="controls">';
echo Display::url(get_lang('AddAnnouncement'), api_get_self()."?".api_get_cidreq()."&action=add&origin=".(empty($_GET['origin'])?'':$_GET['origin']) , array('class' => 'a_button white'));
echo '</div>';
echo '</div>';
} else {
//echo "<a href='".api_get_self()."?".api_get_cidreq()."&action=add&origin=".(empty($_GET['origin'])?'':$_GET['origin'])."'>".Display::return_icon('new_announce.png',get_lang('AddAnnouncement'),'','32')."</a>";
Display::display_warning_message(get_lang('NoAnnouncements'));
}
} else {
$iterator = 1;
$bottomAnnouncement = $announcement_number;

@ -4050,3 +4050,27 @@ input.liteoption {
text-align: left;
vertical-align: middle;
}
#no-data-view {
padding: 20px 0 0px;
text-align: center;
}
div#no-data-view img {
margin-bottom: 25px;
}
div#no-data-view h2 {
border: 0 none;
color: #212121;
font-size: 18px;
font-weight: bold;
margin: 0 0 6px;
padding: 0;
}
div#no-data-view div.controls {
padding-top: 1px;
}

@ -729,6 +729,16 @@ if (!empty($exercise_list)) {
$count++;
} // end foreach()
}
} else {
if ($is_allowedToEdit && $origin != 'learnpath') {
echo '<div id="no-data-view">';
echo '<h2>'.get_lang('Quiz').'</h2>';
echo Display::return_icon('quiz.png', '', array(), 64);
echo '<div class="controls">';
echo Display::url(get_lang('NewEx'), 'exercise_admin.php?' . api_get_cidreq(), array('class' => 'a_button white'));
echo '</div>';
echo '</div>';
}
}
// end exercise list

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -90,9 +90,9 @@ if ($is_allowed_to_edit) {
}
echo '<div class="actions">';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_lp">'.Display::return_icon('new_learnpath.png', get_lang('_add_learnpath'),'','32').'</a>' .
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_lp">'.Display::return_icon('add.png', get_lang('_add_learnpath'),'','32').'</a>' .
str_repeat('&nbsp;', 3).
'<a href="../upload/index.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH.'">'.Display::return_icon('import_scorm.png', get_lang('UploadScorm'),'','32').'</a>';
'<a href="../upload/index.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH.'">'.Display::return_icon('import.png', get_lang('UploadScorm'),'','32').'</a>';
if (api_get_setting('service_ppt2lp', 'active') == 'true') {
echo str_repeat('&nbsp;', 3).'<a href="../upload/upload_ppt.php?'.api_get_cidreq().'&curdirpath=/&tool='.TOOL_LEARNPATH.'">
'.Display::return_icon('import_powerpoint.png', get_lang('PowerPointConvert'),'','32').'</a>';
@ -101,49 +101,52 @@ if ($is_allowed_to_edit) {
echo '</div>';
}
echo '<table width="100%" border="0" cellspacing="2" class="data_table">';
$is_allowed_to_edit ? $colspan = 9 : $colspan = 3;
if (!empty($curDirPath)) {
if (substr($curDirPath, 1, 1) == '/') {
$tmpcurDirPath=substr($curDirPath,1,strlen($curDirPath));
} else {
$tmpcurDirPath = $curDirPath;
}
?>
<!-- current dir name -->
<tr>
<td colspan="<?php echo $colspan; ?>" align="left" bgcolor="#4171B5">
<img src="../img/opendir.gif" align="absbottom" vspace="2" hspace="3" alt="open_dir" />
<font color="#ffffff"><b><?php echo $tmpcurDirPath; ?></b></font>
</td>
</tr>
<?php
}
/* CURRENT DIRECTORY */
echo '<tr>';
if ($is_allowed_to_edit) {
echo '<th width="50%">'.get_lang('Title').'</th>';
echo '<th>'.get_lang('PublicationDate').'</th>';
echo '<th>'.get_lang('ExpirationDate').'</th>';
echo '<th>'.get_lang('Progress')."</th>";
echo '<th width="240px">'.get_lang('AuthoringOptions')."</th>";
} else {
echo '<th width="50%">'.get_lang('Title').'</th>';
echo '<th>'.get_lang('Progress')."</th>";
echo '<th>'.get_lang('Actions')."</th>";
}
echo '</tr>';
/* DISPLAY SCORM LIST */
$list = new LearnpathList(api_get_user_id());
$flat_list = $list->get_flat_list();
//var_dump($flat_list);
if (is_array($flat_list)) {
if (!empty($flat_list)) {
echo '<table width="100%" border="0" cellspacing="2" class="data_table">';
$is_allowed_to_edit ? $colspan = 9 : $colspan = 3;
if (!empty($curDirPath)) {
if (substr($curDirPath, 1, 1) == '/') {
$tmpcurDirPath=substr($curDirPath,1,strlen($curDirPath));
} else {
$tmpcurDirPath = $curDirPath;
}
?>
<!-- current dir name -->
<tr>
<td colspan="<?php echo $colspan; ?>" align="left" bgcolor="#4171B5">
<img src="../img/opendir.gif" align="absbottom" vspace="2" hspace="3" alt="open_dir" />
<font color="#ffffff"><b><?php echo $tmpcurDirPath; ?></b></font>
</td>
</tr>
<?php
}
/* CURRENT DIRECTORY */
echo '<tr>';
if ($is_allowed_to_edit) {
echo '<th width="50%">'.get_lang('Title').'</th>';
echo '<th>'.get_lang('PublicationDate').'</th>';
echo '<th>'.get_lang('ExpirationDate').'</th>';
echo '<th>'.get_lang('Progress')."</th>";
echo '<th width="240px">'.get_lang('AuthoringOptions')."</th>";
} else {
echo '<th width="50%">'.get_lang('Title').'</th>';
echo '<th>'.get_lang('Progress')."</th>";
echo '<th>'.get_lang('Actions')."</th>";
}
echo '</tr>';
$test_mode = api_get_setting('server_type');
$max = count($flat_list);
$counter = 0;
@ -502,8 +505,17 @@ if (is_array($flat_list)) {
$current ++; //counter for number of elements treated
} // end foreach ($flat_list)
// TODO: Erint some user-friendly message if counter is still = 0 to tell nothing can be displayd yet.
} // end if ( is_array($flat_list)
echo "</table>";
echo "<br /><br />";
/* FOOTER */
Display::display_footer();
echo "</table>";
} else {
if ($is_allowed_to_edit) {
echo '<div id="no-data-view">';
echo '<h2>'.get_lang('LearningPaths').'</h2>';
echo Display::return_icon('scorms.png', '', array(), 64);
echo '<div class="controls">';
echo Display::url(get_lang('_add_learnpath'), api_get_self().'?'.api_get_cidreq().'&action=add_lp' , array('class' => 'a_button white'));
echo '</div>';
echo '</div>';
}
}
Display::display_footer();
Loading…
Cancel
Save