TinyMCE Templates - Version 1.4.1

Version Description

Download this release

Release Info

Developer miyauchi
Plugin Icon 128x128 TinyMCE Templates
Version 1.4.1
Comparing to
See all releases

Code changes from version 1.3.1 to 1.4.1

includes/MceTemplatesAdmin.class.php CHANGED
@@ -162,6 +162,7 @@ class MceTemplatesAdmin{
162
  // new line by ANDREA BERSI
163
  echo "<div id='poststuff'>";
164
  echo "<div id=\"postdivrich\" class=\"postarea\">";
 
165
  the_editor($html, "content", "desc", true, 3);
166
  echo "</div><!--end #postdivrich-->";
167
  echo "</div><!--end #poststuff-->";
162
  // new line by ANDREA BERSI
163
  echo "<div id='poststuff'>";
164
  echo "<div id=\"postdivrich\" class=\"postarea\">";
165
+ wp_tiny_mce();
166
  the_editor($html, "content", "desc", true, 3);
167
  echo "</div><!--end #postdivrich-->";
168
  echo "</div><!--end #poststuff-->";
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/jp/cgi-bin/webscr?cmd=_flow&SESSION=vVwWrw6V
4
  Tags: tinymce, Visual Editor, template
5
  Requires at least: 3.0
6
  Tested up to: 3.1
7
- Stable tag: 1.3.1
8
 
9
  TinyMCE Template plugin will enable to use HTML template on WordPress Visual Editor.
10
  You can edit and share this template with WordPress users.
4
  Tags: tinymce, Visual Editor, template
5
  Requires at least: 3.0
6
  Tested up to: 3.1
7
+ Stable tag: 1.4.1
8
 
9
  TinyMCE Template plugin will enable to use HTML template on WordPress Visual Editor.
10
  You can edit and share this template with WordPress users.
tinymce_templates.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: TinyMCE Templates
4
  Plugin URI: http://firegoby.theta.ne.jp/wp/tinymce_templates
5
  Description: Manage & Add Tiny MCE template.
6
  Author: Takayuki Miyauchi
7
- Version: 1.3.1
8
  Author URI: http://firegoby.theta.ne.jp/
9
  */
10
 
@@ -44,124 +44,124 @@ register_activation_hook (__FILE__, array(&$MceTemplates, 'activation'));
44
 
45
  class MceTemplates{
46
 
47
- //
48
- // construct
49
- //
50
- function __construct()
51
- {
52
- add_action('admin_menu', array(&$this, 'loadAdmin'));
53
- add_filter('plugin_row_meta', array(&$this, 'plugin_row_meta'), 10, 2);
54
- }
55
 
56
- public function admin_head()
57
- {
58
- wp_enqueue_script('common');
59
- wp_enqueue_script('jquery-color');
60
- wp_print_scripts('editor');
61
- if (function_exists('add_thickbox')) add_thickbox();
62
- wp_print_scripts('media-upload');
63
- if (function_exists('wp_tiny_mce')) wp_tiny_mce();
64
- wp_admin_css();
65
- wp_enqueue_script('utils');
66
- do_action("admin_print_styles-post-php");
67
- do_action('admin_print_styles');
68
- $dir = WP_PLUGIN_URL.'/'.dirname(plugin_basename(__FILE__));
69
- $html = '<link rel="stylesheet" href="%s/style.css" type="text/css" />';
70
- printf($html, $dir);
71
- }
72
 
73
- public function activation()
74
- {
75
- global $wpdb;
76
- $table = $wpdb->prefix.'mce_template';
77
- if ($wpdb->get_var("show tables like '$table'") != $table) {
78
- $sql = "CREATE TABLE ".$table." (
79
- `ID` varchar(32) NOT NULL,
80
- `name` varchar(50) NOT NULL,
81
- `desc` varchar(100) NOT NULL,
82
- `html` text NOT NULL,
83
- `share` tinyint(1) unsigned NOT NULL,
84
- `author` bigint(20) unsigned NOT NULL,
85
- `modified` timestamp NOT NULL,
86
- UNIQUE KEY ID (`ID`))
87
- ENGINE = MYISAM
88
- CHARACTER SET utf8
89
- COLLATE utf8_unicode_ci;
90
- ";
91
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
92
- dbDelta($sql);
93
- }
94
  }
 
95
 
96
- public function deactivation()
97
- {
98
- // nothing to do
99
- }
100
 
101
- //
102
- // add admin menu
103
- //
104
- public function loadAdmin()
105
- {
106
- load_plugin_textdomain(
107
- TINYMCE_TEMPLATES_DOMAIN,
108
- PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)).'/langs',
109
- dirname(plugin_basename(__FILE__)).'/langs'
110
- );
111
-
112
- $this->edit_hook = add_menu_page(
113
- __('tinyMCE Templates', TINYMCE_TEMPLATES_DOMAIN),
114
- __('Templates', TINYMCE_TEMPLATES_DOMAIN),
115
- 'edit_pages',
116
- 'edittemplates',
117
- '',
118
- TINYMCE_TEMPLATES_PLUGIN_URL.'/img/icon.png'
119
- );
120
- add_submenu_page(
121
- 'edittemplates',
122
- __('Edit Templates', TINYMCE_TEMPLATES_DOMAIN),
123
- __('Edit', TINYMCE_TEMPLATES_DOMAIN),
124
- 'edit_pages',
125
- 'edittemplates',
126
- array(&$this, 'adminPage')
127
- );
128
- $this->add_hook = add_submenu_page(
129
- 'edittemplates',
130
- __('Add New Templates', TINYMCE_TEMPLATES_DOMAIN),
131
- __('Add New', TINYMCE_TEMPLATES_DOMAIN),
132
- 'edit_pages',
133
- 'addnewtemplates',
134
- array(&$this, 'adminPage')
135
- );
136
- add_action(
137
- 'admin_head-'.$this->edit_hook,
138
- array(&$this, 'admin_head')
139
- );
140
- add_action(
141
- 'admin_head-'.$this->add_hook,
142
- array(&$this, 'admin_head')
143
- );
144
- }
 
 
 
 
145
 
 
146
 
147
- //
148
- // display mcetemplates list
149
- //
150
- public function adminPage()
151
- {
152
- new MceTemplatesAdmin();
153
- }
154
 
155
- public function plugin_row_meta($links, $file)
156
- {
157
- $pname = plugin_basename(__FILE__);
158
- if ($pname === $file) {
159
- $url = "https://www.paypal.com/";
160
- $url .= "cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K8BY3GVRHSCHY";
161
- $links[] = sprintf('<a href="%s">Donate</a>', $url);
162
- }
163
- return $links;
 
 
 
164
  }
 
 
165
  }
166
 
167
  ?>
4
  Plugin URI: http://firegoby.theta.ne.jp/wp/tinymce_templates
5
  Description: Manage & Add Tiny MCE template.
6
  Author: Takayuki Miyauchi
7
+ Version: 1.4.1
8
  Author URI: http://firegoby.theta.ne.jp/
9
  */
10
 
44
 
45
  class MceTemplates{
46
 
47
+ function __construct()
48
+ {
49
+ add_action('admin_menu', array(&$this, 'loadAdmin'));
50
+ add_filter('plugin_row_meta', array(&$this, 'plugin_row_meta'), 10, 2);
51
+ }
 
 
 
52
 
53
+ public function admin_head()
54
+ {
55
+ wp_admin_css();
56
+ do_action("admin_print_styles-post-php");
57
+ do_action('admin_print_styles');
58
+ $dir = WP_PLUGIN_URL.'/'.dirname(plugin_basename(__FILE__));
59
+ $html = '<link rel="stylesheet" href="%s/style.css" type="text/css" />';
60
+ printf($html, $dir);
61
+ }
 
 
 
 
 
 
 
62
 
63
+ public function activation()
64
+ {
65
+ global $wpdb;
66
+ $table = $wpdb->prefix.'mce_template';
67
+ if ($wpdb->get_var("show tables like '$table'") != $table) {
68
+ $sql = "CREATE TABLE ".$table." (
69
+ `ID` varchar(32) NOT NULL,
70
+ `name` varchar(50) NOT NULL,
71
+ `desc` varchar(100) NOT NULL,
72
+ `html` text NOT NULL,
73
+ `share` tinyint(1) unsigned NOT NULL,
74
+ `author` bigint(20) unsigned NOT NULL,
75
+ `modified` timestamp NOT NULL,
76
+ UNIQUE KEY ID (`ID`))
77
+ ENGINE = MYISAM
78
+ CHARACTER SET utf8
79
+ COLLATE utf8_unicode_ci;
80
+ ";
81
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
82
+ dbDelta($sql);
 
83
  }
84
+ }
85
 
86
+ public function deactivation()
87
+ {
88
+ // nothing to do
89
+ }
90
 
91
+ public function loadAdmin()
92
+ {
93
+ load_plugin_textdomain(
94
+ TINYMCE_TEMPLATES_DOMAIN,
95
+ PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)).'/langs',
96
+ dirname(plugin_basename(__FILE__)).'/langs'
97
+ );
98
+
99
+ $this->edit_hook = add_menu_page(
100
+ __('tinyMCE Templates', TINYMCE_TEMPLATES_DOMAIN),
101
+ __('Templates', TINYMCE_TEMPLATES_DOMAIN),
102
+ 'edit_pages',
103
+ 'edittemplates',
104
+ '',
105
+ TINYMCE_TEMPLATES_PLUGIN_URL.'/img/icon.png'
106
+ );
107
+ add_submenu_page(
108
+ 'edittemplates',
109
+ __('Edit Templates', TINYMCE_TEMPLATES_DOMAIN),
110
+ __('Edit', TINYMCE_TEMPLATES_DOMAIN),
111
+ 'edit_pages',
112
+ 'edittemplates',
113
+ array(&$this, 'adminPage')
114
+ );
115
+ $this->add_hook = add_submenu_page(
116
+ 'edittemplates',
117
+ __('Add New Templates', TINYMCE_TEMPLATES_DOMAIN),
118
+ __('Add New', TINYMCE_TEMPLATES_DOMAIN),
119
+ 'edit_pages',
120
+ 'addnewtemplates',
121
+ array(&$this, 'adminPage')
122
+ );
123
+ add_action(
124
+ 'admin_head-'.$this->edit_hook,
125
+ array(&$this, 'admin_head')
126
+ );
127
+ add_action(
128
+ 'admin_head-'.$this->add_hook,
129
+ array(&$this, 'admin_head')
130
+ );
131
+ add_action(
132
+ 'admin_print_scripts-'.$this->add_hook,
133
+ array(&$this, 'admin_scripts')
134
+ );
135
+ add_action(
136
+ 'admin_print_scripts-'.$this->edit_hook,
137
+ array(&$this, 'admin_scripts')
138
+ );
139
 
140
+ }
141
 
142
+ public function admin_scripts() {
143
+ wp_enqueue_script('jquery-ui-tabs');
144
+ wp_enqueue_script('editor');
145
+ add_thickbox();
146
+ wp_enqueue_script('media-upload');
147
+ add_action('admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30);
148
+ }
149
 
150
+ public function adminPage()
151
+ {
152
+ new MceTemplatesAdmin();
153
+ }
154
+
155
+ public function plugin_row_meta($links, $file)
156
+ {
157
+ $pname = plugin_basename(__FILE__);
158
+ if ($pname === $file) {
159
+ $url = "https://www.paypal.com/";
160
+ $url .= "cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K8BY3GVRHSCHY";
161
+ $links[] = sprintf('<a href="%s">Donate</a>', $url);
162
  }
163
+ return $links;
164
+ }
165
  }
166
 
167
  ?>