Notes
This commit is contained in:
25
inc/catc.php
25
inc/catc.php
@@ -12,7 +12,8 @@ class CATC extends Main
|
||||
{
|
||||
$asClasses = array(
|
||||
array('name'=>'auth', 'project'=>true),
|
||||
array('name'=>'course', 'project'=>true)
|
||||
array('name'=>'course', 'project'=>true),
|
||||
array('name'=>'note', 'project'=>true)
|
||||
);
|
||||
parent::__construct($oClassManagement, $sProcessPage, $asClasses);
|
||||
|
||||
@@ -73,7 +74,7 @@ class CATC extends Main
|
||||
);
|
||||
|
||||
//Pages
|
||||
$asPages = array('logon', 'logoff', 'template', 'workshops');
|
||||
$asPages = array('logon', 'logoff', 'template', 'workshops', 'course');
|
||||
foreach($asPages as $sPage) $asGlobalVars['consts']['pages'][$sPage] = $this->getPageContent($sPage);
|
||||
|
||||
//Main Page
|
||||
@@ -136,12 +137,30 @@ class CATC extends Main
|
||||
return $this->oAuth->checkApiKey($sApiKey);
|
||||
}
|
||||
|
||||
/* Managing Courses */
|
||||
/* Workshops / Courses */
|
||||
|
||||
public function getWorkshops() {
|
||||
return self::getJsonResult(true, '', (new Course($this->oDb))->getWorkshops());
|
||||
}
|
||||
|
||||
/* Notes*/
|
||||
|
||||
public function getNote($iCourseId) {
|
||||
$oCourse = new Course($this->oDb, $iCourseId);
|
||||
$asNote = $oCourse->getNote();
|
||||
$iCourseId = $asNote[Db::getId(Course::COURSE_TABLE)];
|
||||
|
||||
return self::getJsonResult(($iCourseId > 0), '', array('id'=>$iCourseId, 'ops'=>$asNote['notes'], 'led'=>$asNote['led']));
|
||||
}
|
||||
|
||||
public function setNote($iCourseId, $asOps) {
|
||||
$oCourse = new Course($this->oDb, $iCourseId);
|
||||
$sError = $oCourse->setNote($asOps);
|
||||
$bSuccess = ($sError=='');
|
||||
|
||||
return self::getJsonResult(($sError==''), $sError, array('led' => $oCourse->getNote()['led']));
|
||||
}
|
||||
|
||||
/*
|
||||
public function upload()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user