Welcome, Guest
Username: Password: Remember me

TOPIC: Hide the "Export to PDF" button

Hide the "Export to PDF" button 1 year 3 weeks ago #109741

  • chrisvor
  • chrisvor's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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: 1 year 3 weeks ago by chrisvor.
The administrator has disabled public write access.

Hide the "Export to PDF" button 1 year 3 weeks ago #109759

  • chrisvor
  • chrisvor's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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 administrator has disabled public write access.

Hide the "Export to PDF" button 1 year 3 weeks ago #109773

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 7303
  • Thank you received: 1004
  • Karma: 290
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
The administrator has disabled public write access.

Hide the "Export to PDF" button 1 year 3 weeks ago #109779

  • chrisvor
  • chrisvor's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
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 administrator has disabled public write access.

Hide the "Export to PDF" button 6 months 1 week ago #115839

  • eleren
  • eleren's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
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 administrator has disabled public write access.

Hide the "Export to PDF" button 6 months 6 days ago #115857

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5684
  • Thank you received: 329
  • Karma: 255
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
The following user(s) said Thank You: eleren
Moderators: ITEd
Time to create page: 0.310 seconds