Commit 625421a3 by Denis Chenu

[fix] 2.6X compatible version

parent 7c2294fa
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
* The plugin event redirect system * The plugin event redirect system
* *
* @author Denis Chenu <denis@sondages.pro> * @author Denis Chenu <denis@sondages.pro>
* @copyright 2016 Denis Chenu <http://www.sondages.pro> * @copyright 2016-2017 Denis Chenu <https://www.sondages.pro>
* @copyright 2016 Advantage <http://www.advantage.fr> * @copyright 2016 Advantage <http://www.advantage.fr>
* @license GPL v3 * @license AGPL v3
* @version 0.1.1 * @version 1.1.1
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
...@@ -296,6 +296,7 @@ class adminStats extends \ls\pluginmanager\PluginBase ...@@ -296,6 +296,7 @@ class adminStats extends \ls\pluginmanager\PluginBase
break; break;
case "F": case "F":
$iNumAnswers=Answer::model()->count("qid=:qid AND concat('',code * 1) = code",array(":qid"=>$oQuestion->qid)); $iNumAnswers=Answer::model()->count("qid=:qid AND concat('',code * 1) = code",array(":qid"=>$oQuestion->qid));
if($iNumAnswers) if($iNumAnswers)
{ {
$oSubQuestions=Question::model()->findAll(array("condition"=>"parent_qid=:qid AND language=:language","order"=>"question_order","params"=>array(":qid"=>$oQuestion->qid,":language"=>$oSurvey->language))); $oSubQuestions=Question::model()->findAll(array("condition"=>"parent_qid=:qid AND language=:language","order"=>"question_order","params"=>array(":qid"=>$oQuestion->qid,":language"=>$oSurvey->language)));
...@@ -437,10 +438,10 @@ class adminStats extends \ls\pluginmanager\PluginBase ...@@ -437,10 +438,10 @@ class adminStats extends \ls\pluginmanager\PluginBase
{ {
Yii::import('application.helpers.viewHelper'); Yii::import('application.helpers.viewHelper');
if ($this->event->get('target') != get_class()) if ($this->event->get('target') != get_class()) {
return; return;
if(Yii::app()->user->getIsGuest()) }
{ if(Yii::app()->user->getIsGuest()) {
App()->user->setReturnUrl(App()->request->requestUri); App()->user->setReturnUrl(App()->request->requestUri);
App()->controller->redirect(array('/admin/authentication')); App()->controller->redirect(array('/admin/authentication'));
} }
...@@ -1015,10 +1016,16 @@ class adminStats extends \ls\pluginmanager\PluginBase ...@@ -1015,10 +1016,16 @@ class adminStats extends \ls\pluginmanager\PluginBase
*/ */
private function render($fileRender) private function render($fileRender)
{ {
Yii::app()->bootstrap->init();
Yii::setPathOfAlias('adminStats', dirname(__FILE__)); Yii::setPathOfAlias('adminStats', dirname(__FILE__));
Yii::app()->clientScript->addPackage( 'boostrap-adminStats', array(
'basePath' => 'adminStats.vendor.bootstrap',
'css' => array('css/bootstrap.min.css'),
'js' => array('js/bootstrap.min.js'),
'depends' => array('jquery')
));
$oEvent=$this->event; $oEvent=$this->event;
Yii::app()->controller->layout='bare'; // bare don't have any HTML Yii::app()->controller->layout='bare'; // bare don't have any HTML
Yii::app()->getClientScript()->registerPackage('boostrap-adminStats');
$this->aRenderData['assetUrl']=$sAssetUrl=Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets'); $this->aRenderData['assetUrl']=$sAssetUrl=Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets');
//~ $this->aRenderData['chartjsUrl']=Yii::app()->assetManager->publish(dirname(__FILE__) . '/vendor/Chart.js'); //~ $this->aRenderData['chartjsUrl']=Yii::app()->assetManager->publish(dirname(__FILE__) . '/vendor/Chart.js');
$this->aRenderData['jqplotUrl']=Yii::app()->assetManager->publish(dirname(__FILE__) . '/vendor/jquery.jqplot'); $this->aRenderData['jqplotUrl']=Yii::app()->assetManager->publish(dirname(__FILE__) . '/vendor/jquery.jqplot');
......

4.62 KB | W: | H:

4.4 KB | W: | H:

assets/logo.png
assets/logo.png
assets/logo.png
assets/logo.png
  • 2-up
  • Swipe
  • Onion skin
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')
\ No newline at end of file
...@@ -44,42 +44,25 @@ ...@@ -44,42 +44,25 @@
?> ?>
</head> </head>
<body> <body>
<nav class="navbar navbar-default navbar-top">
<div class="navbar navbar-top">
<div class="navbar-inner">
<div class="container"> <div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <div class="navbar-header">
<span class="icon-bar"></span> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="icon-bar"></span> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> <span class="icon-bar"></span>
<div class="brand" href="#"><?php echo CHtml::link( <span class="icon-bar"></span>
CHtml::image("{$assetUrl}/logo.png"). </button>
CHtml::tag("div",array("class"=>'sr-only'),Yii::app()->getConfig("sitename")), <?php echo CHtml::link(
array("plugins/direct","plugin"=>"adminStats","function"=>"list") CHtml::tag("span",array("class"=>''),Yii::app()->getConfig("sitename")),
); ?> array("plugins/direct","plugin"=>"adminStats","function"=>"list"),
</div> array("class"=>'navbar-brand')
<div class="nav-collapse collapse"> ); ?>
<ul class="nav pull-right"> </div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="http://extensions.sondages.pro/">About</a><li>
<?php <?php
if(!empty($surveyList))
{
echo CHtml::tag('li',array(),
CHtml::link(gt("Surveys"),array('plugins/direct',"plugin"=>"adminStats","function"=>"list"))
);
//~ echo CHtml::tag('li',array('class'=>"dropdown"),"",false);
//~ echo CHtml::tag('a',array('class'=>"dropdown-toggle",'aria-expanded'=>'false','aria-haspopup'=>'true','role'=>'button','data-toggle'=>'dropdown'),gT("Surveys").' <b class="caret"></b>');
//~ echo CHtml::tag('ul',array('class'=>"dropdown-menu"),"",false);
//~ foreach($surveyList as $survey)
//~ {
//~ echo CHtml::tag('li',array(),
//~ CHtml::link($survey["surveyls_title"],array("plugins/direct","plugin"=>"adminStats","function"=>"stat","sid"=>$survey["sid"]))
//~ );
//~ }
//~ echo CHtml::closeTag('ul');
//~ echo CHtml::closeTag('li');
}
echo CHtml::tag('li',array('class'=>"dropdown"),"",false); echo CHtml::tag('li',array('class'=>"dropdown"),"",false);
echo CHtml::tag('a',array('class'=>"dropdown-toggle",'aria-expanded'=>'false','aria-haspopup'=>'true','role'=>'button','data-toggle'=>'dropdown'),Yii::app()->user->getName().' <b class="caret"></b>'); echo CHtml::tag('a',array('class'=>"dropdown-toggle",'aria-expanded'=>'false','aria-haspopup'=>'true','role'=>'button','data-toggle'=>'dropdown'),Yii::app()->user->getName().' <b class="caret"></b>');
echo CHtml::tag('ul',array('class'=>"dropdown-menu"),"",false); echo CHtml::tag('ul',array('class'=>"dropdown-menu"),"",false);
...@@ -94,12 +77,9 @@ ...@@ -94,12 +77,9 @@
echo CHtml::closeTag('ul'); echo CHtml::closeTag('ul');
echo CHtml::closeTag('li'); echo CHtml::closeTag('li');
?> ?>
</ul> </div><!--/.nav-collapse -->
</div><!--/.nav-collapse -->
</div> </div>
</div> </nav>
</div>
<div class="container"> <div class="container">
<?php <?php
Yii::app()->getController()->renderPartial("adminStats.views.{$subview}",$_data_); Yii::app()->getController()->renderPartial("adminStats.views.{$subview}",$_data_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment