/** * Overload the setBaseURL method. */ public function setBaseURL($base = null) { // First get the config object $registry = Zmax_Bootstrap::getRegistry(); $zmax_context = $registry->get("zmax_context"); $config = $zmax_context->config; // Remove the trailing '/' parent::setBaseUrl($this->cleanUrl($config->app->base_url)); }
/** * This function is executed when a Paper object is instantiated. We * look for the associated object if this is an existing paper. */ function init() { $this->_authors = array(); $this->_answers = array(); $this->_abstract = array(); $this->_hideAuthors = false; if (!empty($this->id)) { $authorTbl = new Author(); $authors = $authorTbl->fetchAll("id_paper='{$this->id}'", 'position ASC'); $i = 0; foreach ($authors as $author) { $user = $author->findParentUser(); if (!is_object($user)) { echo "Unkown user in {$this->id}<br/>"; } else { $this->_authors[] = $user; if ($this->emailContact == $user->email) { $this->_contactAuthor = $i; } } $i++; } // Fetch the answers if (self::$loadAnswers) { $answers = $this->findPaperAnswer(); foreach ($answers as $answer) { $this->_answers[$answer->id_question] = $answer; } } // Fetch the abstract if (self::$loadAbstracts) { $this->_abstract = $this->initAbstracts(); } } // get the default number of authors $registry = Zmax_Bootstrap::getRegistry(); $zmax_context = $registry->get("zmax_context"); $config = $zmax_context->config; $defaultNbAuthorsInform = $config->app->nb_authors_in_form; // Set the file path $this->_filePath = $config->app->upload_path; // NB: the nb of authors shown is at least $defaultNbAuthorsInform, or the current number of authors // if the latter is greater. $this->nb_authors_in_form = max($defaultNbAuthorsInform, $this->nbAuthors()); }