39 print
"Error, template page can't be called as URL";
43if (empty($htmlname)) {
44 print
'Parameter htmlname not defined.';
49<!-- BEGIN PHP TEMPLATE formlayoutai.tpl.php -->
53@phan-var-force ?FormWebSite $formwebsite
54@phan-var-force ?FormMail $formmail
55@phan-var-force string $showlinktolayout
56@phan-var-force string $showlinktolayoutlabel
63if ($showlinktolayout) {
64 $out .=
'<a href="#" id="linkforlayouttemplates" class="notasortlink inline-block alink marginrightonly">';
65 $out .=
img_picto($showlinktolayoutlabel,
'layout',
'class="paddingrightonly"');
66 $out .= $showlinktolayoutlabel.
'...';
67 $out .=
'</a> ';
70 $(document).ready(function() {
71 $("#linkforlayouttemplates").click(function() {
72 console.log("We click on linkforlayouttemplates");
73 event.preventDefault();
74 jQuery("#template-selector").toggle();
75 jQuery("#ai_input'.$htmlname.
'").hide();
76 jQuery("#pageContent").show(); // May exists for website page only
84 $out .=
'<a href="#" id="linkforaiprompt'.$showlinktoai.
'" class="notasortlink inline-block alink marginrightonly">';
85 $out .=
img_picto($showlinktoailabel,
'ai',
'class="paddingrightonly"');
86 $out .= $showlinktoailabel.
'...';
90 $(document).ready(function() {
91 $("#linkforaiprompt'.$showlinktoai.
'").click(function() {
92 console.log("formlayoutai.tpl: We click on linkforaiprompt'.$showlinktoai.
', we toggle #ai_input'.$showlinktoai.
'");
93 event.preventDefault();
94 jQuery("#ai_input'.$htmlname.
'").toggle();
95 jQuery("#template-selector").hide();
96 jQuery(".email-layout-container").hide();
97 if (!jQuery("#ai_input'.$htmlname.
'").is(":hidden")) {
98 console.log("Set focus on input field #ai_instructions'.$htmlname.
'");
99 jQuery("#ai_instructions'.$htmlname.
'").focus();
100 if (!jQuery("pageContent").is(":hidden")) { // May exists for website page only
101 jQuery("#pageContent").show();
109if ($showlinktolayout) {
110 if (!empty($formwebsite) && is_object($formwebsite)) {
111 $out .= $formwebsite->getContentPageTemplate($htmlname);
113 $out .= $formmail->getModelEmailTemplate($htmlname, $showlinktolayout);
116 $out .=
'<!-- No link to the layout feature, $formmail->withlayout must be set to a string use case, module WYSIWYG must be enabled and MAIN_EMAIL_USE_LAYOUT must be set -->';
119 $out .= $formmail->getSectionForAIPrompt($showlinktoai, $formmail->withaiprompt, $htmlname);
121 $out .=
'<!-- No link to the AI feature, $formmail->withaiprompt must be set to the ai feature and module ai must be enabled -->';
125<!-- END PHP TEMPLATE commonfields_edit.tpl.php -->
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...