[résolu] modifier taille fenêtre d'impression ou comment modifier le fichier class/flexicontent.helper.php ?

More
8 years 11 months ago - 8 years 11 months ago #58832 by AlainR
Bonjour.
Mon client souhaite redimensionner la fenêtre d'impression d'un item et je vois que le code se trouve dans le fichier composants/com_flexicontent/class/flexicontent.helper.php
Quel(s) moyen(s) existe-t-il de surpasser (override) ce fichier ? ou du moins cette partie de code (ligne 1456 dans la version 3.0.8 de FLEXIcontent) ?

Sur les écrans très large, il est déroutant d'avoir une fenêtre d'impression qui prend presque toute la largeur....alors que le résultat va être imprimé sur 20 et quelques centimètres de large.
D'ailleurs le code existe pour la boîte d'envoi de l'item par e-mail :
Code:
width=\'+((screen.width-100) > 800 ? 800 : (screen.width-100))+\',

Bien sûr je pourrais modifier directement ce fichier, mais ce sera perdu lors de la prochaine mise à jour.
Ce n'est qu'à moitié un problème, le vrai problème, c'est la question des droits : sur cet hébergeur, si je modifie le propriétaire du fichier, il m'est impossible de revenir en arrière, donc ensuite de mettre à jour le composant.

Voilà, tout est dit.
D'avance merci pour l'aide.
Cdt.
Last edit: 8 years 11 months ago by AlainR. Reason: [résolu]

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago - 8 years 11 months ago #58835 by ggppdk
Hello

i see, but use window width is just a hack,
- not best approach for this
(but we can limit browser window according to some logic (configured paper size + 150 pixels) )

So we should add specific CSS
- CSS2+ supports this

i will open an issue to add parameter new parameter
- i think to call it:
Paper size of print preview: OPTIONs: A4, A3, etc ...
(with inline description: This limits print popup to look like the configure size, it does not force / control user selection of paper size, also this will limit the width of the popup window)

so what you can do now: (until we add support)
- do not hack the file
- instead, edit (add at the top):
component/com_flexicontent/templates/item.php

for A4 paper (it will shape output to A4 width and add some margins and also will resize window too):
Code:
if ( JRequest::getInt('pop') ) { JFactory::getDocument()->addStyleDeclaration(" body { width: 8.27in; margin: .5in .5in .5in .5in; } @page { size:8.27in 11.69in; margin:.5in .5in .5in .5in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0; } } "); JFactory::getDocument()->addScriptDeclaration(" window.resizeTo( ((screen.width-100) > 1000 ? 1000 : (screen.width-100)), ((screen.height-100) > 1000 ? 1000 : (screen.height-100)) ); "); }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 8 years 11 months ago by ggppdk.
The following user(s) said Thank You: AlainR

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago - 8 years 11 months ago #58838 by AlainR
Hello!

ggppdk wrote: i see, but use window width is just a hack,
- not best approach for this
(but we can limit browser window according to some logic (configured paper size + 150 pixels) )


Oui, je m'en rends bien compte et je suis aussi de cet avis.
Comme la demande est persistante, que j'ai trouvé le code mais n'ai pas su le modifier, je venais voir ici le possible.

ggppdk wrote: So we should add specific CSS
- CSS2+ supports this

i will open an issue to add parameter new parameter
- i think to call it:
Paper size of print preview: OPTIONs: A4, A3, etc ...
(with inline description: This limits print popup to look like the configure size, it does not force / control user selection of paper size, also this will limit the width of the popup window)


Est-ce vraiment nécessaire?
le hack proposé fonctionne excellemment!
Bravo et merci!!!
Last edit: 8 years 11 months ago by AlainR.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.333 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline