33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-23 21:27:35 +00:00

Implemented tmp/jed_checker/local.txt file

This commit is contained in:
Jisse Reitsma 2013-02-12 10:04:49 +01:00
parent cc1a81c387
commit e10f996500
2 changed files with 13 additions and 4 deletions

View File

@ -78,7 +78,7 @@ class jedcheckerControllerPolice extends JControllerlegacy
}
// Parse the local.txt file and parse it
$local = JFactory::getConfig()->get('tmp_path') . '/com_jedchecker/local.txt';
$local = JFactory::getConfig()->get('tmp_path') . '/jed_checker/local.txt';
if (JFile::exists($local)) {
$content = JFile::read($local);
if (!empty($content)) {

View File

@ -42,7 +42,7 @@ class jedcheckerViewUploads extends JViewLegacy
JToolBarHelper::custom('uploads.unzip', 'unzip', 'unzip', 'unzip', false);
}
if($this->filesExist('unzipped')) {
JToolBarHelper::custom('police.check', 'police-check', 'police-check', 'check', false);
JToolBarHelper::custom('police.check', 'police-check', 'police-check', 'Check', false);
}
JToolBarHelper::title('JED checker');
@ -53,13 +53,22 @@ class jedcheckerViewUploads extends JViewLegacy
* @param $type
* @return bool
*/
private function filesExist($type) {
private function filesExist($type)
{
$path = JFactory::getConfig()->get('tmp_path') . '/jed_checker/'.$type;
// Check for the existence of files
jimport('joomla.filesystem.folder');
if(JFolder::exists($path)) {
if(JFolder::folders($path, '.', false) || JFolder::files($path, '.', false)) {
return true;
}
} else {
$local = JFactory::getConfig()->get('tmp_path') . '/jed_checker/local.txt';
if ($type == 'unzipped' && JFile::exists($local)) {
return true;
}
}
return false;
}