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
53if ($showlinktolayout) {
54 $out .=
'<a href="#" id="linkforlayouttemplates" class="reposition notasortlink inline-block alink marginrightonly">';
55 $out .=
img_picto($showlinktolayoutlabel,
'layout',
'class="paddingrightonly"');
56 $out .= $showlinktolayoutlabel.
'...';
57 $out .=
'</a> ';
60 $(document).ready(function() {
61 $("#linkforlayouttemplates").click(function() {
62 console.log("We click on linkforlayouttemplates");
63 event.preventDefault();
64 jQuery("#template-selector").toggle();
65 jQuery("#ai_input").hide();
66 jQuery("#pageContent").show(); // May exists for website page only
74 $out .=
'<a href="#" id="linkforaiprompt'.$showlinktoai.
'" class="reposition notasortlink inline-block alink marginrightonly">';
75 $out .=
img_picto($showlinktoailabel,
'ai',
'class="paddingrightonly"');
76 $out .= $showlinktoailabel.
'...';
80 $(document).ready(function() {
81 $("#linkforaiprompt'.$showlinktoai.
'").click(function() {
82 console.log("formlayoutai.tpl: We click on linkforaiprompt'.$showlinktoai.
', we toggle #ai_input'.$showlinktoai.
'");
83 event.preventDefault();
84 jQuery("#ai_input'.$htmlname.
'").toggle();
85 jQuery("#template-selector").hide();
86 if (!jQuery("#ai_input'.$htmlname.
'").is(":hidden")) {
87 console.log("Set focus on input field");
88 jQuery("#ai_instructions").focus();
89 if (!jQuery("pageContent").is(":hidden")) { // May exists for website page only
90 jQuery("#pageContent").show();
98if ($showlinktolayout) {
99 if (!empty($formwebsite) && is_object($formwebsite)) {
100 $out .= $formwebsite->getContentPageTemplate($htmlname);
102 $out .= $formmail->getModelEmailTemplate($htmlname);
105 $out .=
'<!-- No link to the layout feature, $formmail->withlayout must be set to 1, module WYSIWYG must be enabled and MAIN_EMAIL_USE_LAYOUT must be set -->';
108 $out .= $formmail->getSectionForAIPrompt($showlinktoai, $formmail->withaiprompt, $htmlname);
110 $out .=
'<!-- No link to the AI feature, $formmail->withaiprompt must be set to the ai feature and module ai must be enabled -->';
114<!-- 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)