本文整理汇总了PHP中ModUtil::hasVar方法的典型用法代码示例。如果您正苦于以下问题:PHP ModUtil::hasVar方法的具体用法?PHP ModUtil::hasVar怎么用?PHP ModUtil::hasVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModUtil
的用法示例。
在下文中一共展示了ModUtil::hasVar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateconfig
/**
* 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'));
}
示例2: upgrade
/**
* 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;
}
示例3: pnModVarExists
/**
* 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);
}