A tumblelog CMS built on AJAX, PHP and MySQL.

post_confirmation.php 774B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. Plugin Name: PostConfirmation
  4. Plugin URI: http://www.gelatocms.com/plugins/postconfirmation/
  5. Description: Add a confirmation dialog when submit the Create-post button.
  6. Author: Victor Bracco
  7. Author URI: http://www.vbracco.com.ar/
  8. Version: 1.0
  9. */
  10. class post_confirmation extends plugins {
  11. function post_confirmation(){
  12. $this->addAction('admin_includes', 'post_confirmation_script');
  13. }
  14. function post_confirmation_script() {
  15. global $admin_includes,$isEdition;
  16. if(!$isEdition){
  17. $admin_includes .= "
  18. <script type=\"text/javascript\">
  19. $(document).ready(function(){
  20. $('#publish').click( function(){
  21. return (confirm('".__("Do you realy want to publish this?")."'));
  22. });
  23. });
  24. </script>
  25. ";
  26. }
  27. }
  28. }
  29. ?>