new text editor: tinyMCE

This commit is contained in:
2020-02-24 21:37:14 +01:00
parent abcb059355
commit 3fd854ddf1
15 changed files with 425 additions and 145 deletions

View File

@@ -35,10 +35,10 @@ class Note extends PhpObject {
return array(Db::getId(Auth::USER_TABLE) => $this->iUserId, Db::getId(Course::COURSE_TABLE) => $this->iCourseId);
}
public function getNote() {
public function getNoteOld() {
$asCourse = $this->oDb->selectRow(self::NOTE_TABLE, $this->getNoteKeys());
if(!empty($asCourse)) {
$asCourse['notes'] = json_decode($asCourse['notes'], true);
$asCourse['notes'] = json_decode($asCourse['notes_old'], true);
$asCourse['led_date'] = date('d/m/Y', strtotime($asCourse['led']));
$asCourse['led_time'] = date('H:i');
}
@@ -46,11 +46,21 @@ class Note extends PhpObject {
return $asCourse;
}
public function setNote($asOps) {
public function getNote() {
$asCourse = $this->oDb->selectRow(self::NOTE_TABLE, $this->getNoteKeys());
if(!empty($asCourse)) {
$asCourse['led_date'] = date('d/m/Y', strtotime($asCourse['led']));
$asCourse['led_time'] = date('H:i');
}
return $asCourse;
}
public function setNote($sNotes) {
$sError = '';
if($this->iUserId > 0 && $this->iCourseId > 0) {
$asData = array_merge($this->getNoteKeys(), array('notes'=>json_encode($asOps)));
$asData = array_merge($this->getNoteKeys(), array('notes'=>$sNotes));
$iNoteId = $this->oDb->insertUpdateRow(self::NOTE_TABLE, $asData, array_keys($this->getNoteKeys()));
if(!$iNoteId) $sError = $this->oDb->getLastError();
}