/** * Set the enabled/disabled state of this plugin */ function setEnabled($enabled) { parent::setEnabled($enabled); $journal =& Request::getJournal(); if ($journal) { // set default XSLT renderer if ($this->getSetting($journal->getId(), 'XSLTrenderer') == "") { // Determine the appropriate XSLT processor for the system if (version_compare(PHP_VERSION, '5', '>=') && extension_loaded('xsl') && extension_loaded('dom')) { // PHP5.x with XSL/DOM modules $this->updateSetting($journal->getId(), 'XSLTrenderer', 'PHP5'); } elseif (version_compare(PHP_VERSION, '5', '<') && extension_loaded('xslt')) { // PHP4.x with XSLT module $this->updateSetting($journal->getId(), 'XSLTrenderer', 'PHP4'); } else { $this->updateSetting($journal->getId(), 'XSLTrenderer', 'external'); } } // set default XSL stylesheet to NLM if ($this->getSetting($journal->getId(), 'XSLstylesheet') == "") { $this->updateSetting($journal->getId(), 'XSLstylesheet', 'NLM'); } return true; } return false; }