30if (empty($conf) || !is_object($conf)) {
31 print
"Error, template page can't be called as URL";
35if (empty($htmlname)) {
36 print
'Parameter htmlname not defined.';
41<!-- BEGIN PHP TEMPLATE formlayoutai.tpl.php -->
45@phan-var-force ?FormWebSite $formwebsite
46@phan-var-force ?FormMail $formmail
47@phan-var-force string $showlinktolayout
48@phan-var-force string $showlinktolayoutlabel
55if ($showlinktolayout) {
56 $out .=
'<a href="#" id="linkforlayouttemplates" class="notasortlink inline-block alink marginrightonly">';
57 $out .=
img_picto($showlinktolayoutlabel,
'layout',
'class="paddingrightonly"');
58 $out .= $showlinktolayoutlabel.
'...';
59 $out .=
'</a> ';
62 $(document).ready(function() {
63 $("#linkforlayouttemplates").click(function() {
64 console.log("We click on linkforlayouttemplates");
65 event.preventDefault();
66 jQuery("#template-selector").toggle();
67 jQuery("#ai_input'.$htmlname.
'").hide();
68 jQuery("#pageContent").show(); // May exists for website page only
76 $out .=
'<a href="#" id="linkforaiprompt'.$showlinktoai.
'" class="notasortlink inline-block alink marginrightonly">';
77 $out .=
img_picto($showlinktoailabel,
'ai',
'class="paddingrightonly"');
78 $out .= $showlinktoailabel.
'...';
82 $(document).ready(function() {
83 $("#linkforaiprompt'.$showlinktoai.
'").click(function() {
84 console.log("formlayoutai.tpl: We click on linkforaiprompt'.$showlinktoai.
', we toggle #ai_input'.$showlinktoai.
'");
85 event.preventDefault();
86 jQuery("#ai_input'.$htmlname.
'").toggle();
87 jQuery("#template-selector").hide();
88 jQuery(".email-layout-container").hide();
89 if (!jQuery("#ai_input'.$htmlname.
'").is(":hidden")) {
90 console.log("Set focus on input field #ai_instructions'.$htmlname.
'");
91 jQuery("#ai_instructions'.$htmlname.
'").focus();
92 if (!jQuery("pageContent").is(":hidden")) { // May exists for website page only
93 jQuery("#pageContent").show();
101if ($showlinktolayout) {
102 if (!empty($formwebsite) && is_object($formwebsite)) {
103 $out .= $formwebsite->getContentPageTemplate($htmlname);
105 $out .= $formmail->getModelEmailTemplate($htmlname, $showlinktolayout);
108 $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 -->';
111 $out .= $formmail->getSectionForAIPrompt($showlinktoai, $formmail->withaiprompt, $htmlname);
113 $out .=
'<!-- No link to the AI feature, $formmail->withaiprompt must be set to the ai feature and module ai must be enabled -->';
117<!-- 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)