/* ------------------------------------------------------------ end: objects */ #error_reporting( E_ALL & ~E_NOTICE ); /* Set variables ----------------------------------------------------------- */ $rangeID = Request::option('rangeID', $SessSemName[1]); if (empty($rangeID)) { $rangeID = $user->id; } $evalID = Request::option('evalID'); $tree = new EvaluationTreeShowUser($evalID); $eval = $tree->tree->eval; $evalDB = new EvaluationDB(); $isPreview = Request::option('isPreview') ? YES : NO; $votedEarlier = $eval->hasVoted($auth->auth["uid"]) && $isPreview == NO; $votedNow = Request::submitted('voteButton') && $votedEarlier == NO; if ($eval->isAnonymous()) { $userID = StudipObject::createNewID(); } else { $userID = $auth->auth["uid"]; } /* ---------------------------------------------------------- end: variables */ $br = new HTMpty("br"); /* Surrounding Form -------------------------------------------------------- */ $form = new HTM("form"); $form->attr("action", URLHelper::getLink(Request::url())); $form->attr("method", "post"); $form->html(CSRFProtection::tokenTag()); if (Request::isXHR()) { header('X-Title:' . _("Stud.IP Online-Evaluation")); } else { // TODO: This should use Assets::img() but on the other hand it should also use templates $titlebar = EvalCommon::createTitle(_("Stud.IP Online-Evaluation"), Icon::create('test', 'info_alt')->asImagePath());
/** * Constructor * @param string $objectID The ID of an existing object * @param EvaluationObject $parentObject The parent object * @param integer $loadChildren See const EVAL_LOAD_*_CHILDREN * @access public */ function EvaluationObject($objectID = "", $parentObject = NULL, $loadChildren = EVAL_LOAD_NO_CHILDREN) { /* Set default values -------------------------------------------------- */ parent::StudipObject($objectID); $this->setAuthorEmail("*****@*****.**"); $this->setAuthorName("Alexander Willner"); $this->instanceof = INSTANCEOF_EVALOBJECT; $this->parentObject = $parentObject; $this->loadChildren = $loadChildren; $this->db = NULL; $this->childObjects = array(); $this->numberChildren = 0; $this->title = ""; $this->text = ""; $this->position = 0; $this->childNum = 0; /* --------------------------------------------------------------------- */ }
/** * Creates a new temporary file * @access public */ function createNewFile() { $randomID = StudipObject::createNewID(); $this->filename = EVALEXPORT_PREFIX . $randomID . "." . $this->extension; export_tmp_gc(); if (!is_dir(EVALEXPORT_PATH_TEMP)) { return $this->throwError(1, sprintf(_("ExportManager::Das Verzeichnis %s existiert nicht."), EVALEXPORT_PATH_TEMP)); } if (!is_writable(EVALEXPORT_PATH_TEMP)) { return $this->throwError(2, sprintf(_("ExportManager::Das Verzeichnis %s ist nicht schreibbar nicht."), EVALEXPORT_PATH_TEMP)); } $this->filehandle = @fopen(EVALEXPORT_PATH_TEMP . "/" . $this->filename, "w"); if (empty($this->filehandle)) { return $this->throwError(3, _("ExportManager::Konnte temporäre Datei nicht erstellen.")); } }