Minor esthetic changes

skala
Julio Montoya 14 years ago
parent 2bf22f541a
commit 3dab14081b
  1. 46
      main/auth/courses.php
  2. 18
      main/auth/courses_controller.php
  3. 4
      main/calendar/myagenda.inc.php
  4. 11
      main/inc/lib/app_view.php
  5. 31
      main/template/default/auth/courses_categories.php

@ -16,7 +16,7 @@ $cidReset = true; // Flag forcing the 'current course' reset
// including files
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'auth.lib.php';
require_once api_get_path(LIBRARY_PATH).'auth.lib.php';
require_once api_get_path(LIBRARY_PATH).'app_view.php';
require_once 'courses_controller.php';
//require_once api_get_path(LIBRARY_PATH).'debug.lib.inc.php';
@ -85,12 +85,12 @@ $ctok = $_SESSION['sec_token'];
if (isset($_GET['move'])) {
if (isset($_GET['course'])) {
if ($ctok == $_GET['sec_token']) {
$courses_controller->move_course($_GET['move'], $_GET['course'], $_GET['category']);
$courses_controller->move_course($_GET['move'], $_GET['course'], $_GET['category']);
}
}
if (isset($_GET['category']) && !$_GET['course']) {
if ($ctok == $_GET['sec_token']) {
$courses_controller->move_category($_GET['move'], $_GET['category']);
$courses_controller->move_category($_GET['move'], $_GET['category']);
}
}
}
@ -98,7 +98,7 @@ if (isset($_GET['move'])) {
// We are moving the course of the user to a different user defined course category (=Sort My Courses).
if (isset($_POST['submit_change_course_category'])) {
if ($ctok == $_POST['sec_token']) {
$courses_controller->change_course_category($_POST['course_2_edit_category'], $_POST['course_categories']);
$courses_controller->change_course_category($_POST['course_2_edit_category'], $_POST['course_categories']);
}
}
@ -120,7 +120,7 @@ if ($action == 'deletecoursecategory' && isset($_GET['id'])) {
// We are unsubscribing from a course (=Unsubscribe from course).
if (isset($_POST['unsubscribe'])) {
if ($ctok == $_POST['sec_token']) {
$courses_controller->unsubscribe_user_from_course($_POST['unsubscribe']);
$courses_controller->unsubscribe_user_from_course($_POST['unsubscribe']);
//$message = remove_user_from_course($_user['user_id'], $_POST['unsubscribe']);
}
}
@ -128,7 +128,7 @@ 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']);
}
}
@ -142,25 +142,23 @@ if (isset($_REQUEST['search_course'])) {
// subscribe user to course
if (isset($_GET['subscribe_course'])) {
//if ($ctok == $_GET['sec_token'] || $_POST['token'] == $_GET['sec_token']) {
$courses_controller->subscribe_user($_GET['subscribe_course'], $_GET['search_term'], $_GET['category_code']);
//}
//if ($ctok == $_GET['sec_token'] || $_POST['token'] == $_GET['sec_token']) {
$courses_controller->subscribe_user($_GET['subscribe_course'], $_GET['search_term'], $_GET['category_code']);
//}
}
switch ($action) {
case 'createcoursecategory' :
$courses_controller->categories_list($action);
break;
case 'deletecoursecategory' :
case 'sortmycourses' :
$courses_controller->courses_list($action);
break;
case 'subscribe' :
$courses_controller->courses_categories($action);
break;
case 'display_courses' :
$courses_controller->courses_categories($action, $_GET['category_code']);
break;
case 'createcoursecategory' :
$courses_controller->categories_list($action);
break;
case 'deletecoursecategory' :
case 'sortmycourses' :
$courses_controller->courses_list($action);
break;
case 'subscribe' :
$courses_controller->courses_categories($action);
break;
case 'display_courses' :
$courses_controller->courses_categories($action, $_GET['category_code']);
break;
}

@ -40,11 +40,10 @@ class CoursesController { // extends Controller {
$user_id = api_get_user_id();
//$user_courses = $auth->get_courses_of_user($user_id);
$data['user_courses'] = $this->model->get_courses_of_user($user_id);
$data['user_course_categories'] = $this->model->get_user_course_categories();
$data['courses_in_category'] = $this->model->get_courses_in_category();
$data['all_user_categories'] = $this->model->get_user_course_categories();
$data['user_courses'] = $this->model->get_courses_of_user($user_id);
$data['user_course_categories'] = $this->model->get_user_course_categories();
$data['courses_in_category'] = $this->model->get_courses_in_category();
$data['all_user_categories'] = $this->model->get_user_course_categories();
$data['action'] = $action;
@ -140,7 +139,7 @@ class CoursesController { // extends Controller {
$browse_course_categories = $this->model->browse_course_categories();
$data['browse_courses_in_category'] = $this->model->search_courses($search_term);
$data['browse_course_categories'] = $browse_course_categories;
$data['browse_course_categories'] = $browse_course_categories;
$data['search_term'] = $search_term;
@ -157,10 +156,9 @@ class CoursesController { // extends Controller {
}
$data['user_coursecodes'] = $user_coursecodes;
$data['message'] = $message;
$data['error'] = $error;
$data['action'] = 'display_courses';
$data['message'] = $message;
$data['error'] = $error;
$data['action'] = 'display_courses';
// render to the view
$this->view->set_data($data);

@ -217,8 +217,8 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) {
//Start the week on monday
$startdayofweek = $dayone['wday'] <> 0 ? ($dayone['wday'] - 1) : 6;
$g_cc = (isset($_GET['courseCode'])?$_GET['courseCode']:'');
$backwardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;month=". ($month == 1 ? 12 : $month -1)."&amp;year=". ($month == 1 ? $year -1 : $year);
$forewardsURL = api_get_self()."?coursePath=".urlencode($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;month=". ($month == 12 ? 1 : $month +1)."&amp;year=". ($month == 12 ? $year +1 : $year);
$backwardsURL = api_get_self()."?coursePath=".Security::remove_XSS($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;month=". ($month == 1 ? 12 : $month -1)."&amp;year=". ($month == 1 ? $year -1 : $year);
$forewardsURL = api_get_self()."?coursePath=".Security::remove_XSS($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;month=". ($month == 12 ? 1 : $month +1)."&amp;year=". ($month == 12 ? $year +1 : $year);
echo "<table class=\"data_table\">", "<tr>", "<th width=\"10%\"><a href=\"", $backwardsURL, "\">".Display::return_icon('action_prev.png',get_lang('Previous'))."</a></th>";
echo "<th width=\"80%\" colspan=\"5\">", $monthName, " ", $year, "</th>", "<th width=\"10%\"><a href=\"", $forewardsURL, "\">".Display::return_icon('action_next.png',get_lang('Next'))."</a></th>", "</tr>";

@ -21,12 +21,11 @@ class View {
*/
public function __construct($toolname = '', $template_path=null) {
if (!empty($toolname)) {
if (isset($template_path)) {
$path = $template_path.$toolname.'/';
} else {
$path = api_get_path(SYS_CODE_PATH).$toolname.'/';
}
if (isset($template_path)) {
$path = $template_path.$toolname.'/';
} else {
$path = api_get_path(SYS_CODE_PATH).$toolname.'/';
}
if (is_dir($path)) {
$this->tool_path = $path;
} else {

@ -8,7 +8,6 @@
*/
$stok = Security::get_token();
?>
<!-- Actions: The menu with the different options in cathe course management -->
@ -98,29 +97,23 @@ $stok = Security::get_token();
}
}
}
}
}
?>
<?php } ?>
</div>
</div>
<div id="categories-content-second">
<?php if (!empty($message)) { Display::display_confirmation_message($message, false); } ?>
<?php if (!empty($error)) { Display::display_error_message($error, false); } ?>
<?php
<?php
if (!empty($message)) { Display::display_confirmation_message($message, false); }
if (!empty($error)) { Display::display_error_message($error, false); }
if (!empty($search_term)) {
echo "<p><strong>".get_lang('SearchResultsFor')." ".api_htmlentities($_POST['search_term'], ENT_QUOTES, api_get_system_encoding())."</strong><br />";
echo "<p><strong>".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."</strong><br />";
}
if (!empty($browse_courses_in_category)) {
@ -132,7 +125,6 @@ $stok = Security::get_token();
$creation_date = substr($course['creation_date'],0,10);
$count_connections = $course['count_connections'];
$course_path = api_get_path(SYS_COURSE_PATH).$course['directory']; // course path
if (file_exists($course_path.'/course-pic85x85.png')) {
@ -165,22 +157,17 @@ $stok = Security::get_token();
// we display the icon to subscribe or the text already subscribed
if (!in_array($course['code'], $user_coursecodes)) {
if ($course['subscribe'] == SUBSCRIBE_ALLOWED) {
echo '<span class="course-link-desc"><a href="'. api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">'.get_lang('Subscribe').'</a></span>';
}
if ($course['subscribe'] == SUBSCRIBE_ALLOWED) {
echo '<span class="course-link-desc"><a href="'. api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">'.get_lang('Subscribe').'</a></span>';
}
}
echo '</div>
</div>';
}
} else {
echo '<div id="course-message">'.get_lang('ThereAreNoCoursesInThisCategory').'</div>';
}
?>
<div class="clear"></div>
</div>
</div>
</div>
Loading…
Cancel
Save