Fixing course catalog layout

skala
Julio Montoya 14 years ago
parent 0855bd9ceb
commit c179a99b10
  1. 10
      main/auth/courses.php
  2. 4
      main/auth/courses_controller.php
  3. 32
      main/template/default/auth/categories_list.php
  4. 11
      main/template/default/auth/courses_categories.php
  5. 5
      main/template/default/auth/courses_list.php

@ -128,16 +128,16 @@ if (isset($_POST['unsubscribe'])) {
// We are creating a new user defined course category (= Create Course Category).
if (isset($_POST['create_course_category']) && isset($_POST['title_course_category']) && strlen(trim($_POST['title_course_category'])) > 0) {
if ($ctok == $_POST['sec_token']) {
$courses_controller->add_course_category($_POST['title_course_category']);
$courses_controller->add_course_category($_POST['title_course_category']);
}
}
// search courses
if (isset($_REQUEST['search_course'])) {
//echo "<p><strong>".get_lang('SearchResultsFor')." ".api_htmlentities($_POST['search_term'], ENT_QUOTES, api_get_system_encoding())."</strong><br />";
if ($ctok == $_REQUEST['sec_token']) {
$courses_controller->search_courses($_REQUEST['search_term']);
}
//echo "<p><strong>".get_lang('SearchResultsFor')." ".api_htmlentities($_POST['search_term'], ENT_QUOTES, api_get_system_encoding())."</strong><br />";
if ($ctok == $_REQUEST['sec_token']) {
$courses_controller->search_courses($_REQUEST['search_term']);
}
}
// subscribe user to course

@ -201,8 +201,8 @@ class CoursesController { // extends Controller {
$message = '';
if ($result) { $message = get_lang("CourseCategoryStored"); }
else { $error = get_lang('ACourseCategoryWithThisNameAlreadyExists');}
$action = 'createcoursecategory';
$this->categories_list($action, $message, $error);
$action = 'sortmycourses';
$this->courses_list($action, $message);
}
/**

@ -16,39 +16,17 @@ $stok = Security::get_token();
<!-- Actions: The menu with the different options in cathe course management -->
<div id="actions" class="actions">
<?php if ($action != 'subscribe') { ?>
&nbsp;<a href="<?php echo api_get_self() ?>?action=subscribe"><?php echo Display::return_icon('subscribe_course.png', get_lang('SubscribeToCourse'),'','32'); ?></a>
<?php } ?>
<?php if ($action != 'sortmycourses' && isset($action)) { ?>
&nbsp;<a href="<?php echo api_get_self() ?>?action=sortmycourses"><?php echo Display::return_icon('course_move.png', get_lang('SortMyCourses'),'','32'); ?></a>
<?php } ?>
<?php if ($action != 'createcoursecategory') { ?>
&nbsp;<a href="<?php echo api_get_self() ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a>
<?php } ?>
&nbsp;<a href="<?php echo api_get_self() ?>?action=sortmycourses"><?php echo Display::return_icon('back.png', get_lang('Back'),'','32'); ?></a>
</div>
<?php
if (!empty($message)) { Display::display_confirmation_message($message, false); }
if (!empty($error)) { Display::display_error_message($error, false); }
?>
<form name="create_course_category" method="post" action="<?php echo api_get_self() ?>?action=createcoursecategory">
<input type="hidden" name="sec_token" value="<?php echo $stok ?>">
<input type="text" name="title_course_category" />
<button type="submit" class="save" name="create_course_category"><?php echo get_lang('Ok') ?></button>
</form>
<?php
echo get_lang('ExistingCourseCategories');
if (!empty($user_course_categories)) {
?>
<ul>
<?php foreach ($user_course_categories as $row) { ?>
<li><?php echo $row['title'] ?></li>
<?php } ?>
</ul>
<?php } ?>
<button type="submit" class="save" name="create_course_category"><?php echo get_lang('AddCategory') ?></button>
</form>

@ -8,6 +8,11 @@
*/
$stok = Security::get_token();
/*
<?php if ($action != 'createcoursecategory') { ?>
&nbsp;<a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a>
<?php } ?>
*/
?>
<!-- Actions: The menu with the different options in cathe course management -->
@ -15,16 +20,14 @@ $stok = Security::get_token();
<div id="actions" class="actions">
<?php if ($action != 'subscribe') { ?>
&nbsp;<a href="<?php echo api_get_self(); ?>?action=subscribe"><?php echo Display::return_icon('subscribe_course.png', get_lang('SubscribeToCourse'),'','32'); ?></a>
&nbsp;<a href="<?php echo api_get_self(); ?>?action=subscribe"><?php echo Display::return_icon('user_subscribe_course.png', get_lang('SubscribeToCourse'),'','32'); ?></a>
<?php } ?>
<?php if ($action != 'sortmycourses' && isset($action)) { ?>
&nbsp;<a href="<?php echo api_get_self(); ?>?action=sortmycourses"><?php echo Display::return_icon('course_move.png', get_lang('SortMyCourses'),'','32'); ?></a>
<?php } ?>
<?php if ($action != 'createcoursecategory') { ?>
&nbsp;<a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a>
<?php } ?>
</div>
<?php

@ -9,10 +9,7 @@
// Acces rights: anonymous users can't do anything usefull here.
api_block_anonymous_users();
$stok = Security::get_token();
$courses_without_category = $courses_in_category[0];
?>
@ -20,7 +17,7 @@ $courses_without_category = $courses_in_category[0];
<!-- Actions: The menu with the different options in cathe course management -->
<div id="actions" class="actions">
<?php if ($action != 'subscribe') { ?>
&nbsp;<a href="<?php echo api_get_self(); ?>?action=subscribe"><?php echo Display::return_icon('subscribe_course.png', get_lang('SubscribeToCourse'),'','32'); ?></a>
&nbsp;<a href="<?php echo api_get_self(); ?>?action=subscribe"><?php echo Display::return_icon('user_subscribe_course.png', get_lang('SubscribeToCourse'),'','32'); ?></a>
<?php } ?>
<?php if ($action != 'sortmycourses' && isset($action)) { ?>

Loading…
Cancel
Save