mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2025-01-03 22:57:21 +00:00
switch to use of JEDCheckerHelper in xmlfiles
This commit is contained in:
parent
73db135bcb
commit
1b3b020322
@ -13,6 +13,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// Include the rule base class
|
// Include the rule base class
|
||||||
require_once JPATH_COMPONENT_ADMINISTRATOR . '/models/rule.php';
|
require_once JPATH_COMPONENT_ADMINISTRATOR . '/models/rule.php';
|
||||||
|
|
||||||
|
// Include the helper class
|
||||||
|
require_once JPATH_COMPONENT_ADMINISTRATOR . '/libraries/helper.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class JedcheckerRulesXMLFiles
|
* class JedcheckerRulesXMLFiles
|
||||||
@ -229,79 +232,24 @@ class JedcheckerRulesXMLFiles extends JEDcheckerRule
|
|||||||
{
|
{
|
||||||
$attributes = array('addfieldpath', 'addformpath', 'addrulepath');
|
$attributes = array('addfieldpath', 'addformpath', 'addrulepath');
|
||||||
|
|
||||||
|
$element = JEDCheckerHelper::getElementName($xml);
|
||||||
$extensionPath = false;
|
$extensionPath = false;
|
||||||
|
|
||||||
// @TODO move element name extraction into a helper (similar code is used in XMLinfo rule)
|
$type = (string) $xml['type'];
|
||||||
switch ((string) $xml['type'])
|
|
||||||
|
switch ($type)
|
||||||
{
|
{
|
||||||
case 'module':
|
case 'module':
|
||||||
if (isset($xml->element))
|
|
||||||
{
|
|
||||||
$element = (string) $xml->element;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$element = (string) $xml->name;
|
|
||||||
|
|
||||||
if (isset($xml->files))
|
|
||||||
{
|
|
||||||
foreach ($xml->files->children() as $child)
|
|
||||||
{
|
|
||||||
if (isset($child['module']))
|
|
||||||
{
|
|
||||||
$element = (string) $child['module'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$element = strtolower(JFilterInput::getInstance()->clean($element, 'cmd'));
|
|
||||||
|
|
||||||
$extensionPath = 'modules/' . $element . '/';
|
$extensionPath = 'modules/' . $element . '/';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'plugin':
|
case 'plugin':
|
||||||
if (isset($xml->element))
|
|
||||||
{
|
|
||||||
$element = (string) $xml->element;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$element = (string) $xml->name;
|
|
||||||
|
|
||||||
if (isset($xml->files))
|
|
||||||
{
|
|
||||||
foreach ($xml->files->children() as $child)
|
|
||||||
{
|
|
||||||
if (isset($child['plugin']))
|
|
||||||
{
|
|
||||||
$element = (string) $child['plugin'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$element = strtolower(JFilterInput::getInstance()->clean($element, 'cmd'));
|
|
||||||
|
|
||||||
$group = (string) $xml['group'];
|
$group = (string) $xml['group'];
|
||||||
|
|
||||||
$extensionPath = 'plugins/' . $group . '/' . $element . '/';
|
$extensionPath = 'plugins/' . $group . '/' . $element . '/';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'template':
|
case 'template':
|
||||||
if (isset($xml->element))
|
|
||||||
{
|
|
||||||
$element = (string) $xml->element;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$element = (string) $xml->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
$element = strtolower(JFilterInput::getInstance()->clean($element, 'cmd'));
|
|
||||||
|
|
||||||
$extensionPath = 'templates/' . $element . '/';
|
$extensionPath = 'templates/' . $element . '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user