NEW Can switch status of website and page from the website toolbar

This commit is contained in:
Laurent Destailleur 2022-10-09 20:52:50 +02:00
parent fa651f7566
commit 2053ad8f49
4 changed files with 137 additions and 89 deletions

View File

@ -4345,7 +4345,7 @@ abstract class CommonObject
} }
/** /**
* Set status of an object * Set status of an object.
* *
* @param int $status Status to set * @param int $status Status to set
* @param int $elementId Id of element to force (use this->id by default if null) * @param int $elementId Id of element to force (use this->id by default if null)

View File

@ -644,36 +644,41 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
* This is called when MAIN_DIRECT_STATUS_UPDATE is set and it use tha ajax service objectonoff.php * This is called when MAIN_DIRECT_STATUS_UPDATE is set and it use tha ajax service objectonoff.php
* *
* @param Object $object Object to set * @param Object $object Object to set
* @param string $code Name of constant : status or status_buy for product by example * @param string $code Name of property in object : 'status' or 'status_buy' for product by example
* @param string $field Name of database field : 'tosell' or 'tobuy' for product by example * @param string $field Name of database field : 'tosell' or 'tobuy' for product by example
* @param string $text_on Text if on * @param string $text_on Text if on
* @param string $text_off Text if off * @param string $text_off Text if off
* @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid'))
* @param string $morecss More CSS * @param string $morecss More CSS
* @param string $htmlname Name of HTML component. Keep '' or use a different value if you need to use this component several time on same page for same property.
* @return string html for button on/off * @return string html for button on/off
*/ */
function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '') function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input = array(), $morecss = '', $htmlname = '')
{ {
global $langs; global $langs;
if (empty($htmlname)) {
$htmlname = $code;
}
$out = '<script> $out = '<script>
$(function() { $(function() {
var input = '.json_encode($input).'; var input = '.json_encode($input).';
// Set constant // Set constant
$("#set_'.$code.'_'.$object->id.'").click(function() { $("#set_'.$htmlname.'_'.$object->id.'").click(function() {
console.log("Click managed by ajax_object_onoff"); console.log("Click managed by ajax_object_onoff");
$.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", { $.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", {
action: \'set\', action: \'set\',
field: \''.$field.'\', field: \''.dol_escape_js($field).'\',
value: \'1\', value: \'1\',
element: \''.$object->element.'\', element: \''.dol_escape_js($object->element).'\',
id: \''.$object->id.'\', id: \''.$object->id.'\',
token: \''.currentToken().'\' token: \''.currentToken().'\'
}, },
function() { function() {
$("#set_'.$code.'_'.$object->id.'").hide(); $("#set_'.$htmlname.'_'.$object->id.'").hide();
$("#del_'.$code.'_'.$object->id.'").show(); $("#del_'.$htmlname.'_'.$object->id.'").show();
// Enable another element // Enable another element
if (input.disabled && input.disabled.length > 0) { if (input.disabled && input.disabled.length > 0) {
$.each(input.disabled, function(key,value) { $.each(input.disabled, function(key,value) {
@ -693,19 +698,19 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input =
}); });
// Del constant // Del constant
$("#del_'.$code.'_'.$object->id.'").click(function() { $("#del_'.$htmlname.'_'.$object->id.'").click(function() {
console.log("Click managed by ajax_object_onoff"); console.log("Click managed by ajax_object_onoff");
$.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", { $.get( "'.DOL_URL_ROOT.'/core/ajax/objectonoff.php", {
action: \'set\', action: \'set\',
field: \''.$field.'\', field: \''.dol_escape_js($field).'\',
value: \'0\', value: \'0\',
element: \''.$object->element.'\', element: \''.dol_escape_js($object->element).'\',
id: \''.$object->id.'\', id: \''.$object->id.'\',
token: \''.currentToken().'\' token: \''.currentToken().'\'
}, },
function() { function() {
$("#del_'.$code.'_'.$object->id.'").hide(); $("#del_'.$htmlname.'_'.$object->id.'").hide();
$("#set_'.$code.'_'.$object->id.'").show(); $("#set_'.$htmlname.'_'.$object->id.'").show();
// Disable another element // Disable another element
if (input.disabled && input.disabled.length > 0) { if (input.disabled && input.disabled.length > 0) {
$.each(input.disabled, function(key,value) { $.each(input.disabled, function(key,value) {
@ -725,8 +730,8 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input =
}); });
}); });
</script>'; </script>';
$out .= '<span id="set_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? 'hideobject' : '').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_off), 'switch_off').'</span>'; $out .= '<span id="set_'.$htmlname.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? 'hideobject' : '').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_off), 'switch_off').'</span>';
$out .= '<span id="del_'.$code.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? '' : 'hideobject').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_on), 'switch_on').'</span>'; $out .= '<span id="del_'.$htmlname.'_'.$object->id.'" class="linkobject '.($object->$code == 1 ? '' : 'hideobject').($morecss ? ' '.$morecss : '').'">'.img_picto($langs->trans($text_on), 'switch_on').'</span>';
return $out; return $out;
} }

View File

@ -152,3 +152,4 @@ NextContainer=Next page/container
PreviousContainer=Previous page/container PreviousContainer=Previous page/container
WebsiteMustBeDisabled=The website must have the status "%s" WebsiteMustBeDisabled=The website must have the status "%s"
WebpageMustBeDisabled=The web page must have the status "%s" WebpageMustBeDisabled=The web page must have the status "%s"
SetWebsiteOnlineBefore=When website is offline, all pages are offline. Change status of website first.

View File

@ -420,6 +420,18 @@ if ($action == 'renamefile') { // Must be after include DOL_DOCUMENT_ROOT.'/core
$action = 'file_manager'; $action = 'file_manager';
} }
if ($action == 'setwebsiteonline') {
$website->setStatut($website::STATUS_VALIDATED, null, '', 'WEBSITE_MODIFY', 'status');
header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int'));
exit;
}
if ($action == 'setwebsiteoffline') {
$result = $website->setStatut($website::STATUS_DRAFT, null, '', 'WEBSITE_MODIFY', 'status');
header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int'));
exit;
}
if ($action == 'seteditinline') { if ($action == 'seteditinline') {
dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1); dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1);
setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings'); setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings');
@ -478,7 +490,6 @@ if ($action == 'deletetemplate') {
} }
} }
// Set category // Set category
if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) { if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
$error = 0; $error = 0;
@ -517,7 +528,8 @@ if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $us
// Now we reload list // Now we reload list
$listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters, -1); $listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters, -1);
} }
// Set category
// Del category
if ($massaction == 'delcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) { if ($massaction == 'delcategory' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
$error = 0; $error = 0;
$nbupdate = 0; $nbupdate = 0;
@ -2750,6 +2762,11 @@ if (!GETPOST('hide_websitemenu')) {
} }
$atleastonepage = (is_array($array) && count($array) > 0); $atleastonepage = (is_array($array) && count($array) > 0);
$websitepage = new WebSitePage($db);
if ($pageid > 0 && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone')) {
$websitepage->fetch($pageid);
}
//var_dump($objectpage);exit; //var_dump($objectpage);exit;
print '<div class="centpercent websitebar'.(GETPOST('dol_openinpopup', 'aZ09') ? ' hidden' : '').'">'; print '<div class="centpercent websitebar'.(GETPOST('dol_openinpopup', 'aZ09') ? ' hidden' : '').'">';
@ -2764,15 +2781,14 @@ if (!GETPOST('hide_websitemenu')) {
print $langs->trans("Website").': '; print $langs->trans("Website").': ';
print '</div>'; print '</div>';
// Button Add new website
$urltocreatenewwebsite = $_SERVER["PHP_SELF"].'?action=createsite'; $urltocreatenewwebsite = $_SERVER["PHP_SELF"].'?action=createsite';
//if (empty($conf->use_javascript_ajax)) {
print '<span class="websiteselection paddingrightonly">'; print '<span class="websiteselection paddingrightonly">';
print '<a href="'.$urltocreatenewwebsite.'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddWebsite")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"><span></a>'; print '<a href="'.$urltocreatenewwebsite.'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddWebsite")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"><span></a>';
print '</span>'; print '</span>';
//}
// List of website // List of website
print '<span class="websiteselection">'; print '<span class="websiteselection nopaddingrightimp">';
$out = ''; $out = '';
$out .= '<select name="website" class="minwidth100 width200 maxwidth150onsmartphone" id="website">'; $out .= '<select name="website" class="minwidth100 width200 maxwidth150onsmartphone" id="website">';
@ -2780,12 +2796,6 @@ if (!GETPOST('hide_websitemenu')) {
$out .= '<option value="-1">&nbsp;</option>'; $out .= '<option value="-1">&nbsp;</option>';
} }
/*
if (!empty($conf->use_javascript_ajax)) {
$valueoption = '<span class="classlink">'.img_picto('', 'add', 'class="paddingrightonly"').$langs->trans("AddWebsite").'</span>';
$out .= '<option value="-2" data-html="'.dol_escape_htmltag($valueoption).'">'.$valueoption.'</option>';
}*/
// Loop on each sites // Loop on each sites
$i = 0; $i = 0;
foreach ($object->records as $key => $valwebsite) { foreach ($object->records as $key => $valwebsite) {
@ -2826,20 +2836,40 @@ if (!GETPOST('hide_websitemenu')) {
} }
print $out; print $out;
if (empty($conf->use_javascript_ajax)) { print '</span>';
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshsite" value="'.$langs->trans("Load").'">';
// Switch offline/onine
if (!empty($conf->use_javascript_ajax)) {
print '<span class="websiteselection">';
// Do not use ajax, we need a refresh of full page when we change status of a website
//print '<div class="inline-block marginrightonly">';
//print ajax_object_onoff($object, 'status', 'status', 'Online', 'Offline', array(), 'valignmiddle', 'statuswebsite');
//print '</div>';
if ($website->status == $website::STATUS_DRAFT) {
$text_off = 'Offline';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setwebsiteonline&token='.newToken().'&website='.urlencode($website->ref).'&websitepage='.((int) $websitepage->id).'">'.img_picto($langs->trans($text_off), 'switch_off').'</a>';
} else {
$text_off = 'Online';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setwebsiteoffline&token='.newToken().'&website='.urlencode($website->ref).'&websitepage='.((int) $websitepage->id).'">'.img_picto($langs->trans($text_off), 'switch_on').'</a>';
}
print '</span>';
} }
// Refresh / Reload web site (for non javascript browers)
if (empty($conf->use_javascript_ajax)) {
print '<span class="websiteselection">';
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshsite" value="'.$langs->trans("Load").'">';
print '</span>'; print '</span>';
}
print '<span class="websiteselection">'; print '<span class="websiteselection">';
if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) { if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) {
print ' &nbsp; '; // Edit website properties
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.urlencode($object->ref).'&pageid='.((int) $pageid).'&action=editcss&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditCss")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditCss")).'</span></a>';
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">';
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editcss&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditCss")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditCss")).'</span></a>';
// Import web site
$importlabel = $langs->trans("ImportSite"); $importlabel = $langs->trans("ImportSite");
$exportlabel = $langs->trans("ExportSite"); $exportlabel = $langs->trans("ExportSite");
if (!empty($conf->dol_optimize_smallscreen)) { if (!empty($conf->dol_optimize_smallscreen)) {
@ -2853,9 +2883,10 @@ if (!GETPOST('hide_websitemenu')) {
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($importlabel).'" name="importsite">'; print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
} }
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">'; // Export web site
print '<input type="submit" class="button bordertransp"'.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">'; print '<input type="submit" class="button bordertransp"'.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
// Clone web site
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">'; print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
// Delete website // Delete website
@ -2988,19 +3019,17 @@ if (!GETPOST('hide_websitemenu')) {
print $langs->trans("PageContainer").': '; print $langs->trans("PageContainer").': ';
print '</div>'; print '</div>';
// Button Add new web page
print '<span class="websiteselection paddingrightonly">'; print '<span class="websiteselection paddingrightonly">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref).'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"></span></a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref).'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"></span></a>';
print '</span>'; print '</span>';
//print '<span class="websiteselection">';
//if ($action != 'addcontainer') {
$out = ''; $out = '';
$s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'minwidth100 maxwidth200onsmartphone'); $s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'minwidth100 maxwidth200onsmartphone');
if ($formwebsite->num >= 0) { $out .= '<span class="websiteselection nopaddingrightimp">';
$out .= '<span class="websiteselection">';
$out .= $s; $out .= $s;
$out .= '</span>'; $out .= '</span>';
@ -3020,14 +3049,27 @@ if (!GETPOST('hide_websitemenu')) {
$out .= '});'; $out .= '});';
$out .= '</script>'; $out .= '</script>';
} }
}
print $out; print $out;
/*} else {
print $langs->trans("New");
}*/
if (!empty($conf->use_javascript_ajax)) {
print '<span class="websiteselection">';
//print '<div class="inline-block marginrightonly">';
if ($object->status == $object::STATUS_DRAFT) { // website is off, we do not allow to change status of page
$text_off = 'SetWebsiteOnlineBefore';
if ($objectpage->status == $objectpage::STATUS_DRAFT) {
print '<span class="valignmiddle disabled opacitymedium">'.img_picto($langs->trans($text_off), 'switch_off').'</span>';
} else {
print '<span class="valignmiddle disabled opacitymedium">'.img_picto($langs->trans($text_off), 'switch_on').'</span>';
}
} else {
print ajax_object_onoff($objectpage, 'status', 'status', 'Online', 'Offline', array(), 'valignmiddle', 'statuswebsitepage');
}
//print '</div>';
print '</span>';
}
print '<span class="websiteselection">'; print '<span class="websiteselection">';
print '<input type="image" class="valignmiddle buttonwebsite" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshpage" value="'.$langs->trans("Load").'"'.(($action != 'editsource') ? '' : ' disabled="disabled"').'>'; print '<input type="image" class="valignmiddle buttonwebsite" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshpage" value="'.$langs->trans("Load").'"'.(($action != 'editsource') ? '' : ' disabled="disabled"').'>';
@ -3059,23 +3101,18 @@ if (!GETPOST('hide_websitemenu')) {
} }
if ($pagepreviousid) { if ($pagepreviousid) {
print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?website='.urlencode($object->ref).'&pageid='.$pagepreviousid.'&action='.$action.'&token='.newToken().'">'.img_previous($langs->trans("PreviousContainer")).'</a>'; print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?website='.urlencode($object->ref).'&pageid='.((int) $pagepreviousid).'&action='.urlencode($action).'&token='.newToken().'">'.img_previous($langs->trans("PreviousContainer")).'</a>';
} else { } else {
print '<span class="valignmiddle opacitymedium">'.img_previous($langs->trans("PreviousContainer")).'</span>'; print '<span class="valignmiddle opacitymedium">'.img_previous($langs->trans("PreviousContainer")).'</span>';
} }
if ($pagenextid) { if ($pagenextid) {
print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?website='.urlencode($object->ref).'&pageid='.$pagenextid.'&action='.$action.'&token='.newToken().'">'.img_next($langs->trans("NextContainer")).'</a>'; print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?website='.urlencode($object->ref).'&pageid='.((int) $pagenextid).'&action='.urlencode($action).'&token='.newToken().'">'.img_next($langs->trans("NextContainer")).'</a>';
} else { } else {
print '<span class="valignmiddle opacitymedium">'.img_next($langs->trans("NextContainer")).'</span>'; print '<span class="valignmiddle opacitymedium">'.img_next($langs->trans("NextContainer")).'</span>';
} }
print '</span>'; print '</span>';
$websitepage = new WebSitePage($db);
if ($pageid > 0 && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone')) {
$websitepage->fetch($pageid);
}
if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite') { if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite') {
$disabled = ''; $disabled = '';
if (empty($user->rights->website->write)) { if (empty($user->rights->website->write)) {
@ -3153,15 +3190,15 @@ if (!GETPOST('hide_websitemenu')) {
print '<span class="websiteselection">'; print '<span class="websiteselection">';
print ' &nbsp; '; // Edit web page properties
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">';
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editmeta&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</span></a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editmeta&token='.newToken().'" class="button bordertransp" title="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'"'.$disabled.'><span class="fa fa-cog paddingrightonly"></span><span class="hideonsmartphone">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</span></a>';
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditHTMLSource")).'" name="editsource">'; // Edit HTML content
print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editsource&token='.newToken().'" class="button bordertransp"'.$disabled.'>'.dol_escape_htmltag($langs->trans($conf->dol_optimize_smallscreen ? "HTML" : "EditHTMLSource")).'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$pageid.'&action=editsource&token='.newToken().'" class="button bordertransp"'.$disabled.'>'.dol_escape_htmltag($langs->trans($conf->dol_optimize_smallscreen ? "HTML" : "EditHTMLSource")).'</a>';
print '</span>'; print '</span>';
// Switch include dynamic content / edit inline
print '<!-- button EditInLine and ShowSubcontainers -->'."\n"; print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
print '<div class="websiteselectionsection inline-block">'; print '<div class="websiteselectionsection inline-block">';
@ -3522,13 +3559,16 @@ if ($action == 'editcss') {
print '</td></tr>'; print '</td></tr>';
// Status of web site // Status of web site
print '<!-- Status of website -->'."\n"; if ($action != 'createcontainer') {
if (empty($conf->use_javascript_ajax)) {
print '<!-- Status of web site page -->'."\n";
print '<tr><td class="fieldrequired">'; print '<tr><td class="fieldrequired">';
print $langs->trans('Status'); print $langs->trans('Status');
print '</td><td>'; print '</td><td>';
print ajax_object_onoff($object, 'status', 'status', 'Enabled', 'Disabled'); print $form->selectyesno('status', $object->status);
//print dol_print_date($pagedatecreation, 'dayhour');
print '</td></tr>'; print '</td></tr>';
}
}
// Main language // Main language
print '<tr><td class="tdtop fieldrequired">'; print '<tr><td class="tdtop fieldrequired">';
@ -3954,14 +3994,15 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
} }
if ($action != 'createcontainer') { if ($action != 'createcontainer') {
print '<!-- Status of page -->'."\n"; if (empty($conf->use_javascript_ajax)) {
print '<!-- Status of web site page -->'."\n";
print '<tr><td class="fieldrequired">'; print '<tr><td class="fieldrequired">';
print $langs->trans('Status'); print $langs->trans('Status');
print '</td><td>'; print '</td><td>';
print ajax_object_onoff($objectpage, 'status', 'status', 'Enabled', 'Disabled'); print $form->selectyesno('status', $objectpage->status);
//print dol_print_date($pagedatecreation, 'dayhour');
print '</td></tr>'; print '</td></tr>';
} }
}
// Type of container // Type of container
print '<tr><td class="titlefield fieldrequired">'; print '<tr><td class="titlefield fieldrequired">';
@ -3971,6 +4012,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
$formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1); $formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1);
print '</td></tr>'; print '</td></tr>';
// Example/templates of page
if ($action == 'createcontainer') { if ($action == 'createcontainer') {
print '<tr><td class="titlefield fieldrequired">'; print '<tr><td class="titlefield fieldrequired">';
print $langs->trans('WEBSITE_PAGE_EXAMPLE'); print $langs->trans('WEBSITE_PAGE_EXAMPLE');