Hide the "Export to PDF" button

More
3 years 4 months ago - 3 years 4 months ago #109741 by chrisvor
chrisvor created the topic: Hide the "Export to PDF" button
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: 3 years 4 months ago by chrisvor.

Please Log in to join the conversation.

More
3 years 4 months ago #109759 by chrisvor
chrisvor replied the 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 :)

Please Log in to join the conversation.

More
3 years 4 months ago #109773 by DenisChenu
DenisChenu replied the 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 4 months ago #109779 by chrisvor
chrisvor replied the 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

Please Log in to join the conversation.

More
2 years 10 months ago #115839 by eleren
eleren replied the 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?

Please Log in to join the conversation.

More
2 years 10 months ago #115857 by Mazi
Mazi replied the 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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The following user(s) said Thank You: eleren

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now