C_NextGen_Settings_Installer

The NextGEN Gallery C NextGen Settings Installer class.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php  
  1. class C_NextGen_Settings_Installer 
  2. private $_global_settings = array(); 
  3. private $_local_settings = array(); 
  4.  
  5. function __construct() 
  6. $this->blog_settings = C_NextGen_Settings::get_instance(); 
  7. $this->site_settings = C_NextGen_Global_Settings::get_instance(); 
  8.  
  9. $this->_global_settings = array( 
  10. 'gallerypath' => implode(DIRECTORY_SEPARATOR, array('wp-content', 'uploads', 'sites', '%BLOG_ID%', 'nggallery')).DIRECTORY_SEPARATOR,  
  11. 'wpmuCSSfile' => 'nggallery.css',  
  12. 'wpmuStyle' => FALSE,  
  13. 'wpmuRoles' => FALSE,  
  14. 'wpmuImportFolder' => FALSE,  
  15. 'wpmuZipUpload' => FALSE,  
  16. 'wpmuQuotaCheck' => FALSE,  
  17. 'datamapper_driver' => 'custom_table_datamapper',  
  18. 'gallerystorage_driver' => 'ngglegacy_gallery_storage',  
  19. 'maximum_entity_count' => 500,  
  20. 'router_param_slug' => 'nggallery' 
  21. ); 
  22.  
  23. $this->_local_settings = array( 
  24. 'gallerypath' => 'wp-content'.DIRECTORY_SEPARATOR.'gallery'.DIRECTORY_SEPARATOR,  
  25. 'deleteImg' => TRUE, // delete Images 
  26. 'swfUpload' => TRUE, // activate the batch upload 
  27. 'usePermalinks' => FALSE, // use permalinks for parameters 
  28. 'permalinkSlug' => 'nggallery', // the default slug for permalinks 
  29. 'graphicLibrary' => 'gd', // default graphic library 
  30. 'imageMagickDir' => '/usr/local/bin/', // default path to ImageMagick 
  31. 'useMediaRSS' => FALSE, // activate the global Media RSS file 
  32. 'galleries_in_feeds' => FALSE, // enables rendered gallery output in rss/atom feeds 
  33.  
  34. // Tags / categories 
  35. 'activateTags' => 0, // append related images 
  36. 'appendType' => 'tags', // look for category or tags 
  37. 'maxImages' => 7, // number of images toshow 
  38. 'relatedHeading' => '<h3>' . __('Related Images', 'nggallery') . ':</h3>', // subheading for related images 
  39.  
  40. // Thumbnail Settings 
  41. 'thumbwidth' => 240, // Thumb Width 
  42. 'thumbheight' => 160, // Thumb height 
  43. 'thumbfix' => True, // Fix the dimension 
  44. 'thumbquality' => 100, // Thumb Quality 
  45.  
  46. // Image Settings 
  47. 'imgWidth' => 800, // Image Width 
  48. 'imgHeight' => 600, // Image height 
  49. 'imgQuality' => 100, // Image Quality 
  50. 'imgBackup' => True, // Create a backup 
  51. 'imgAutoResize' => False, // Resize after upload 
  52.  
  53. // Gallery Settings 
  54. 'galImages' => '20', // Number of images per page 
  55. 'galPagedGalleries' => 0, // Number of galleries per page (in a album) 
  56. 'galColumns' => 0, // Number of columns for the gallery 
  57. 'galShowSlide' => True, // Show slideshow 
  58. 'galTextSlide' => __('[Show slideshow]', 'nggallery'), // Text for slideshow 
  59. 'galTextGallery' => __('[Show thumbnails]', 'nggallery'), // Text for gallery 
  60. 'galShowOrder' => 'gallery', // Show order 
  61. 'galSort' => 'sortorder', // Sort order 
  62. 'galSortDir' => 'ASC', // Sort direction 
  63. 'galNoPages' => True, // use no subpages for gallery 
  64. 'galImgBrowser' => 0, // Show ImageBrowser => instead effect 
  65. 'galHiddenImg' => 0, // For paged galleries we can hide image 
  66. 'galAjaxNav' => 0, // AJAX Navigation for Shutter effect 
  67.  
  68. // Thumbnail Effect 
  69. 'thumbEffect' => 'fancybox', // select effect 
  70. 'thumbCode' => 'class="ngg-fancybox" rel="%GALLERY_NAME%"',  
  71. 'thumbEffectContext' => 'nextgen_images', // select effect 
  72.  
  73. // Watermark settings 
  74. 'wmPos' => 'botRight', // Postion 
  75. 'wmXpos' => 5, // X Pos 
  76. 'wmYpos' => 5, // Y Pos 
  77. 'wmType' => 'image', // Type : 'image' / 'text' 
  78. 'wmPath' => '', // Path to image 
  79. 'wmFont' => 'arial.ttf', // Font type 
  80. 'wmSize' => 10, // Font Size 
  81. 'wmText' => get_option('blogname'), // Text 
  82. 'wmColor' => '000000', // Font Color 
  83. 'wmOpaque' => '100', // Font Opaque 
  84.  
  85. // Image Rotator settings 
  86. 'slideFX' => 'fade',  
  87. 'irWidth' => 600,  
  88. 'irHeight' => 400,  
  89. 'irRotatetime' => 10,  
  90.  
  91. // CSS Style 
  92. 'activateCSS' => 1, // activate the CSS file 
  93. 'CSSfile' => 'nggallery.css', // set default css filename 
  94. 'always_enable_frontend_logic' => FALSE 
  95. ); 
  96.  
  97. function install_global_settings($reset=FALSE) 
  98. foreach ($this->_global_settings as $key => $value) { 
  99. if ($reset) $this->site_settings->set($key, NULL); 
  100. $this->site_settings->set_default_value($key, $value); 
  101.  
  102. function install_local_settings($reset=FALSE) 
  103. foreach ($this->_local_settings as $key => $value) { 
  104. if ($reset) $this->blog_settings->set($key, NULL); 
  105. $this->blog_settings->set_default_value($key, $value); 
  106.  
  107. if (is_multisite()) 
  108. // If this is already network activated we just need to use the existing setting 
  109. // Note: attempting to use C_NextGen_Global_Settings here may result in an infinite loop,  
  110. // so get_site_option() is used to check 
  111. if ($options = get_site_option('ngg_options')) 
  112. $gallerypath = $options['gallerypath']; 
  113. else 
  114. $gallerypath = $this->_global_settings['gallerypath']; 
  115.  
  116. $gallerypath = $this->gallerypath_replace($gallerypath); 
  117.  
  118. // a gallerypath setting has already been set, so we explicitly set a default AND set a new value 
  119. $this->blog_settings->set_default_value('gallerypath', $gallerypath); 
  120. $this->blog_settings->set('gallerypath', $gallerypath); 
  121.  
  122. function install($reset=FALSE) 
  123. $this->install_global_settings($reset); 
  124. $this->install_local_settings($reset); 
  125.  
  126. function get_global_defaults() 
  127. return $this->_global_settings; 
  128.  
  129. function get_local_defaults() 
  130. return $this->_local_settings; 
  131.  
  132. function gallerypath_replace($gallerypath) 
  133. $gallerypath = str_replace('%BLOG_NAME%', get_bloginfo('name'), $gallerypath); 
  134. $gallerypath = str_replace('%BLOG_ID%', get_current_blog_id(), $gallerypath); 
  135. return $gallerypath;