View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
10571 | Feature requests | Plugins | public | 2016-02-24 10:02 | 2016-06-06 15:41 |
Reporter | DenisChenu | Assigned To | DenisChenu | ||
Priority | normal | Severity | feature | ||
Status | closed | Resolution | fixed | ||
Fixed in Version | 2.5+ | ||||
Summary | 10571: beforeController event | ||||
Description | It's great to havbe a beforeController everywhere : any plugin can use own view and product page using LS. | ||||
Additional Information | Actaully : we have beforeSurveyPage happen for survey. In 2.05 this happen for a lot of public part. But in 2.50 : this only happen for survey, not for survey listing or admin page. Think adding a new event everywhere X times is a bad idea, but add ONE event every time is better. This event can send
We can use afterPluginLoad BUT : when afterPluginLoad not whole LS is loaded : for example Permission model is totally broken at this part (tested) We have actually Piwik-for-Limesurvey working with afterPluginLoad but have some issue https://github.com/SteveCohen/Piwik-for-Limesurvey/issues/14 Think the best place is here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/core/LSYii_Controller.php#L140 Send a controller made for potentially replacing survey listing with some plugin (using App()->end() in plugin) | ||||
Tags | No tags attached. | ||||
Attached Files | HomeController.php (1,179 bytes)
<?php /** * Description * * @author Denis Chenu <denis@sondages.pro> * @copyright 2015 Denis Chenu <http://www.sondages.pro> * @license GPL v3 * @version 0.0.1 * * 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 * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ class HomeController extends LSYii_Controller { public $layout = 'bare'; public $defaultAction = 'index'; public function actionIndex($sid = null) { App()->getPluginManager()->loadPlugins(); $oEvent = new PluginEvent('beforeHomePage'); $oEvent->set('controller',Yii::app()->controller()->getId()); App()->getPluginManager()->dispatchEvent($oEvent); $this->forward("surveys/publicList"); } } | ||||
Bug heat | 2 | ||||
Story point estimate | |||||
Users affected % | |||||
PS : in 2.06 : loadPlugin don't happen for survey listing (and surely 404 too) |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=18680 |
|
Need in 3.0 too |
|
LimeSurvey: master 2adc40df 2016-04-20 10:09 Details Diff |
New feature 10571: beforeController event (for web) Dev: use Yii beforeControllerAction function Dev: send controller+action, other params can be found via API Dev: Can set run to false to deactivate default action Dev: better system than afterPluginLoad of 2.05 hack plugin |
Affected Issues 10571 |
|
mod - application/core/LSYii_Application.php | Diff File | ||
LimeSurvey: master ecdfce38 2016-04-22 08:19 Details Diff |
Merge pull request #481 from Shnoulle/master_beforeController_event New feature 10571: beforeController event (for web) |
Affected Issues 10571 |
|
mod - application/core/LSYii_Application.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-02-24 10:02 | DenisChenu | New Issue | |
2016-02-24 10:02 | DenisChenu | File Added: HomeController.php | |
2016-02-24 10:03 | DenisChenu | Note Added: 35637 | |
2016-04-20 11:00 | DenisChenu | Assigned To | => DenisChenu |
2016-04-20 11:00 | DenisChenu | Status | new => assigned |
2016-04-22 08:19 | DenisChenu | Changeset attached | => LimeSurvey master 2adc40df |
2016-04-22 08:19 | DenisChenu | Changeset attached | => LimeSurvey master ecdfce38 |
2016-04-22 08:19 | DenisChenu | Note Added: 37670 | |
2016-04-22 08:19 | DenisChenu | Resolution | open => fixed |
2016-04-22 12:06 | DenisChenu | Note Added: 37686 | |
2016-04-22 12:06 | DenisChenu | Status | assigned => resolved |
2016-04-22 12:06 | DenisChenu | Fixed in Version | => 2.5+ |
2016-06-06 15:41 | c_schmitz | Status | resolved => closed |