Beispiel #1
0
 /**
  * Adds menu pages to manage NextGen Settings
  * @uses action: admin_menu
  */
 function add_menu_pages()
 {
     C_Page_Manager::get_instance()->setup();
 }
 /**
  * Gets an instance of the Page Manager
  * @param string $context
  * @return C_Page_Manager
  */
 static function &get_instance($context = FALSE)
 {
     if (is_null(self::$_instance)) {
         $klass = get_class();
         self::$_instance = new $klass($context);
     }
     return self::$_instance;
 }
 function admin_notices()
 {
     $nextgen_found = FALSE;
     if (defined('NGG_PLUGIN_VERSION')) {
         $nextgen_found = 'NGG_PLUGIN_VERSION';
     }
     if (defined('NEXTGEN_GALLERY_PLUGIN_VERSION')) {
         $nextgen_found = 'NEXTGEN_GALLERY_PLUGIN_VERSION';
     }
     $nextgen_version = @constant($nextgen_found);
     if (FALSE == $nextgen_found) {
         $message = __('Please install &amp; activate <a href="http://wordpress.org/plugins/nextgen-gallery/" target="_blank">NextGEN Gallery</a> to allow NextGEN Pro to work.', 'nextgen-gallery-pro');
         echo '<div class="updated"><p>' . $message . '</p></div>';
     } else {
         if (version_compare($nextgen_version, self::$minimum_ngg_version) == -1) {
             $ngg_pro_version = NGG_PRO_PLUGIN_VERSION;
             $upgrade_url = admin_url('/plugin-install.php?tab=plugin-information&plugin=nextgen-gallery&section=changelog&TB_iframe=true&width=640&height=250');
             $message = sprintf(__("NextGEN Gallery %s is incompatible with NextGEN Pro %s. Please update <a class='thickbox' href='%s'>NextGEN Gallery</a> to version %s or higher. NextGEN Pro has been deactivated.", 'nextgen-gallery-pro'), $nextgen_version, $ngg_pro_version, $upgrade_url, self::$minimum_ngg_version);
             echo '<div class="updated"><p>' . $message . '</p></div>';
             deactivate_plugins(NGG_PRO_PLUGIN_BASENAME);
         } elseif (delete_option('photocrati_pro_recently_activated')) {
             $message = __('To activate the NextGEN Pro Lightbox please go to Gallery > Other Options > Lightbox Effects.', 'nextgen-gallery-pro');
             echo '<div class="updated"><p>' . $message . '</p></div>';
             if (!extension_loaded('bcmath')) {
                 $message = __('Warning: your server does not have BCMath enabled. Please enable BCMath to prevent possible issues with ecommerce orders', 'nextgen-gallery-pro');
                 echo '<div class="updated"><p>' . $message . '</p></div>';
             }
         }
     }
     if (class_exists('C_Page_Manager')) {
         $pages = C_Page_Manager::get_instance();
         if (isset($_REQUEST['page'])) {
             if (in_array($_REQUEST['page'], array_keys($pages->get_all())) || preg_match("/^nggallery-/", $_REQUEST['page']) || $_REQUEST['page'] == 'nextgen-gallery') {
                 if (self::has_updates()) {
                     $update_message = self::_get_update_message();
                     echo '<div class="updated"><p>' . $update_message . '</p></div>';
                 }
             }
         }
     }
 }