/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to codeigniter/application/controllers/ajax.php

  • Committer: a11andoh
  • Date: 2013-05-24 11:37:57 UTC
  • mfrom: (97 lenasys_b)
  • mto: This revision was merged to the branch mainline in revision 98.
  • Revision ID: a11andoh@student.his.se-20130524113757-cdvtx3xjyimouu5k
blurp

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
                 *      This function loads a popupview to be displayed, the argument is the name of the popupview
16
16
                 */
17
17
                public function popup($popupName) {
18
 
                        $popup = $this->load->view('popup/'.$popupName, '', TRUE);
19
 
                        return $popup;
 
18
                        $this->load->view('popup/'.$popupName);
20
19
                }
21
20
                
22
 
                
23
21
                /*
24
22
                 *      This function outputs data: user password hint.
25
23
                 */
76
74
                        $pwdOld = $this->input->post('currentPwd');
77
75
                        $pwdNew = $this->input->post('newPwd');
78
76
                }
 
77
 
 
78
                // Takes a course ID and sets the course to published (isHidden = 0)
 
79
                public function publishCourse($courseID) {
 
80
                        $this->load->model('user');
 
81
                        $this->load->model('admin/admin_model');
 
82
 
 
83
                        if(!$this->user->isLoggedIn() || $this->user->getUserType() != "Teacher") {
 
84
                                $this->load->view('manageCoursesMessage', array('message' => 'You do not have access to this page'));
 
85
                                echo "not logged in";
 
86
                                return;
 
87
                        }
 
88
 
 
89
                        $this->admin_model->unsetCourseHidden($courseID);
 
90
                }
 
91
 
 
92
                //Takes a course ID and sets the course to unpublished (isHidden = 1)
 
93
                public function unpublishCourse($courseID) {
 
94
                        $this->load->model('user');
 
95
                        $this->load->model('admin/admin_model');
 
96
 
 
97
                        if(!$this->user->isLoggedIn() || $this->user->getUserType() != "Teacher") {
 
98
                                $this->load->view('manageCoursesMessage', array('message' => 'You do not have access to this page'));
 
99
                                echo "not logged in";
 
100
                                return;
 
101
                        }
 
102
                        
 
103
                        $this->admin_model->setCourseHidden($courseID);
 
104
                }
79
105
        }
80
106
?>
 
 
b'\\ No newline at end of file'