瀏覽代碼

added PostConfirmation plugin

vbracco 15 年之前
父節點
當前提交
c3685083f3
共有 1 個文件被更改,包括 32 次插入0 次删除
  1. 32 0
      plugins/post_confirmation.php

+ 32 - 0
plugins/post_confirmation.php 查看文件

@@ -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
+?>