本文整理汇总了PHP中RSMembershipHelper::isJ25方法的典型用法代码示例。如果您正苦于以下问题:PHP RSMembershipHelper::isJ25方法的具体用法?PHP RSMembershipHelper::isJ25怎么用?PHP RSMembershipHelper::isJ25使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSMembershipHelper
的用法示例。
在下文中一共展示了RSMembershipHelper::isJ25方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unpatchmenu
function unpatchmenu()
{
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
jimport('joomla.filesystem.file');
$menu = RSMembershipHelper::getPatchFile('menu');
$buffer = JFile::read($menu);
if (strpos($buffer, 'RSMembershipHelper') === false) {
return $this->setRedirect('index.php?option=com_rsmembership&view=configuration&tabposition=1', JText::_('RSM_PATCH_NOT_APPLIED'));
}
if (!is_writable($menu)) {
JError::raiseWarning(500, JText::_('RSM_PATCH_NOT_WRITABLE'));
return $this->setRedirect('index.php?option=com_rsmembership&view=configuration&tabposition=1');
}
if (RSMembershipHelper::isJ16()) {
if (RSMembershipHelper::isJ25()) {
$with = "\$items \t\t= \$menu->getItems('menutype', \$params->get('menutype'));";
} else {
$with = "\$items \t\t= \$menu->getItems('menutype',\$params->get('menutype'));";
}
$replace = $with . "\n" . "\t\t" . "if (file_exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rsmembership'.DS.'helpers'.DS.'rsmembership.php')) {" . "\n" . "\t\t\t" . "include_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rsmembership'.DS.'helpers'.DS.'rsmembership.php');" . "\n" . "\t\t\t" . "RSMembershipHelper::checkMenuShared(\$items);" . "\n" . "\t\t" . "}" . "\n";
$buffer = str_replace($replace, $with, $buffer);
} else {
$possibles = array("\n" . "\t\t\t" . "RSMembershipHelper::checkMenuShared(&\$rows);", "\n" . "\t\t\t" . "RSMembershipHelper::checkMenuShared(\$rows);");
foreach ($possibles as $possible) {
$with = "\$rows = \$items->getItems('menutype', \$params->get('menutype'));";
$replace = $with . "\n" . "\t\t" . "if (file_exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rsmembership'.DS.'helpers'.DS.'rsmembership.php')) {" . "\n" . "\t\t\t" . "include_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_rsmembership'.DS.'helpers'.DS.'rsmembership.php');" . $possible . "\n" . "\t\t" . "}" . "\n";
$buffer = str_replace($replace, $with, $buffer);
}
}
if (JFile::write($menu, $buffer)) {
return $this->setRedirect('index.php?option=com_rsmembership&view=configuration', JText::_('RSM_PATCH_REMOVED_SUCCESS'));
}
JError::raiseWarning(500, JText::_('RSM_PATCH_NOT_WRITABLE'));
$this->setRedirect('index.php?option=com_rsmembership&view=configuration&tabposition=1');
}