@ -3,6 +3,7 @@
/**
* View (MVC patter) for courses
* @todo fix this. use twig templates
* @author Christian Fasanando < christian1827 @ gmail . com > - Beeznest
* @package chamilo.auth
*/
@ -11,9 +12,7 @@
api_block_anonymous_users();
$stok = Security::get_token();
$courses_without_category = isset($courses_in_category[0]) ? $courses_in_category[0] : null;
?>
<!-- Actions: The menu with the different options in cathe course management -->
< div id = "actions" class = "actions" >
<?php if ( $action != 'createcoursecategory' ) { ?>
@ -21,7 +20,6 @@ $courses_without_category = isset($courses_in_category[0]) ? $courses_in_categor
<?php echo Display :: return_icon ( 'new_folder.png' , get_lang ( 'CreateCourseCategory' ), '' , '32' ); ?> </ a >
<?php } ?>
< / div >
<?php
if (!empty($message)) {
Display::display_confirmation_message($message, false);
@ -29,31 +27,27 @@ if (!empty($message)) {
// COURSES WITH CATEGORIES
if (!empty($user_course_categories)) {
$counter = 0;
$last = end($user_course_categories);
foreach ($user_course_categories as $row) {
echo Display::page_subheader($row['title']);
echo '< a name = "category'.$row['id'].'" > < / a > ';
if (isset($_GET['categoryid']) & & $_GET['categoryid'] == $row['id']) { ?>
<!-- We display the edit form for the category -->
< form name = "edit_course_category" method = "post" action = "courses.php?action= <?php echo $action ; ?> " >
< input type = "hidden" name = "edit_course_category" value = " <?php echo $row [ 'id' ]; ?> " />
< input type = "hidden" name = "sec_token" value = " <?php echo $stok ; ?> " >
< input type = "text" name = "title_course_category" value = " <?php echo $row [ 'title' ]; ?> " />
< button class = "save" type = "submit" name = "submit_edit_course_category" > <?php echo get_lang ( 'Ok' ); ?> </ button >
< / form >
<?php } ?>
<!-- display category icons -->
<?php
}
$max_category_key = count($user_course_categories);
if ($action != 'unsubscribe') { ?>
< a href = "courses.php?action=sortmycourses&categoryid= <?php echo $row [ 'id' ]; ?> &sec_token= <?php echo $stok ; ?> #category <?php echo $row [ 'id' ]; ?> " >
<?php echo Display :: display_icon ( 'edit.png' , get_lang ( 'Edit' ), '' , 22 ); ?>
< / a >
<?php if ( $row [ 'id' ] != $user_course_categories [ 0 ][ 'id' ]) { ?>
<?php if ( 0 != $counter ) { ?>
< a href = "courses.php?action= <?php echo $action ?> &move=up&category= <?php echo $row [ 'id' ]; ?> &sec_token= <?php echo $stok ; ?> " >
<?php echo Display :: return_icon ( 'up.png' , get_lang ( 'Up' ), '' , 22 ); ?>
< / a >
@ -61,7 +55,7 @@ if (!empty($user_course_categories)) {
<?php echo Display :: return_icon ( 'up_na.png' , get_lang ( 'Up' ), '' , 22 ); ?>
<?php } ?>
<?php if ( $row [ 'id' ] != $user_course_categories [ $max_ca tegory_key - 1 ] [ 'id' ]) { ?>
<?php if ( $row [ 'id' ] != $las t [ 'id' ]) { ?>
< a href = "courses.php?action= <?php echo $action ; ?> &move=down&category= <?php echo $row [ 'id' ]; ?> &sec_token= <?php echo $stok ; ?> " >
<?php echo Display :: return_icon ( 'down.png' , get_lang ( 'Down' ), '' , 22 ); ?>
< / a >
@ -72,10 +66,10 @@ if (!empty($user_course_categories)) {
<?php echo Display :: display_icon ( 'delete.png' , get_lang ( 'Delete' ), array ( 'onclick' => "javascript: if (!confirm('" . addslashes ( api_htmlentities ( get_lang ( "CourseCategoryAbout2bedeleted" ), ENT_QUOTES , api_get_system_encoding ())) . "')) return false;" ), 22 ) ?>
< / a >
<?php }
$counter++;
echo '< br / > < br / > ';
// Show the courses inside this category
echo '< table class = "data_table" > ';
$number_of_courses = isset($courses_in_category[$row['id']]) ? count($courses_in_category[$row['id']]) : 0;
$key = 0;
if (!empty($courses_in_category[$row['id']])) {
@ -119,7 +113,6 @@ if (!empty($user_course_categories)) {
< button class = "save" type = "submit" name = "submit_change_course_category" > <?php echo get_lang ( 'Ok' ); ?> </ button >
< / form >
<?php } ?>
< div style = "float:left;width:110px;" >
<?php
if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
@ -156,7 +149,8 @@ if (!empty($user_course_categories)) {
< / div >
< div style = "float:left; margin-right:10px;" >
<?php if ( $course [ 'status' ] != 1 ) {
<?php
if ($course['status'] != 1) {
if ($course['unsubscr'] == 1) {
?>