Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Hide the "Export to PDF" button

  • chrisvor
  • chrisvor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago - 9 years 9 months ago #109741 by chrisvor
Hide the "Export to PDF" button was created by chrisvor
Hello,
I need to HIDE the button after the submission of a survey that says "Export to PDF", as the final output is at this moment very ugly and I dont want to have the button to create it.

I tried the 'usepdfexport'=>0 in the config.php and also the $config [ 'usepdfexport' ] =0 (or ='0') in config-default.php, but the survey continues to show this button.

Any idea how I can completely remove it?

Thanks
Chris
Last edit: 9 years 9 months ago by chrisvor.
The topic has been locked.
  • chrisvor
  • chrisvor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #109759 by chrisvor
Replied by chrisvor on topic Hide the "Export to PDF" button
Answering my own question just in case somebody else needs to do the same:

Using version 2.05+
in application\controllers\PrintanswersController.php, line 103 change this:

$sOutput = CHtml::form(array("printanswers/view/surveyid/{$iSurveyID}/printableexport/pdf"), 'post')
."<center><input type='submit' value='".$clang->gT("PDF export")."'id=\"exportbutton\"/><input type='hidden' name='printableexport' /></center></form>";

to this:

if (app()->getConfig("usepdfexport") == 0) {
$sOutput = "";
} else {
$sOutput = CHtml::form(array("printanswers/view/surveyid/{$iSurveyID}/printableexport/pdf"), 'post')
."<center><input type='submit' value='".$clang->gT("PDF export")."'id=\"exportbutton\"/><input type='hidden' name='printableexport' /></center></form>";
};

I hope this helps someone :)
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 9 months ago #109773 by DenisChenu
Replied by DenisChenu on topic Hide the "Export to PDF" button
Hi,

If you set 'usepdfexport'=>0 in the confir.php file (at same place than 'debug'=>0) without your patch: do you have the button ?

If yes : what's is your LS version ?
If it the last :please make a patch for LimeSurvey core in github.com/LimeSurvey/LimeSurvey/pulls

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • chrisvor
  • chrisvor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 9 months ago #109779 by chrisvor
Replied by chrisvor on topic Hide the "Export to PDF" button
Hi,
I'm using the latest version according to auto-update (Version 2.05+ Build 140520).

I searched the complete source for the "usepdfexport" keyword, and it does not appear anywhere. So apparently nothing is checking whether the setting is on or off, so having it in the config does not change anything.

As per your request, I created a patch and created a pull request to merge the change to the core.

Thanks :)
Chris
The topic has been locked.
More
9 years 2 months ago #115839 by eleren
Replied by eleren on topic Hide the "Export to PDF" button
I would like to hide/remove the "export to pdf" button too, since the result is very ugly.
I understand the 'usepdfexport'setting is obsolete in version 2.05. So what else can I do to hide the button, or to style the content?
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 2 months ago #115857 by Mazi
Replied by Mazi on topic Hide the "Export to PDF" button
Open the template you are using at the Limesurvey template editor and view the "template.css" file.
At the end of that file add:

#exportbutton
{
display: none;
}

Afterwards clear your cache and the button should be gone.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: eleren
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose