33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2025-04-06 12:51:50 +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' ); 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');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive'); jimport('joomla.filesystem.archive');
class jedcheckerControllerPolice extends JController class jedcheckerControllerPolice extends JControllerlegacy
{ {
public function check() public function check()
{ {

View File

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

View File

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

View File

@ -9,99 +9,103 @@
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.mootools', true); JHTML::_('behavior.framework', true);
JHtml::_('behavior.formvalidation'); JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive'); JHtml::_('behavior.keepalive');
JHtml::stylesheet('media/com_jedchecker/css/css.css'); JHtml::stylesheet('media/com_jedchecker/css/css.css');
JHtml::script('media/com_jedchecker/js/police.js'); JHtml::script('media/com_jedchecker/js/police.js');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
Joomla.submitbutton = function (task) { Joomla.submitbutton = function (task) {
var options = <?php echo json_encode($this->jsOptions); ?>; var options = <?php echo json_encode($this->jsOptions); ?>;
if (task == 'police.check') { if (task == 'police.check') {
new police(options); new police(options);
return false; return false;
} }
Joomla.submitform(task); Joomla.submitform(task);
} }
</script> </script>
<div class="fltlft width-60"> <div class="fltlft width-60 span8">
<form action="<?php echo JRoute::_('index.php?option=com_jedchecker&view=uploads'); ?>" <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"> method="post" class="form form-validate" name="adminForm" id="adminForm" enctype="multipart/form-data">
<fieldset> <fieldset>
<p> <p>
<?php echo JText::sprintf('COM_JEDCHECKER_CONGRATS', 'http://extensions.joomla.org/index.php?option=com_content&id=50'); ?> <?php echo JText::sprintf('COM_JEDCHECKER_CONGRATS', 'http://extensions.joomla.org/index.php?option=com_content&id=50'); ?>
</p> </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::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> <p>
<ol> <?php echo JText::_('COM_JEDCHECKER_HOW_TO_USE'); ?>
<li> 1. <?php echo JText::_('COM_JEDCHECKER_STEP1'); ?></li> </p>
<li> 2. <?php echo JText::_('COM_JEDCHECKER_STEP2'); ?></li> <ol>
<li> 3. <?php echo JText::_('COM_JEDCHECKER_STEP3'); ?></li> <li> 1. <?php echo JText::_('COM_JEDCHECKER_STEP1'); ?></li>
</ol> <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"/> <input type="file" name="extension" class="required"/>
<button onclick="Joomla.submitbutton('uploads.upload')"> <button onclick="Joomla.submitbutton('uploads.upload')">
<?php echo JText::_('JSUBMIT'); ?> <?php echo JText::_('JSUBMIT'); ?>
</button> </button>
<input type="hidden" name="task" value=""/> <input type="hidden" name="task" value=""/>
<?php echo JHTML::_('form.token'); ?> <?php echo JHTML::_('form.token'); ?>
</fieldset> </fieldset>
</form> </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>
<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 id="prison" style="display:none;">
<div class="fltlft width-60"> <div class="fltlft width-60 span8">
<div id="police-check-result"></div> <div id="police-check-result"></div>
</div> </div>
<div class="fltrt width-40"> <div class="fltrt width-40 span4">
<div class="help"> <div class="help">
<h2> <h2>
<?php echo JText::_('COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS'); ?> <?php echo JText::_('COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS'); ?>
</h2> </h2>
<ul> <ul>
<?php <?php
foreach($this->jsOptions['rules'] AS $rule) foreach ($this->jsOptions['rules'] AS $rule) {
{ $class = 'jedcheckerRules' . ucfirst($rule);
$class = 'jedcheckerRules'.ucfirst($rule);
if(!class_exists($class)) continue; if (!class_exists($class)) continue;
$rule = new $class(); $rule = new $class();
?> ?>
<li> <li>
<p> <p>
<span class="rule"> <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> </span>
<p><?php echo JText::_($rule->get('description')); ?></p>
</p> <p><?php echo JText::_($rule->get('description')); ?></p>
</li> </p>
<?php </li>
} <?php
?> }
</ul> ?>
</div> </ul>
</div> </div>
</div>
</div> </div>
<div class="clr"></div> <div class="clr clearfix"></div>
<div class="copyright"> <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_LEAVE_A_REVIEW_JED', 'http://extensions.joomla.org/extensions/tools/development-tools/21336'); ?>
<?php echo JText::sprintf('COM_JEDCHECKER_DEVELOPED_BY', 'https://compojoom.com'); ?> :) <br/>
<?php echo JText::sprintf('COM_JEDCHECKER_DEVELOPED_BY', 'https://compojoom.com'); ?> :)
</div> </div>

View File

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