function Edit_Page_buttons($text_editable, $too_large_to_edit) { //************* global $_, $ICONS, $ONESCRIPT, $param1, $param2, $MAX_IDLE_TIME, $Editing_OFCMS, $WYSIWYG_VALID, $EDIT_MODE; $disabled = 'disabled'; $reset_onlick = 'Reset_File()'; //Reset_File() is in Edit_Page_scripts(); //If using a WYSIWYG editor, Edit_Page_scripts() aren't loaded. //When so, make sure [Save] & [Reset] are enabled, and [Reset] works. if ($WYSIWYG_VALID && $EDIT_MODE) { $disabled = ''; $reset_onlick = "confirm('" . addslashes($_['confirm_reset']) . "')"; } $reset_button = '<input type="reset" class="button" value="' . hsc($_['reset']) . '" onclick="return ' . $reset_onlick . '" id="reset">'; ?> <div class="edit_btns_bottom"> <?php if ($text_editable && !$too_large_to_edit) { //Show save & reset only if editable file echo Timeout_Timer($MAX_IDLE_TIME, 'timer1', 'timer', 'LOGOUT'); echo '<button type="submit" class="button" onclick="submitted = true;" id="save_file">' . $_['save_1'] . '</button>'; echo $reset_button; ?> <script> document.getElementById("save_file").disabled = "<?php echo $disabled; ?> "; document.getElementById('reset').disabled = "<?php echo $disabled; ?> "; </script><?php } //end if editable //Don't show [Rename] or [Delete] if editing OneFileCMS itself. $Button = '<button type=button class="button RCD" onclick="parent.location=\'' . $ONESCRIPT . $param1 . $param2; if (!$Editing_OFCMS) { echo $Button . '&p=renamefile\'">' . $ICONS['ren_mov'] . ' ' . hsc($_['Ren_Move']) . '</button>'; } /*Always show Copy*/ echo $Button . '&p=copyfile\'">' . $ICONS['copy'] . ' ' . hsc($_['Copy']) . '</button>'; if (!$Editing_OFCMS) { echo $Button . '&p=deletefile\'">' . $ICONS['delete'] . ' ' . hsc($_['Delete']) . '</button>'; } ?> </div> <?php }
include $WYSIWYG_PLUGIN_OS; } //Display any $message's echo '<script>'; echo 'var $tabindex_xbox = ' . $TABINDEX_XBOX . ';'; //Used in Display_Messages() echo 'var $page = "' . $page . '";'; echo 'var $message = "' . addslashes($message) . '";'; //Cause $message's $X_box to take focus on these pages only. echo 'if (($page == "index") || ($page == "edit")) {take_focus = 1}'; echo 'else {take_focus = 0}'; //##### ACTUAL COUNTDOWN STARTS ON THE SERVER. //##### DO I NEED TO ACCOUNT FOR TIME RECEIVING & LOADING PAGE CLIENT SIDE? //The setTimeout() delay should be greater than what is set for the Sort_and_Show() "working..." message. echo 'setTimeout("Display_Messages($message, take_focus)", ' . $DELAY_final_messages . ');'; echo '</script>'; //start any timers (Yea, they could probably be put in a window.onload function or something...) if ($_SESSION['valid']) { echo Timeout_Timer($MAX_IDLE_TIME, 'timer0', 'LOGOUT'); } if ($page == 'edit') { echo Timeout_Timer($MAX_IDLE_TIME, 'timer1', 'LOGOUT'); } if ($LOGIN_DELAYED > 0) { echo Timeout_Timer($LOGIN_DELAYED, 'timer0', ''); } //##### END OF FILE ############################################################ //##### Header (UTF-8) for [View Raw] incorrect or not getting sent?? //##### If file has non-ascii characters, browers display in ISO-8859-1/Windows-1252, //##### Except IE, which asks to download the file... //##### When browsers manually set to UTF-8, files display fine.