Version Description
Download this release
Release Info
Developer | miyauchi |
Plugin | 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 +1 -0
- readme.txt +1 -1
- tinymce_templates.php +110 -110
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.
|
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.
|
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 |
-
|
49 |
-
|
50 |
-
|
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 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
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 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
}
|
94 |
}
|
|
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
)
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
)
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
)
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
)
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
)
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
)
|
144 |
-
|
|
|
|
|
|
|
|
|
145 |
|
|
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
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 |
?>
|