Procházet zdrojové kódy

added PostConfirmation plugin

vbracco před 16 roky
rodič
revize
c3685083f3
1 změnil soubory, kde provedl 32 přidání a 0 odebrání
  1. 32 0
      plugins/post_confirmation.php

+ 32 - 0
plugins/post_confirmation.php Zobrazit soubor

@@ -0,0 +1,32 @@
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
+
11
+class post_confirmation extends plugins {
12
+
13
+	function post_confirmation(){
14
+		$this->addAction('admin_includes', 'post_confirmation_script');
15
+	}
16
+	
17
+	function post_confirmation_script() {
18
+		global $admin_includes,$isEdition;
19
+		if(!$isEdition){
20
+			$admin_includes .= "
21
+			<script type=\"text/javascript\">	
22
+			$(document).ready(function(){
23
+				$('#publish').click( function(){
24
+					return (confirm('".__("Do you realy want to publish this?")."'));
25
+				});
26
+			});
27
+			</script>
28
+			";
29
+		}
30
+	}
31
+}
32
+?>