Commit a267089a authored by Denis Chenu's avatar Denis Chenu
Browse files

[doc] Update comment

parent 637af7f7
......@@ -13,7 +13,7 @@ Demo plugin to show how to extend remote control in API
## LimeSurvey configuration
### With LimeSurvey 2.06 or lesser
### With LimeSurvey 2.06lts or lesser
To allow plugin to be called via RPC POST routine, you need to disable CsrfValidation for plugins/direct'. This can be done in application/config/config.php.
````
'components' => array(
......@@ -30,12 +30,12 @@ To allow plugin to be called via RPC POST routine, you need to disable CsrfValid
),
````
### With LimeSurvey 2.50 after build 160330
### With LimeSurvey 2.50 after build 160330 or 2.06_sp_1.0.9
The plugin can be used with newUnsecureRequest event
## Home page & Copyright
- HomePage <http://extensions.sondages.pro/>
- Copyright © 2015 Denis Chenu <http://sondages.pro>
- Copyright © 2015-2016 Denis Chenu <http://sondages.pro>
- Licence : GNU General Public License <https://www.gnu.org/licenses/gpl-3.0.html>
## Support
......
<?php
class RemoteControlHandler extends remotecontrol_handle
/**
* Handler for extendRemoteControl Plugin for LimeSurvey : add yours functions here
*
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2015-2016 Denis Chenu <http://sondages.pro>
* @license GPL v3
* @version 1.0
*
* 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 RemoteControlHandler extends remotecontrol_handle
{
/**
* RPC Routine to get information on user
* RPC Routine to get information on user from extendRemoteControl plugin
*
* @access public
* @param string $sSessionKey Auth credentials
......
<?php
/**
* Demo plugin to show how to extendRemoteControl Plugin for LimeSurvey :
* Demo plugin to show how to extendRemoteControl Plugin for LimeSurvey.
*
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2015 Denis Chenu <http://sondages.pro>
* @copyright 2015-2016 Denis Chenu <http://sondages.pro>
* @license GPL v3
* @version 1.0
*
......@@ -37,6 +37,10 @@ class extendRemoteControl extends \ls\pluginmanager\PluginBase {
$this->subscribe('newUnsecureRequest','newDirectRequest');
}
/**
* The access is done here for remoteControl access with plugin
* @see remotecontrol::run()
*/
public function newDirectRequest()
{
$oEvent = $this->getEvent();
......@@ -48,7 +52,6 @@ class extendRemoteControl extends \ls\pluginmanager\PluginBase {
Yii::import('application.helpers.remotecontrol.*');
Yii::setPathOfAlias('extendRemoteControl', dirname(__FILE__));
Yii::import("extendRemoteControl.RemoteControlHandler");
//Yii::import("extendRemoteControl.extendRemoteControlHttpRequest");
$oHandler=new \RemoteControlHandler($oAdminController);
$RPCType=Yii::app()->getConfig("RPCInterface");
if($RPCType!='json')
......@@ -92,12 +95,16 @@ class extendRemoteControl extends \ls\pluginmanager\PluginBase {
$content=$oAdminController->renderPartial('application.views.admin.remotecontrol.index_view',$aData,true);
$oEvent->setContent($this, $content);
}
else // Show something ....
else // Show something for 2.5, but 2.5 have a better system
{
return $oAdminController->render('application.views.admin.remotecontrol.index_view',$aData);
}
}
}
/**
* Update the information content to show the good link
* @params getValues
*/
public function getPluginSettings($getValues=true)
{
$this->settings['information']['content']="";
......@@ -131,7 +138,9 @@ class extendRemoteControl extends \ls\pluginmanager\PluginBase {
}
/**
* Show remote control function list in 2.50
* Used by PluginHelper->getContent
* @see remotecontrol::run()
*/
public function actionIndex()
{
......@@ -147,7 +156,7 @@ class extendRemoteControl extends \ls\pluginmanager\PluginBase {
/* @var $method ReflectionMethod */
if (substr($method->getName(),0,1) !== '_') {
$list[$method->getName()] = array(
'description' => str_replace(array("\r", "\r\n", "\n"), "<br/>", $method->getDocComment()),
'description' => "<pre>".$method->getDocComment()."</pre>",
'parameters' => $method->getParameters()
);
}
......
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 to comment