Adding course "things to do" page

skala
Julio Montoya 14 years ago
parent 59d040c132
commit f12238e1f9
  1. 22
      main/create_course/add_course.php
  2. 20
      main/css/base.css
  3. BIN
      main/img/icons/128/home.png
  4. BIN
      main/img/icons/64/home.png
  5. 1
      main/inc/lib/template.lib.php
  6. 30
      main/template/default/create_course/add_course.tpl

@ -16,7 +16,7 @@
*/
// Name of the language file that needs to be included.
$language_file = 'create_course';
$language_file = array('create_course', 'registration','admin','exercice', 'course_description', 'course_info');
// Flag forcing the "current course" reset.
$cidReset = true;
@ -66,6 +66,8 @@ $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'user_portal.php', 'n
// Displaying the header.
$tool_name = $course_validation_feature ? get_lang('CreateCourseRequest') : get_lang('CreateSite');
$tpl = new Template($tool_name);
if (api_get_setting('allow_users_to_create_courses') == 'false' && !api_is_platform_admin()) {
api_not_allowed(true);
}
@ -195,6 +197,8 @@ $values['tutor_name'] = api_get_person_name($_user['firstName'], $_user['lastNam
$form->setDefaults($values);
// Validate the form.
if ($form->validate()) {
$course_values = $form->exportValues();
@ -244,13 +248,14 @@ if ($form->validate()) {
$title = $course_info['title'];
// Preparing a confirmation message.
$link = api_get_path(WEB_COURSE_PATH).$directory.'/';
$message .= get_lang('JustCreated').' '.Display::url($title, $link);
$link = api_get_path(WEB_COURSE_PATH).$directory.'/';
$tpl->assign('course_url', $link);
$tpl->assign('course_title', Display::url($title, $link));
$tpl->assign('course_id', $course_info['code']);
$add_course_tpl = $tpl->get_template('create_course/add_course.tpl');
$message = $tpl->fetch($add_course_tpl);
$message = Display :: return_message($message, 'confirmation', false);
$message .= '<div style="float: left; margin:0px; padding: 0px;">' .
'<a class="a_button gray medium" href="'.api_get_path(WEB_PATH).'user_portal.php">'.get_lang('Enter').'</a>' .
'</div>';
} else {
$message = Display :: return_message(get_lang('CourseCreationFailed'), 'error', false);
// Display the form.
@ -287,7 +292,8 @@ if ($form->validate()) {
$content = $form->return_form();
}
$tpl = new Template($tool_name);
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);

@ -4284,4 +4284,22 @@ a:active{
/* Portal administration input text width */
#settings input[type="text"] {
width:250px;
}
}
.welcome_course li {
float:left;
list-style-type: none;
width: 175px
}
.welcome_course li p {
margin-left: auto;
margin-right: auto;
width: 88px;
}
.welcome_course li a {
margin-left: auto;
margin-right: auto;
width: 120px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@ -179,6 +179,7 @@ class Template extends Smarty {
'web_course' => api_get_path(WEB_COURSE_PATH),
'web_main' => api_get_path(WEB_CODE_PATH),
'web_ajax' => api_get_path(WEB_AJAX_PATH),
'web_img' => api_get_path(WEB_IMG_PATH),
);
$this->assign('_p', $_p);

@ -0,0 +1,30 @@
{$just_created_link}
<h3>{'JustCreated'|get_lang} {$course_title}</h3>
<hr />
<h3>{'ThigsToDo'|get_lang}</h3>
<ul class="welcome_course">
<li>
<p><img src="{$_p.web_img}icons/64/home.png"/></p>
<a href="{$course_url}" class="a_button white medium">{'CourseHomepage'|get_lang}</a>
</li>
<li>
<p><img src="{$_p.web_img}icons/64/user.png"/></p>
<a href="{$_p.web_main}user/subscribe_user.php?cidReq={$course_id}" class="a_button white medium">{'SubscribeUserToCourse'|get_lang}</a>
</li>
<li>
<p><img src="{$_p.web_img}icons/64/info.png"/></p>
<a href="{$_p.web_main}course_description/?cidReq={$course_id}" class="a_button white medium">{'AddCourseDescription'|get_lang}</a>
</li>
<li>
<p><img src="{$_p.web_img}icons/64/quiz.png"/></p>
<a href="{$_p.web_main}exercice/exercice.php?cidReq={$course_id}" class="a_button white medium">{'NewEx'|get_lang}</a>
</li>
<li>
<p><img src="{$_p.web_img}icons/64/reference.png"/></p>
<a href="{$_p.web_main}course_info/infocours.php?cidReq={$course_id}" class="a_button white medium">{'ModifInfo'|get_lang}</a>
</li>
</ul>
<div class="clear">
</div>
<br />
Loading…
Cancel
Save