/** * This is a standard function to update the configuration parameters of the * module given the information passed back by the modification form */ public function updateconfig() { $this->throwForbiddenUnless(SecurityUtil::checkPermission('Feeds::', "::", ACCESS_ADMIN), LogUtil::getErrorMsgPermission()); $this->checkCsrfToken(); // update module variables $enablecategorization = (bool)FormUtil::getPassedValue('enablecategorization', false, 'POST'); $this->setVar('enablecategorization', $enablecategorization); $bold = (bool)FormUtil::getPassedValue('bold', 0, 'POST'); $this->setVar('bold', $bold); $openinnewwindow = (bool)FormUtil::getPassedValue('openinnewwindow', 0, 'POST'); $this->setVar('openinnewwindow', $openinnewwindow); $itemsperpage = (int)FormUtil::getPassedValue('itemsperpage', 10, 'POST'); $this->setVar('itemsperpage', $itemsperpage); $multifeedlimit = (int)FormUtil::getPassedValue('multifeedlimit', 0, 'POST'); $this->setVar('multifeedlimit', $multifeedlimit); $cacheinterval = (int)FormUtil::getPassedValue('cacheinterval', 3600, 'POST'); $this->setVar('cacheinterval', $cacheinterval); $cachedirectory = (string)FormUtil::getPassedValue('cachedirectory', 'feeds', 'POST'); $this->setVar('cachedirectory', $cachedirectory); $usingcronjob = (string)FormUtil::getPassedValue('usingcronjob', 'feeds', 'POST'); $this->setVar('usingcronjob', $usingcronjob); // make sure a key has been generated if (!ModUtil::hasVar('Feeds', 'key')) { $this->setVar('key', md5(time())); } // the module configuration has been updated successfuly LogUtil::registerStatus($this->__('Done! Module configuration updated.')); $this->redirect(ModUtil::url('Feeds', 'admin', 'view')); }
/** * Update the IWmyrole module * @author Albert Pérez Monfort (aperezm@xtec.cat) * @author Jaume Fernàndez Valiente (jfern343@xtec.cat) * @return bool true if successful, false otherwise */ public function upgrade($oldversion) { if (!ModUtil::hasVar('IWmyrole', 'groupsNotChangeable')) { $this->setVar('groupsNotChangeable', ''); } return true; }
/** * Checks to see if a module variable is set. * * @deprecated * @see ModUtil::hasVar() * * @param string $modname The name of the module. * @param string $name The name of the variable. * * @return boolean True if the variable exists in the database, false if not. */ function pnModVarExists($modname, $name) { LogUtil::log(__f('Warning! Function %1$s is deprecated. Please use %2$s instead.', array(__FUNCTION__, 'ModUtil::hasVar()')), E_USER_DEPRECATED); return ModUtil::hasVar($modname, $name); }