mirror of
https://github.com/joomla-extensions/patchtester.git
synced 2024-11-15 17:47:10 +00:00
Less else
This commit is contained in:
parent
003b9c5791
commit
cbd5fcc1dc
@ -425,13 +425,11 @@ class PullsModel extends \JModelDatabase
|
||||
|
||||
return (int) $this->getDb()->loadResult();
|
||||
}
|
||||
// Otherwise fall back to inefficient way of counting all results.
|
||||
else
|
||||
{
|
||||
$this->getDb()->setQuery($query)->execute();
|
||||
|
||||
return (int) $this->getDb()->getNumRows();
|
||||
}
|
||||
// Otherwise fall back to inefficient way of counting all results.
|
||||
$this->getDb()->setQuery($query)->execute();
|
||||
|
||||
return (int) $this->getDb()->getNumRows();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,32 +31,30 @@ class DefaultHtmlView extends \JViewHtml
|
||||
$file = isset($tpl) ? $this->getLayout() . '_' . $tpl : $this->getLayout();
|
||||
$path = $this->getPath($file);
|
||||
|
||||
if ($path)
|
||||
{
|
||||
// Unset so as not to introduce into template scope
|
||||
unset($tpl);
|
||||
unset($file);
|
||||
|
||||
// Never allow a 'this' property
|
||||
if (isset($this->this))
|
||||
{
|
||||
unset($this->this);
|
||||
}
|
||||
|
||||
// Start an output buffer.
|
||||
ob_start();
|
||||
|
||||
// Load the template.
|
||||
include $path;
|
||||
|
||||
// Get the layout contents.
|
||||
$output = ob_get_clean();
|
||||
|
||||
return $output;
|
||||
}
|
||||
else
|
||||
if (!$path)
|
||||
{
|
||||
throw new \RuntimeException(\JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file), 500);
|
||||
}
|
||||
|
||||
// Unset so as not to introduce into template scope
|
||||
unset($tpl);
|
||||
unset($file);
|
||||
|
||||
// Never allow a 'this' property
|
||||
if (isset($this->this))
|
||||
{
|
||||
unset($this->this);
|
||||
}
|
||||
|
||||
// Start an output buffer.
|
||||
ob_start();
|
||||
|
||||
// Load the template.
|
||||
include $path;
|
||||
|
||||
// Get the layout contents.
|
||||
$output = ob_get_clean();
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user