$value){
$g2_image[$key] = $value;
}
update_option('wpg2_g2ic', $g2_image);
?>
$value){
$g2_image[$key] = $value;
}
// delete_option('wpg2_g2ic_30_archive');
}
update_option('wpg2_g2ic', $g2_image);
}
/**
* Stores G2IC Defaults on Deactivation
*
* @param None
* @return None
*/
function g2image_deactivation() {
// Get Gallery2 IC Option Settings
$g2_image = get_option('wpg2_g2ic');
$g2ic_archive['g2ic_images_per_page'] = $g2_image['g2ic_images_per_page'];
$g2ic_archive['g2ic_display_filenames'] = $g2_image['g2ic_display_filenames'];
$g2ic_archive['g2ic_default_alignment'] = $g2_image['g2ic_default_alignment'];
$g2ic_archive['g2ic_custom_class_1'] = $g2_image['g2ic_custom_class_1'];
$g2ic_archive['g2ic_custom_class_2'] = $g2_image['g2ic_custom_class_2'];
$g2ic_archive['g2ic_custom_class_3'] = $g2_image['g2ic_custom_class_3'];
$g2ic_archive['g2ic_custom_class_4'] = $g2_image['g2ic_custom_class_4'];
$g2ic_archive['g2ic_custom_url'] = $g2_image['g2ic_custom_url'];
$g2ic_archive['g2ic_class_mode'] = $g2_image['g2ic_class_mode'];
$g2ic_archive['g2ic_click_mode'] = $g2_image['g2ic_click_mode'];
$g2ic_archive['g2ic_click_mode_variable'] = $g2_image['g2ic_click_mode_variable'];
$g2ic_archive['g2ic_wpg2id_tags'] = $g2_image['g2ic_wpg2id_tags'];
$g2ic_archive['g2ic_default_action'] = $g2_image['g2ic_default_action'];
$g2ic_archive['g2ic_sortby'] = $g2_image['g2ic_sortby'];
// Save the WPG2 Options into WPG2 Archive
update_option('wpg2_g2ic_30_archive', $g2ic_archive);
// Delete GIC Option
delete_option('wpg2_g2ic');
}
/*
********************************************************************************************************
TINYMCE
********************************************************************************************************
*/
/**
* Adds g2image to the TinyMCE plugins list
*
* @param string $plugins the buttons string from the WP filter
* @return string the appended plugins string
*/
function g2image_wp_extended_editor_mce_plugins($plugins) {
array_push($plugins, '-g2image');
return $plugins;
}
/**
* Adds g2image to the TinyMCE button bar
*
* @param string $buttons the buttons string from the WP filter
* @return string the appended buttons string
*/
function g2image_wp_extended_editor_mce_buttons($buttons) {
array_push($buttons, 'separator', 'g2image');
return $buttons;
}
/**
* Adds g2image to the TinyMCE plugin list
*
* @param null
* @return null
*/
function g2image_plugin() {
$g2image_url = get_bloginfo('wpurl').'/wp-content/plugins/wpg2/g2image';
echo "tinyMCE.loadPlugin('g2image', '". $g2image_url . "');\n";
}
/**
* Adds Additional WPG2 Specific Elements to the TinyMCE valid elements list
*
* @param string $valid_elements the valid elements string from the WP filter
* @return string the appended valid elements string
*/
function g2image_wp_extended_editor_mce_valid_elements($valid_elements) {
$valid_elements .= 'wpg2,wpg2id,div[class]';
return $valid_elements;
}
/**
* Sets G2Image Lanaguage locale
*
* @param string $locale the WP_LANG string specifically from the WP filter for tiny_mce_config
* @return string sets the locale to English if WP_LANG is blank so TinyMCE will have a default language
*/
// Setting locale to English if WP_LANG is blank in tiny_mce_config
function g2image_tinymce_locale($locale) {
if (strstr($_SERVER['REQUEST_URI'], 'tiny_mce_config')) {
if ( $locale == '' ) {
$locale = 'en';
}
}
return $locale;
}
/**
* Adds WPG2 Button to Wordpress Selected (Typically Write) Screens
*
* Javascript appended to the bottom of the "Write Post" or "Write Page" admin pages for the WPG2 quicktag.
*/
function g2image_callback() {
$g2image_url = get_bloginfo('wpurl').'/wp-content/plugins/wpg2/g2image/';
// Only add the javascript to post.php, post-new.php, page.php, page-new.php, or bookmarklet.php pages
if (strpos($_SERVER['REQUEST_URI'], 'post.php') ||
strpos($_SERVER['REQUEST_URI'], 'post-new.php') ||
strpos($_SERVER['REQUEST_URI'], 'page.php') ||
strpos($_SERVER['REQUEST_URI'], 'page-new.php') ||
strpos($_SERVER['REQUEST_URI'], 'bookmarklet.php')) {
?>
if(g2_toolbar){
var theButton = document.createElement('input');
theButton.type = 'button';
theButton.value = '';
theButton.onclick = ;
theButton.className = 'ed_button';
theButton.title = "";
theButton.id = "";
g2_toolbar.appendChild(theButton);
}