WP Total Hacks - Version 0.3.0

Version Description

  • Bug fix for admin UI
Download this release

Release Info

Developer miyauchi
Plugin Icon wp plugin WP Total Hacks
Version 0.3.0
Comparing to
See all releases

Code changes from version 0.2.3 to 0.3.0

css/style.css CHANGED
@@ -222,4 +222,28 @@
222
  margin-right: 300px;
223
  }
224
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
 
222
  margin-right: 300px;
223
  }
224
 
225
+ #wfb-notice
226
+ {
227
+ position: absolute;
228
+ top: 100px;
229
+ left: 0px;
230
+ z-index: 100;
231
+ width: 100%;
232
+ display: none;
233
+ }
234
+
235
+ #wfb-notice div
236
+ {
237
+ margin: 0 auto;
238
+ width: 400px;
239
+ padding: 30px 0;
240
+ font-size: 120%;
241
+ border: 1px solid #e6db55;
242
+ border-radius: 8px;
243
+ background-color: #ffffe0;
244
+ text-align: center;
245
+ opacity: 0.8;
246
+ filter: alpha(opacity=80);
247
+ -ms-filter: "alpha(opacity=80)";
248
+ }
249
 
includes/form/footer.php CHANGED
@@ -7,3 +7,56 @@
7
  <h3><?php _e('Contributors', 'wp-total-hacks'); ?></h3>
8
  <p><?php $this->get_contributors(); ?></p>
9
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  <h3><?php _e('Contributors', 'wp-total-hacks'); ?></h3>
8
  <p><?php $this->get_contributors(); ?></p>
9
  </div>
10
+
11
+ <script type="text/javascript">
12
+ window.scrollTo(0,0);
13
+ var send = window.send_to_editor;
14
+ var biz = new wpbiz();
15
+ jQuery('#tabid').val(location.hash);
16
+
17
+ // setup tab menu
18
+ jQuery('#tabs .tab').each(function(){
19
+ var id = jQuery(this).attr("id");
20
+ var txt = jQuery(jQuery('h3', this).get(0)).text();
21
+ var li = jQuery('<li><a href="#'+id+'"><span>'+txt+'</span></a></li>');
22
+ jQuery('#menu').append(li);
23
+ });
24
+ jQuery(function(){
25
+ jQuery("#tabs").tabs({fx:{opacity:'toggle', duration:'fast'}});
26
+ jQuery("#tabs h3").css('display', 'none');
27
+ });
28
+ jQuery("#menu a").click(function(){
29
+ jQuery('#tabid').val(jQuery(this).attr('href'));
30
+ });
31
+ jQuery('#tabs').css('display', 'block');
32
+
33
+ // setup media uploader
34
+ jQuery('a.media-upload').each(function(){
35
+ var rel = jQuery(this).attr("rel");
36
+ jQuery(this).click(function(){
37
+ window.send_to_editor = function(html) {
38
+ imgurl = jQuery('img', html).attr('src');
39
+ jQuery('#'+rel).val(imgurl);
40
+ tb_remove();
41
+ }
42
+ formfield = jQuery('#'+rel).attr('name');
43
+ tb_show(null, 'media-upload.php?post_id=0&type=image&TB_iframe=true');
44
+ return false;
45
+ });
46
+ });
47
+
48
+ // setup visual editor
49
+ jQuery('#tabs a.thickbox').each(function(){
50
+ jQuery(this).click(function(){
51
+ window.send_to_editor = send;
52
+ });
53
+ });
54
+
55
+ <?php if (isset($_GET['update']) && $_GET['update'] === 'true'): ?>
56
+ jQuery('#wfb-notice').css('display', 'block');
57
+ jQuery('#wfb-notice').delay(2000).animate({
58
+ opacity: 0,
59
+ display: "none"
60
+ }, 500, null, function(){jQuery(this).css('display', 'none');});
61
+ <?php endif; ?>
62
+ </script>
includes/wpbiz_admin.php CHANGED
@@ -167,6 +167,7 @@ function __construct($url)
167
  {
168
  $this->plugin_url = $url;
169
  add_action('admin_menu', array(&$this, 'admin_menu'));
 
170
  }
171
 
172
  public function admin_styles() {
@@ -225,11 +226,20 @@ public function admin_head()
225
  do_action('admin_print_styles');
226
  }
227
 
 
 
 
 
 
 
 
228
  public function admin_notice()
229
  {
230
- echo "<div class=\"error\"><p>";
231
- echo "Security failure!";
232
- echo "</p></div>";
 
 
233
  }
234
 
235
  public function admin_init()
@@ -341,6 +351,7 @@ private function form()
341
  echo '<input type="hidden" name="wpbiz-nonce" value="'.$nonce.'" />';
342
  echo '<input type="hidden" id="tabid" name="tabid" value="" />';
343
  echo '<div id="tabs">';
 
344
  echo '<ul id="menu"></ul>';
345
  include(dirname(__FILE__).'/form/site.php');
346
  include(dirname(__FILE__).'/form/post.php');
167
  {
168
  $this->plugin_url = $url;
169
  add_action('admin_menu', array(&$this, 'admin_menu'));
170
+ add_filter('gettext', array(&$this, 'replace_text_in_thickbox'), 1, 3);
171
  }
172
 
173
  public function admin_styles() {
226
  do_action('admin_print_styles');
227
  }
228
 
229
+ public function replace_text_in_thickbox($translated_text, $source_text, $domain) {
230
+ if (isset($_GET['post_id']) && !$_GET['post_id'] && 'Insert into Post' == $source_text) {
231
+ return __('Select File', 'wp-total-hacks');
232
+ }
233
+ return $translated_text;
234
+ }
235
+
236
  public function admin_notice()
237
  {
238
+ if (isset($_GET['err']) && $_GET['err']) {
239
+ echo "<div class=\"error\"><p>";
240
+ echo "Security failure!";
241
+ echo "</p></div>";
242
+ }
243
  }
244
 
245
  public function admin_init()
351
  echo '<input type="hidden" name="wpbiz-nonce" value="'.$nonce.'" />';
352
  echo '<input type="hidden" id="tabid" name="tabid" value="" />';
353
  echo '<div id="tabs">';
354
+ echo '<div id="wfb-notice"><div>'.__('Saved.').'</div></div>';
355
  echo '<ul id="menu"></ul>';
356
  include(dirname(__FILE__).'/form/site.php');
357
  include(dirname(__FILE__).'/form/post.php');
js/wp-biz.js CHANGED
@@ -1,46 +1,3 @@
1
- jQuery('document').ready(function(){
2
- var send = window.send_to_editor;
3
- var biz = new wpbiz();
4
-
5
- // setup tab menu
6
- jQuery('#tabs .tab').each(function(){
7
- var id = jQuery(this).attr("id");
8
- var txt = jQuery(jQuery('h3', this).get(0)).text();
9
- var li = jQuery('<li><a href="#'+id+'"><span>'+txt+'</span></a></li>');
10
- jQuery('#menu').append(li);
11
- });
12
- jQuery(function(){
13
- jQuery("#tabs").tabs({fx:{opacity:'toggle', duration:'fast'}});
14
- jQuery("#tabs h3").css('display', 'none');
15
- });
16
- jQuery("#menu a").click(function(){
17
- jQuery('#tabid').val(jQuery(this).attr('href'));
18
- });
19
- jQuery('#tabs').css('display', 'block');
20
-
21
- // setup media uploader
22
- jQuery('a.media-upload').each(function(){
23
- var rel = jQuery(this).attr("rel");
24
- jQuery(this).click(function(){
25
- window.send_to_editor = function(html) {
26
- imgurl = jQuery('img', html).attr('src');
27
- jQuery('#'+rel).val(imgurl);
28
- tb_remove();
29
- }
30
- formfield = jQuery('#'+rel).attr('name');
31
- tb_show(null, 'media-upload.php?post_id=0&type=image&TB_iframe=true');
32
- return false;
33
- });
34
- });
35
-
36
- // setup visual editor
37
- jQuery('#tabs a.thickbox').each(function(){
38
- jQuery(this).click(function(){
39
- window.send_to_editor = send;
40
- });
41
- });
42
- });
43
-
44
  function wpbiz() {
45
  var self = this;
46
  jQuery('#tabs h4').each(function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  function wpbiz() {
2
  var self = this;
3
  jQuery('#tabs h4').each(function(){
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://firegoby.theta.ne.jp/
4
  Tags: head, post, page, functions.php, admin, logo, auto save, revision, meta box, dashboard
5
  Requires at least: 3.1
6
  Tested up to: 3.1
7
- Stable tag: 0.2.3
8
 
9
  WP Total Hacks can customize more than 20 settings on your WordPress Site.
10
 
@@ -50,6 +50,7 @@ Please contact to me.
50
 
51
  * @miya0001 on twitter.
52
  * http://www.facebook.com/firegoby
 
53
 
54
  = Contributors =
55
 
@@ -74,6 +75,9 @@ Please contact to me.
74
 
75
  == Changelog ==
76
 
 
 
 
77
  = 0.2.3 =
78
  * Dutch support
79
 
4
  Tags: head, post, page, functions.php, admin, logo, auto save, revision, meta box, dashboard
5
  Requires at least: 3.1
6
  Tested up to: 3.1
7
+ Stable tag: 0.3.0
8
 
9
  WP Total Hacks can customize more than 20 settings on your WordPress Site.
10
 
50
 
51
  * @miya0001 on twitter.
52
  * http://www.facebook.com/firegoby
53
+ * https://github.com/miya0001/wp-total-hacks
54
 
55
  = Contributors =
56
 
75
 
76
  == Changelog ==
77
 
78
+ = 0.3.0 =
79
+ * Bug fix for admin UI
80
+
81
  = 0.2.3 =
82
  * Dutch support
83
 
wp-total-hacks.php CHANGED
@@ -5,7 +5,7 @@ Author: Takayuki Miyauchi
5
  Plugin URI: http://firegoby.theta.ne.jp/wp/wp-total-hacks
6
  Description: WP Total Hacks can customize your WordPress.
7
  Author: Takayuki Miyauchi
8
- Version: 0.2.3
9
  Author URI: http://firegoby.theta.ne.jp/
10
  */
11
 
5
  Plugin URI: http://firegoby.theta.ne.jp/wp/wp-total-hacks
6
  Description: WP Total Hacks can customize your WordPress.
7
  Author: Takayuki Miyauchi
8
+ Version: 0.3.0
9
  Author URI: http://firegoby.theta.ne.jp/
10
  */
11