This is a question for any one of the devs (probably Opengeek), why are two <input> tags used for managing the published state? For instance, this is the code I pulled from my content editor:
<td><input name="publishedcheck" type="checkbox" class="checkbox" checked onclick="changestate(document.mutate.published);" /><input type="hidden" name="published" value="1" />
It appears that the checkbox is modifying a hidden <input> tag which contains the actual published state. Why not just use this:
<input type="checkbox" class="checkbox" name="published" value="1"/>
Then in [tt]save_content.processor.php[/tt], check [tt]isset($_POST[’published’])[/tt]? The reason for the change would be to simplify the markup and remove some unnecessary javascript.
Also, to remedy the issue brought up in this thread, we would use javascript to remove the pub_date if the published field changes:
<script type="text/javascript">
function check_pub_date(el) {
value = el.checked;
if (value == '') {
if (confirm("Warning: Unchecking Published will remove the Publish Date! Do you want to unpublish this document?") == true) {
document.mutate.pub_date.value = '';
}
}
}
</script>
As I’ve stated before, I am no JScripter, so this code is untested, but I hope it gives you all an idea of what a solution would be.