Discussion:
[limesurvey-developers] plugins
mari carmen soria ortiz
2014-11-06 13:18:50 UTC
Permalink
hi
I'm new and it's the first time limesurvey development.
I have many doubts. I created a plugin that generates me a new menu option.
Now I want you to show me just clicking a new list of special users. My
question is where I have to send this plugin, do everything in the plugin
or send a -> 'href' => app () -> createUrl ("admin / user2 / sa / index"),
which would be a new folder user2 created by me.

Not sure the operation is ready for developers, if I'm sending the email
where I must not please excuse

Thank you
Denis Chenu
2014-11-06 14:58:16 UTC
Permalink
Hi,

You're on IRC actually , no ?

I think better is to use plugin, then : put your PHP file in plugin, and
use newDirectRequest event.

In this newDirectRequest : you can validate if user is admin or not.
To create the url : you can use:
$this->api->createUrl('plugins/direct', array('plugin' => 'pluginname',
'function' => 'functioname','otherparam'=>'otherparam'));

In your newDirectRequest function, you can use some Yii : for exemple
Permission::model() function.

To dislay an admin page, we don't have Plugin ready system (we have to
work on core display admin page).

But actually i use:

private function displayContent($aData=false)
{
if(!$aData){$aData=array();}
$aData['clang'] = $clang = Yii::app()->lang;
$aData['sImageURL'] = Yii::app()->getConfig('adminimageurl');
$aData['surveyid']=$aData['iSurveyID']=$aData['iSurveyId'] = $this->iSurveyId;
$sViewPath = '/admin/survey';
$oAdminController=new AdminController('admin');
$oCommonAction = new Survey_Common_Action($oAdminController,'survey');
ob_start();
//header("Content-type: text/html; charset=UTF-8"); // needed for correct UTF-8 encoding
$oAdminController->_getAdminHeader();
$oAdminController->_showadminmenu($this->iSurveyId);
if($this->iSurveyId)
$oCommonAction->_surveybar($this->iSurveyId);
echo $this->sContent;
$oAdminController->_loadEndScripts();
$oAdminController->_getAdminFooter('http://manual.limesurvey.org', $clang->gT('LimeSurvey online manual'));
$sOutput = ob_get_contents();
ob_clean();
App()->getClientScript()->render($sOutput);
echo $sOutput;
Yii::app()->end();
}


The real content is in $this->sContent var.

We can surely do better ....
Post by mari carmen soria ortiz
hi
I'm new and it's the first time limesurvey development.
I have many doubts. I created a plugin that generates me a new menu
option. Now I want you to show me just clicking a new list of special
users. My question is where I have to send this plugin, do everything
in the plugin or send a -> 'href' => app () -> createUrl ("admin /
user2 / sa / index"), which would be a new folder user2 created by me.
Not sure the operation is ready for developers, if I'm sending the
email where I must not please excuse
Thank you
------------------------------------------------------------------------------
_______________________________________________
limesurvey-developers mailing list
https://lists.sourceforge.net/lists/listinfo/limesurvey-developers
Loading...