xml_load_file($file); } function simplexml_load_string($string) { $sx = new SimpleXML; return $sx->xml_load_string($string); } } else { define('FGALLERY_PHP4_MODE', 0); require_once 'includes/thumbs/ThumbLib.inc.php'; } include 'includes/lib/define.php'; include 'includes/lib/install.php'; include 'includes/lib/init.php'; include 'includes/lib/helper.php'; include 'includes/lib/gallery.php'; include 'includes/lib/image.php'; include 'includes/lib/settings.php'; include 'includes/lib/templates.php'; include 'includes/lib/widget.php'; include 'includes/lib/filters.php'; include 'includes/ajax/actions.php'; include 'includes/ajax/upload.php'; include 'includes/ajax/config.php'; include 'includes/ajax/images.php'; include 'includes/render/configurator.php'; include 'includes/render/page_elements.php'; include 'includes/render/pages.php'; include 'includes/render/view.php'; include 'includes/render/urls.php'; //registering install and uninstall hooks register_activation_hook(__FILE__,'fgallery_install'); if (function_exists('register_update_hook')) { register_update_hook(__FILE__,'fgallery_update'); } register_uninstall_hook(__FILE__,'fgallery_uninstall'); // register localizations $plugin_dir = basename(dirname(__FILE__)).'/languages/'; load_plugin_textdomain( 'fgallery', null, $plugin_dir ); /* * List of actions */ add_action('init', 'fgallery_init'); /* * Ajax callbacks */ add_action('wp_ajax_fgallery_save_album_image', 'fgallery_save_album_image'); add_action('wp_ajax_fgallery_sort_album_images', 'fgallery_sort_album_images'); add_action('wp_ajax_fgallery_remove_album_image', 'fgallery_remove_album_image'); add_action('wp_ajax_fgallery_set_album_cover', 'fgallery_set_album_cover'); add_action('wp_ajax_fgallery_delete_image', 'fgallery_delete_image_ajax'); add_action('wp_ajax_fgallery_folder_addimage', 'fgallery_folder_addimage'); add_action('wp_ajax_fgallery_delete_gallery', 'fgallery_delete_gallery'); add_action('wp_ajax_fgallery_sort_galleries', 'fgallery_sort_galleries'); add_action('wp_ajax_fgallery_rotate_image', 'fgallery_rotate_image'); add_action('wp_ajax_fgallery_add_preview', 'fgallery_add_preview'); add_action('wp_ajax_fgallery_add_preview_form', 'fgallery_add_preview_form'); add_action('wp_ajax_fgallery_get_image_text', 'fgallery_get_image_text'); add_action('wp_ajax_nopriv_fgallery_get_image_text', 'fgallery_get_image_text'); add_action('wp_ajax_fgallery_massedit','fgallery_massedit'); add_action('wp_ajax_fgallery_add_folder','fgallery_add_folder'); add_action('wp_ajax_fgallery_add_image','fgallery_add_image'); add_action('wp_ajax_fgallery_addimages','fgallery_addimages'); add_action('wp_ajax_fgallery_save_template','fgallery_save_template'); add_action('wp_ajax_fgallery_load_template','fgallery_load_template'); add_action('wp_ajax_fgallery_delete_template','fgallery_delete_template'); add_action('wp_ajax_fgallery_insert_gallery','fgallery_insert_gallery'); /* * Ajax for creating response without template */ add_action('wp_ajax_fgallery_show_image','fgallery_show_image'); add_action('wp_ajax_nopriv_fgallery_show_image','fgallery_show_image'); add_action('wp_ajax_fgallery_config','fgallery_config'); add_action('wp_ajax_nopriv_fgallery_config','fgallery_config'); add_action('wp_ajax_fgallery_images','fgallery_images'); add_action('wp_ajax_nopriv_fgallery_images','fgallery_images'); add_action('wp_ajax_fgallery_folder_form','fgallery_folder_form'); add_action('wp_ajax_fgallery_addimages_page','fgallery_addimages_page'); add_action('wp_ajax_fgallery_save_template_page','fgallery_save_template_page'); add_action('wp_ajax_fgallery_load_template_page','fgallery_load_template_page'); add_action('wp_ajax_fgallery_insert_page','fgallery_insert_page'); add_action('wp_ajax_fgallery_view_gallery','fgallery_view_gallery'); add_action('wp_ajax_nopriv_fgallery_view_gallery','fgallery_view_gallery'); /* * Ajax Upload */ add_action('wp_ajax_fgallery_scandir_upload','fgallery_scandir_upload'); add_action('wp_ajax_fgallery_local_upload','fgallery_local_upload'); add_action('wp_ajax_fgallery_uploadify_upload','fgallery_uploadify_upload'); add_action('wp_ajax_nopriv_fgallery_uploadify_upload','fgallery_uploadify_upload'); add_action('wp_ajax_fgallery_url_upload','fgallery_url_upload'); add_action('wp_ajax_fgallery_wpmedia_upload','fgallery_wpmedia_upload'); add_action('wp_ajax_fgallery_ftp_upload','fgallery_ftp_upload'); add_action('wp_ajax_fgallery_zip_upload','fgallery_zip_upload'); add_action('wp_ajax_fgallery_nextgen_upload','fgallery_nextgen_upload'); /* * Filters */ add_filter('screen_settings', 'fgallery_screen_settings', 10, 2); add_filter('contextual_help', 'fgallery_plugin_help', 10, 3); add_filter('media_buttons_context','fgallery_add_button',9); add_shortcode('fgallery', 'fgallery_shortcode_handler'); /* * Widget */ add_action('widgets_init', create_function('', 'return register_widget("FgalleryWidget");'));