/**
 * Define system defaults (settings/profiles)
 *
 * @since	2.5.5.1
 * @return  mixed
 */
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;
    }
}
Beispiel #2
0
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * @package    google-document-embedder
 * @author     Kevin Davis <*****@*****.**>
 * @copyright  Copyright 2014 Kevin Davis
 * @license    http://www.gnu.org/licenses/gpl.txt GPL 2.0
 * @link       https://wordpress.org/plugins/google-document-embedder/
 */
// boring init junk
$gde_ver = "2.6";
$gde_db_ver = "1.2";
// update also in gde_activate()
require_once plugin_dir_path(__FILE__) . 'functions.php';
global $wp_version;
$pdata = gde_get_plugin_data();
$gdeoptions = get_option('gde_options');
$gdetypes = gde_supported_types();
// check for db health
$healthy = gde_debug_tables();
// add admin functions only if needed
if (is_admin()) {
    require_once GDE_PLUGIN_DIR . 'functions-admin.php';
}
// get global settings - not implemented in this release
/*
if ( is_multisite() ) {
	$gdeglobals			= get_site_option( 'gde_globals' );
}
*/
// activate plugin, allow clear dx log on deactivate