33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-27 15:26:36 +00:00

joomla 3.0 compatibility

This commit is contained in:
Daniel Dimitrov 2012-12-13 11:08:35 +01:00
parent b2a157e820
commit baf2248deb
6 changed files with 98 additions and 90 deletions

View File

@ -9,7 +9,7 @@
defined( '_JEXEC' ) or die ( 'Restricted access' );
class jedcheckerController extends JController
class jedcheckerController extends JControllerlegacy
{
}

View File

@ -11,10 +11,11 @@ defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
class jedcheckerControllerPolice extends JController
class jedcheckerControllerPolice extends JControllerlegacy
{
public function check()
{

View File

@ -10,9 +10,10 @@
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
class jedcheckerControllerUploads extends JController
class jedcheckerControllerUploads extends JControllerlegacy
{
public function __construct()
{

View File

@ -8,12 +8,13 @@
*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.controller');
jimport('joomla.application.component.controllerlegacy');
$view = JRequest::getCmd('view','');
if($view == '' && JRequest::getCmd('task') == '') {
JRequest::setVar('view', 'uploads');
$input = JFactory::getApplication()->input;
$view = $input->getCmd('view','');
if($view == '' && $input->getCmd('task', '') == '') {
$input->set('view', 'uploads');
}
$controller = JController::getInstance('jedchecker');
$controller->execute(JRequest::getCmd('task'));
$controller = JControllerLegacy::getInstance('jedchecker');
$controller->execute($input->getCmd('task',''));
$controller->redirect();

View File

@ -9,99 +9,103 @@
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.mootools', true);
JHTML::_('behavior.framework', true);
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
JHtml::stylesheet('media/com_jedchecker/css/css.css');
JHtml::script('media/com_jedchecker/js/police.js');
?>
<script type="text/javascript">
Joomla.submitbutton = function (task) {
var options = <?php echo json_encode($this->jsOptions); ?>;
if (task == 'police.check') {
new police(options);
return false;
}
Joomla.submitform(task);
}
Joomla.submitbutton = function (task) {
var options = <?php echo json_encode($this->jsOptions); ?>;
if (task == 'police.check') {
new police(options);
return false;
}
Joomla.submitform(task);
}
</script>
<div class="fltlft width-60">
<form action="<?php echo JRoute::_('index.php?option=com_jedchecker&view=uploads'); ?>"
method="post" class="form form-validate" name="adminForm" id="adminForm" enctype="multipart/form-data">
<fieldset>
<p>
<?php echo JText::sprintf('COM_JEDCHECKER_CONGRATS', 'http://extensions.joomla.org/index.php?option=com_content&id=50'); ?>
</p>
<p>
<?php echo JText::sprintf('COM_JEDCHECKER_CODE_STANDARDS', 'http://developer.joomla.org/coding-standards.html', 'https://github.com/compojoom/jedchecker'); ?>
</p>
<p>
<?php echo JText::_('COM_JEDCHECKER_HOW_TO_USE'); ?>
</p>
<ol>
<li> 1. <?php echo JText::_('COM_JEDCHECKER_STEP1'); ?></li>
<li> 2. <?php echo JText::_('COM_JEDCHECKER_STEP2'); ?></li>
<li> 3. <?php echo JText::_('COM_JEDCHECKER_STEP3'); ?></li>
</ol>
<div class="fltlft width-60 span8">
<form action="<?php echo JRoute::_('index.php?option=com_jedchecker&view=uploads'); ?>"
method="post" class="form form-validate" name="adminForm" id="adminForm" enctype="multipart/form-data">
<fieldset>
<p>
<?php echo JText::sprintf('COM_JEDCHECKER_CONGRATS', 'http://extensions.joomla.org/index.php?option=com_content&id=50'); ?>
</p>
<p>
<?php echo JText::sprintf('COM_JEDCHECKER_CODE_STANDARDS', 'http://developer.joomla.org/coding-standards.html', 'https://github.com/compojoom/jedchecker'); ?>
</p>
<p>
<?php echo JText::_('COM_JEDCHECKER_HOW_TO_USE'); ?>
</p>
<ol>
<li> 1. <?php echo JText::_('COM_JEDCHECKER_STEP1'); ?></li>
<li> 2. <?php echo JText::_('COM_JEDCHECKER_STEP2'); ?></li>
<li> 3. <?php echo JText::_('COM_JEDCHECKER_STEP3'); ?></li>
</ol>
<input type="file" name="extension" class="required"/>
<button onclick="Joomla.submitbutton('uploads.upload')">
<?php echo JText::_('JSUBMIT'); ?>
</button>
<input type="hidden" name="task" value=""/>
<?php echo JHTML::_('form.token'); ?>
</fieldset>
</form>
<input type="file" name="extension" class="required"/>
<button onclick="Joomla.submitbutton('uploads.upload')">
<?php echo JText::_('JSUBMIT'); ?>
</button>
<input type="hidden" name="task" value=""/>
<?php echo JHTML::_('form.token'); ?>
</fieldset>
</form>
</div>
<div class="fltrt width-40 span4">
<div class="help">
<h2><?php echo JText::_('COM_JEDCHECKER_WALL_OF_HONOR'); ?></h2>
<p><?php echo JText::_('COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT'); ?></p>
<ul>
<li>Tobias Kuhn (<a href="http://projectfork.net" target="_blank">projectfork</a>)</li>
<li>Peter van Westen (<a href="http://www.nonumber.nl" target="_blank">NoNumber</a>)</li>
<li>Alain Rivest (<a href="http://aldra.ca" target="_blank">Aldra.ca</a>)</li>
<li>OpenTranslators (<a href="http://opentranslators.org" target="_blank">opentranslators.org</a>)</li>
</ul>
</div>
</div>
<div class="fltrt width-40">
<div class="help">
<h2><?php echo JText::_('COM_JEDCHECKER_WALL_OF_HONOR'); ?></h2>
<p><?php echo JText::_('COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT'); ?></p>
<ul>
<li>Tobias Kuhn (<a href="http://projectfork.net" target="_blank">projectfork</a>)</li>
<li>Peter van Westen (<a href="http://www.nonumber.nl" target="_blank">NoNumber</a>)</li>
<li>Alain Rivest (<a href="http://aldra.ca" target="_blank">Aldra.ca</a>)</li>
<li>OpenTranslators (<a href="http://opentranslators.org" target="_blank">opentranslators.org</a>)</li>
</ul>
</div>
</div>
<div id="prison" style="display:none;">
<div class="fltlft width-60">
<div id="police-check-result"></div>
</div>
<div class="fltrt width-40">
<div class="help">
<h2>
<?php echo JText::_('COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS'); ?>
</h2>
<ul>
<?php
foreach($this->jsOptions['rules'] AS $rule)
{
$class = 'jedcheckerRules'.ucfirst($rule);
<div class="fltlft width-60 span8">
<div id="police-check-result"></div>
</div>
<div class="fltrt width-40 span4">
<div class="help">
<h2>
<?php echo JText::_('COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS'); ?>
</h2>
<ul>
<?php
foreach ($this->jsOptions['rules'] AS $rule) {
$class = 'jedcheckerRules' . ucfirst($rule);
if(!class_exists($class)) continue;
$rule = new $class();
?>
<li>
<p>
if (!class_exists($class)) continue;
$rule = new $class();
?>
<li>
<p>
<span class="rule">
<?php echo JText::_('COM_JEDCHECKER_RULE').' '.$rule->get('id').' - '.JText::_($rule->get('title'));?>
<?php echo JText::_('COM_JEDCHECKER_RULE') . ' ' . $rule->get('id') . ' - ' . JText::_($rule->get('title'));?>
</span>
<p><?php echo JText::_($rule->get('description')); ?></p>
</p>
</li>
<?php
}
?>
</ul>
</div>
</div>
<p><?php echo JText::_($rule->get('description')); ?></p>
</p>
</li>
<?php
}
?>
</ul>
</div>
</div>
</div>
<div class="clr"></div>
<div class="copyright">
<?php echo JText::sprintf('COM_JEDCHECKER_LEAVE_A_REVIEW_JED', 'http://extensions.joomla.org/extensions/tools/development-tools/21336'); ?> <br />
<?php echo JText::sprintf('COM_JEDCHECKER_DEVELOPED_BY', 'https://compojoom.com'); ?> :)
<div class="clr clearfix"></div>
<div class="copyright row-fluid">
<?php echo JText::sprintf('COM_JEDCHECKER_LEAVE_A_REVIEW_JED', 'http://extensions.joomla.org/extensions/tools/development-tools/21336'); ?>
<br/>
<?php echo JText::sprintf('COM_JEDCHECKER_DEVELOPED_BY', 'https://compojoom.com'); ?> :)
</div>

View File

@ -9,9 +9,9 @@
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
jimport('joomla.application.component.viewlegacy');
class jedcheckerViewUploads extends JView
class jedcheckerViewUploads extends JViewLegacy
{
public function display($tpl = null)
@ -55,6 +55,7 @@ class jedcheckerViewUploads extends JView
*/
private function filesExist($type) {
$path = JFactory::getConfig()->get('tmp_path') . '/jed_checker/'.$type;
jimport('joomla.filesystem.folder');
if(JFolder::exists($path)) {
if(JFolder::folders($path, '.', false) || JFolder::files($path, '.', false)) {
return true;