gde_defaults

Define system defaults (settings/profiles).

Description

gde_defaults( $type ); 

Parameters (1)

0. $type
The type.

Usage

  1. if ( !function_exists( 'gde_defaults' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/libs/lib-setup.php'; 
  3.  
  4. // The type. 
  5. $type = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gde_defaults($type); 
  9.  

Defined (1)

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

/libs/lib-setup.php  
  1. function gde_defaults( $type ) { 
  2. global $env; 
  3.  
  4. // gather/set environment info 
  5. if ( ! $env ) { 
  6. $pdata = gde_get_plugin_data(); 
  7. $baseurl = gde_base_url(); 
  8. $default_lang = gde_get_locale(); 
  9. $apikey = ''; 
  10. $env = array( 
  11. 'pdata' => $pdata,  
  12. 'baseurl' => $baseurl,  
  13. 'default_lang' => $default_lang 
  14. ); 
  15.  
  16. // define "global" options (multisite only) 
  17. $globalopts = array( 
  18. 'file_maxsize' => '12',  
  19. 'beta_check' => 'no' 
  20. ); 
  21.  
  22. // define default options 
  23. $defopts = array( 
  24. 'ed_disable' => 'no',  
  25. 'ed_extend_upload' => 'yes',  
  26. 'ed_embed_sc' => 'yes',  
  27. 'file_maxsize' => '12',  
  28. 'error_check' => 'yes',  
  29. 'error_display' => 'yes',  
  30. 'error_log' => 'no',  
  31. 'beta_check' => 'no',  
  32. 'ga_enable' => 'no',  
  33. 'ga_category' => $env['pdata']['Name'],  
  34. 'ga_label' => 'url' 
  35. ); 
  36.  
  37. // define default profile(s) 
  38. $defpros = array( 
  39. "default" => array( 
  40. "desc" => __('This is the default profile, used when no profile is specified.', 'google-document-embedder'),  
  41. "viewer" => 'standard',  
  42. "default_width" => '100%',  
  43. "default_height" => '500px',  
  44. "tb_mobile" => 'default',  
  45. "tb_flags" => '',  
  46. "tb_fullscr" => 'default',  
  47. "tb_fullwin" => 'new',  
  48. "tb_fulluser" => 'no',  
  49. "tb_print" => 'no',  
  50. "vw_bgcolor" => '#EBEBEB',  
  51. "vw_pbcolor" => '#DADADA',  
  52. "vw_css" => '',  
  53. "vw_flags" => '',  
  54. "language" => $env['default_lang'],  
  55. "base_url" => $env['baseurl'],  
  56. "link_show" => 'all',  
  57. "link_mask" => 'no',  
  58. "link_block" => 'no',  
  59. "link_text" => __('Download', 'google-document-embedder') . ' (%TYPE, %SIZE)',  
  60. "link_pos" => 'below',  
  61. "link_force" => 'no',  
  62. "cache" => 'on' 
  63. ),  
  64. "max-doc-security" => array( 
  65. "desc" => __('Hide document location and text selection, prevent downloads', 'google-document-embedder'),  
  66. "viewer" => 'enhanced',  
  67. "default_width" => '100%',  
  68. "default_height" => '500px',  
  69. "tb_mobile" => 'default',  
  70. "tb_flags" => '',  
  71. "tb_fullscr" => 'viewer',  
  72. "tb_fullwin" => 'new',  
  73. "tb_fulluser" => 'no',  
  74. "tb_print" => 'no',  
  75. "vw_bgcolor" => '#EBEBEB',  
  76. "vw_pbcolor" => '#DADADA',  
  77. "vw_css" => '',  
  78. "vw_flags" => '',  
  79. "language" => $env['default_lang'],  
  80. "base_url" => $env['baseurl'],  
  81. "link_show" => 'none',  
  82. "link_mask" => 'no',  
  83. "link_block" => 'yes',  
  84. "link_text" => '',  
  85. "link_pos" => 'below',  
  86. "link_force" => 'no',  
  87. "cache" => 'on' 
  88. ),  
  89. "dark" => array( 
  90. "desc" => __('Dark-colored theme, example of custom CSS option', 'google-document-embedder'),  
  91. "viewer" => 'enhanced',  
  92. "default_width" => '100%',  
  93. "default_height" => '500px',  
  94. "tb_mobile" => 'default',  
  95. "tb_flags" => '',  
  96. "tb_fullscr" => 'viewer',  
  97. "tb_fullwin" => 'new',  
  98. "tb_fulluser" => 'no',  
  99. "tb_print" => 'no',  
  100. "vw_bgcolor" => '',  
  101. "vw_pbcolor" => '',  
  102. "vw_css" => GDE_PLUGIN_URL . 'css/gde-dark.css',  
  103. "vw_flags" => '',  
  104. "language" => $env['default_lang'],  
  105. "base_url" => $env['baseurl'],  
  106. "link_show" => 'all',  
  107. "link_mask" => 'no',  
  108. "link_block" => 'no',  
  109. "link_text" => __('Download', 'google-document-embedder') . ' (%TYPE, %SIZE)',  
  110. "link_pos" => 'below',  
  111. "link_force" => 'no',  
  112. "cache" => 'on' 
  113. ); 
  114.  
  115. switch ( $type ) { 
  116. case "globals": 
  117. return $globalopts; 
  118. break; 
  119. case "options": 
  120. return $defopts; 
  121. break; 
  122. case "profiles": 
  123. return $defpros; 
  124. break; 
  125. default: 
  126. gde_dx_log('Defaults requested but type not specified'); 
  127. return false; 
  128. break;