Bug #1370 - Implementing some visual improvements for showing resources in the selector form.

skala
Ivan Tcholakov 16 years ago
parent 7ac61c60d6
commit 5fbc9321f5
  1. 3
      main/coursecopy/classes/CourseDescription.class.php
  2. 2
      main/coursecopy/classes/CourseRestorer.class.php
  3. 8
      main/coursecopy/classes/CourseSelectForm.class.php
  4. 10
      main/coursecopy/classes/Document.class.php
  5. 11
      main/coursecopy/classes/ScormDocument.class.php
  6. 53
      main/coursecopy/classes/ToolIntro.class.php

@ -38,11 +38,10 @@ class CourseDescription extends Resource
*/ */
var $content; var $content;
/** /**
* Create a new Event * Create a new course description
* @param int $id * @param int $id
* @param string $title * @param string $title
* @param string $content * @param string $content
* @param string $date
*/ */
function CourseDescription($id,$title,$content) function CourseDescription($id,$title,$content)
{ {

@ -694,7 +694,7 @@ class CourseRestorer
return $new_id; return $new_id;
} }
/** /**
* Restore Quiz * Restore surveys
*/ */
function restore_surveys() function restore_surveys()
{ {

@ -107,7 +107,7 @@ class CourseSelectForm
echo '<script language="javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/upload.js" type="text/javascript"></script>'; echo '<script language="javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/upload.js" type="text/javascript"></script>';
echo '<script type="text/javascript">var myUpload = new upload(1000);</script>'; echo '<script type="text/javascript">var myUpload = new upload(1000);</script>';
echo '<form method="post" id="upload_form" name="course_select_form" onsubmit="myUpload.start(\'dynamic_div\',\''.api_get_path(WEB_CODE_PATH).'img/progress_bar.gif\',\''.get_lang('PleaseStandBy').'\',\'upload_form\')">'; echo '<form method="post" id="upload_form" name="course_select_form" onsubmit="javascript: myUpload.start(\'dynamic_div\',\''.api_get_path(WEB_CODE_PATH).'img/progress_bar.gif\',\''.get_lang('PleaseStandBy').'\',\'upload_form\')">';
echo '<input type="hidden" name="action" value="course_select_form"/>'; echo '<input type="hidden" name="action" value="course_select_form"/>';
foreach ($course->resources as $type => $resources) { foreach ($course->resources as $type => $resources) {
@ -123,11 +123,11 @@ class CourseSelectForm
case RESOURCE_SCORM: case RESOURCE_SCORM:
break; break;
default : default :
echo '<img id="img_'.$type.'" src="../img/1.gif" onclick="javascript:exp('."'$type'".');" />'; echo '<img id="img_'.$type.'" src="../img/1.gif" onclick="javascript: exp('."'$type'".');" />';
echo '<b onclick="javascript:exp('."'$type'".');" >'.$resource_titles[$type].'</b><br />'; echo '<b onclick="javascript:exp('."'$type'".');" >'.$resource_titles[$type].'</b><br />';
echo '<div id="div_'.$type.'">'; echo '<div id="div_'.$type.'">';
echo '<blockquote>'; echo '<blockquote>';
echo "[<a href=\"#\" onclick=\"javascript:setCheckbox('$type',true);\" >".get_lang('All')."</a> - <a href=\"#\" onclick=\"javascript:setCheckbox('$type',false);\" >".get_lang('None')."</a>]"; echo "[<a href=\"javascript: void(0);\" onclick=\"javascript: setCheckbox('$type',true);\" >".get_lang('All')."</a> | <a href=\"javascript: void(0);\" onclick=\"javascript:setCheckbox('$type',false);\" >".get_lang('None')."</a>]";
echo '<br />'; echo '<br />';
foreach ($resources as $id => $resource) { foreach ($resources as $id => $resource) {
echo '<input type="checkbox" name="resource['.$type.']['.$id.']" id="resource['.$type.']['.$id.']"/>'; echo '<input type="checkbox" name="resource['.$type.']['.$id.']" id="resource['.$type.']['.$id.']"/>';
@ -158,7 +158,7 @@ class CourseSelectForm
echo '<input type="hidden" name="'.$key.'" value="'.$value.'"/>'; echo '<input type="hidden" name="'.$key.'" value="'.$value.'"/>';
} }
} }
echo '<br /><button class="save" type="submit" onclick="checkLearnPath(\''.addslashes(get_lang('DocumentsWillBeAddedToo')).'\')">'.get_lang('Ok').'</button>'; echo '<br /><button class="save" type="submit" onclick="javascript: checkLearnPath(\''.addslashes(get_lang('DocumentsWillBeAddedToo')).'\')">'.get_lang('Ok').'</button>';
CourseSelectForm :: display_hidden_quiz_questions($course); CourseSelectForm :: display_hidden_quiz_questions($course);
CourseSelectForm :: display_hidden_scorm_directories($course); CourseSelectForm :: display_hidden_scorm_directories($course);

@ -61,7 +61,13 @@ class Document extends Resource
function show() function show()
{ {
parent::show(); parent::show();
echo substr($this->path,8); echo preg_replace('@^document@', '', $this->path);
if (!empty($this->title) && (api_get_setting('use_document_title') == 'true'))
{
if (strpos($this->path, $this->title) === false)
{
echo " - ".$this->title;
}
}
} }
} }
?>

@ -53,7 +53,14 @@ class ScormDocument extends Resource
function show() function show()
{ {
parent::show(); parent::show();
echo substr($this->path,8); $path = preg_replace('@^scorm/@', '', $this->path);
echo $path;
if (!empty($this->title) && (api_get_setting('use_document_title') == 'true'))
{
if (strpos($path, $this->title) === false)
{
echo " - ".$this->title;
}
}
} }
} }
?>

@ -41,7 +41,7 @@ class ToolIntro extends Resource
* @param int $id The id of this tool introduction in the Dokeos-course * @param int $id The id of this tool introduction in the Dokeos-course
* @param string $intro_text * @param string $intro_text
*/ */
function ToolIntro($id,$intro_text) function ToolIntro($id, $intro_text)
{ {
parent::Resource($id,RESOURCE_TOOL_INTRO); parent::Resource($id,RESOURCE_TOOL_INTRO);
$this->id = $id; $this->id = $id;
@ -53,10 +53,57 @@ class ToolIntro extends Resource
function show() function show()
{ {
parent::show(); parent::show();
if($this->id != 'course_homepage') switch ($this->id)
{ {
echo '<b>'.get_lang($this->id).': </b>'; case TOOL_DOCUMENT:
$lang_id = 'Documents';
break;
case TOOL_CALENDAR_EVENT:
$lang_id = 'Agenda';
break;
case TOOL_LINK:
$lang_id = 'Links';
break;
case TOOL_LEARNPATH:
$lang_id = 'LearningPath';
break;
case TOOL_ANNOUNCEMENT:
$lang_id = 'Announcements';
break;
case TOOL_FORUM:
$lang_id = 'Forums';
break;
case TOOL_DROPBOX:
$lang_id = 'Dropbox';
break;
case TOOL_QUIZ:
$lang_id = 'Exercises';
break;
case TOOL_USER:
$lang_id = 'Users';
break;
case TOOL_GROUP:
$lang_id = 'Group';
break;
case TOOL_WIKI:
$lang_id = 'Wiki';
break;
case TOOL_STUDENTPUBLICATION:
$lang_id = 'StudentPublications';
break;
case TOOL_COURSE_HOMEPAGE:
$lang_id = 'CourseHomepageLink';
break;
case TOOL_GLOSSARY:
$lang_id = 'Glossary';
break;
case TOOL_NOTEBOOK:
$lang_id = 'Notebook';
break;
default:
$lang_id = ucfirst($this->id); // This is a wild guess.
} }
echo '<strong>'.get_lang($lang_id, '').':</strong><br />';
echo $this->intro_text; echo $this->intro_text;
} }
} }

Loading…
Cancel
Save