gde_defaults
Define system defaults (settings/profiles).
Description
gde_defaults( $type );
Parameters (1)
- 0. $type
- The type.
Usage
if ( !function_exists( 'gde_defaults' ) ) { require_once '/libs/lib-setup.php'; } // The type. $type = null; // NOTICE! Understand what this does before running. $result = gde_defaults($type);
Defined (1)
The function is defined in the following location(s).
- /libs/lib-setup.php
- function gde_defaults( $type ) {
- global $env;
- // gather/set environment info
- if ( ! $env ) {
- $pdata = gde_get_plugin_data();
- $baseurl = gde_base_url();
- $default_lang = gde_get_locale();
- $apikey = '';
- $env = array(
- 'pdata' => $pdata,
- 'baseurl' => $baseurl,
- 'default_lang' => $default_lang
- );
- }
- // define "global" options (multisite only)
- $globalopts = array(
- 'file_maxsize' => '12',
- 'beta_check' => 'no'
- );
- // define default options
- $defopts = array(
- 'ed_disable' => 'no',
- 'ed_extend_upload' => 'yes',
- 'ed_embed_sc' => 'yes',
- 'file_maxsize' => '12',
- 'error_check' => 'yes',
- 'error_display' => 'yes',
- 'error_log' => 'no',
- 'beta_check' => 'no',
- 'ga_enable' => 'no',
- 'ga_category' => $env['pdata']['Name'],
- 'ga_label' => 'url'
- );
- // define default profile(s)
- $defpros = array(
- "default" => array(
- "desc" => __('This is the default profile, used when no profile is specified.', 'google-document-embedder'),
- "viewer" => 'standard',
- "default_width" => '100%',
- "default_height" => '500px',
- "tb_mobile" => 'default',
- "tb_flags" => '',
- "tb_fullscr" => 'default',
- "tb_fullwin" => 'new',
- "tb_fulluser" => 'no',
- "tb_print" => 'no',
- "vw_bgcolor" => '#EBEBEB',
- "vw_pbcolor" => '#DADADA',
- "vw_css" => '',
- "vw_flags" => '',
- "language" => $env['default_lang'],
- "base_url" => $env['baseurl'],
- "link_show" => 'all',
- "link_mask" => 'no',
- "link_block" => 'no',
- "link_text" => __('Download', 'google-document-embedder') . ' (%TYPE, %SIZE)',
- "link_pos" => 'below',
- "link_force" => 'no',
- "cache" => 'on'
- ),
- "max-doc-security" => array(
- "desc" => __('Hide document location and text selection, prevent downloads', 'google-document-embedder'),
- "viewer" => 'enhanced',
- "default_width" => '100%',
- "default_height" => '500px',
- "tb_mobile" => 'default',
- "tb_flags" => '',
- "tb_fullscr" => 'viewer',
- "tb_fullwin" => 'new',
- "tb_fulluser" => 'no',
- "tb_print" => 'no',
- "vw_bgcolor" => '#EBEBEB',
- "vw_pbcolor" => '#DADADA',
- "vw_css" => '',
- "vw_flags" => '',
- "language" => $env['default_lang'],
- "base_url" => $env['baseurl'],
- "link_show" => 'none',
- "link_mask" => 'no',
- "link_block" => 'yes',
- "link_text" => '',
- "link_pos" => 'below',
- "link_force" => 'no',
- "cache" => 'on'
- ),
- "dark" => array(
- "desc" => __('Dark-colored theme, example of custom CSS option', 'google-document-embedder'),
- "viewer" => 'enhanced',
- "default_width" => '100%',
- "default_height" => '500px',
- "tb_mobile" => 'default',
- "tb_flags" => '',
- "tb_fullscr" => 'viewer',
- "tb_fullwin" => 'new',
- "tb_fulluser" => 'no',
- "tb_print" => 'no',
- "vw_bgcolor" => '',
- "vw_pbcolor" => '',
- "vw_css" => GDE_PLUGIN_URL . 'css/gde-dark.css',
- "vw_flags" => '',
- "language" => $env['default_lang'],
- "base_url" => $env['baseurl'],
- "link_show" => 'all',
- "link_mask" => 'no',
- "link_block" => 'no',
- "link_text" => __('Download', 'google-document-embedder') . ' (%TYPE, %SIZE)',
- "link_pos" => 'below',
- "link_force" => 'no',
- "cache" => 'on'
- )
- );
- switch ( $type ) {
- case "globals":
- return $globalopts;
- break;
- case "options":
- return $defopts;
- break;
- case "profiles":
- return $defpros;
- break;
- default:
- gde_dx_log('Defaults requested but type not specified');
- return false;
- break;
- }
- }