Esempio n. 1
0
function mediabox_config($public = null) {
	include_spip("inc/filtres");
	include_spip("inc/config");
	$config = lire_config('mediabox', array());

	$config = array_merge(array(
		'active' => 'oui',
		'traiter_toutes_images' => 'oui',
		'selecteur_galerie' => '#documents_portfolio a[type=\'image/jpeg\'],#documents_portfolio a[type=\'image/png\'],#documents_portfolio a[type=\'image/gif\']',
		'selecteur_commun' => '.mediabox',
		'splash_url' => '',
		'splash_width' => '600px',
		'splash_height' => '90%',
		'skin' => 'black-striped',
		'transition' => 'elastic',
		'speed' => '200',
		'maxWidth' => '90%',
		'maxHeight' => '90%',
		'minWidth' => '400px',
		'minHeight' => '',
		'slideshow_speed' => '2500',
		'opacite' => '0.9',
	), $config);

	if ((is_null($public) and test_espace_prive()) or $public === false) {
		$config = array_merge($config, array(
			'active' => 'oui',
			'selecteur_galerie' => '#portfolios a[type^=\'image/\']',
			'selecteur_commun' => '.mediabox, .iconifier a[href$=jpg],.iconifier a[href$=png],.iconifier a[href$=gif]',
			'splash_url' => '',
			'skin' => 'white-shadow',
			'maxWidth' => '90%',
			'maxHeight' => '95%',
			'minWidth' => '600px',
			'minHeight' => '300px',
			'opacite' => '0.9',
		));
	}

	// Gerer aussi les liens internes de SPIP
	if (!test_espace_prive() and $config['splash_url']) {
		include_spip("inc/filtres_ecrire");
		$config['splash_url'] = url_absolue(extraire_attribut(lien_article_virtuel($config['splash_url']), 'href'));
	}

	// charger la config du theme uniquement dans le public
	if (!test_espace_prive() and include_spip("colorbox/" . $config['skin'] . "/mediabox_config_theme")) {
		$config_theme = mediabox_config_theme();
		$config = array_merge($config, $config_theme);
	}

	return $config;
}
Esempio n. 2
0
function mediabox_config($public = null)
{
    include_spip("inc/filtres");
    $config = @unserialize($GLOBALS['meta']['mediabox']);
    if (!is_array($config)) {
        $config = array();
    }
    $config = array_merge(array('active' => 'oui', 'traiter_toutes_images' => 'oui', 'selecteur_galerie' => '#documents_portfolio a[type=\'image/jpeg\'],#documents_portfolio a[type=\'image/png\'],#documents_portfolio a[type=\'image/gif\']', 'selecteur_commun' => '.mediabox', 'splash_url' => '', 'skin' => 'black-striped', 'transition' => 'elastic', 'speed' => '200', 'maxWidth' => '90%', 'maxHeight' => '90%', 'minWidth' => '400px', 'minHeight' => '', 'slideshow_speed' => '2500', 'opacite' => '0.9'), $config);
    if (is_null($public) and test_espace_prive() or $public === false) {
        $config = array_merge($config, array('active' => 'oui', 'selecteur_galerie' => '#portfolios a[type^=\'image/\']', 'selecteur_commun' => '.mediabox, .iconifier a[href$=jpg],.iconifier a[href$=png],.iconifier a[href$=gif]', 'splash_url' => '', 'skin' => 'white-shadow', 'maxWidth' => '90%', 'maxHeight' => '95%', 'minWidth' => '600px', 'minHeight' => '300px', 'opacite' => '0.9'));
    }
    // charger la config du theme uniquement dans le public
    if (!test_espace_prive() and include_spip("colorbox/" . $config['skin'] . "/mediabox_config_theme")) {
        $config_theme = mediabox_config_theme();
        $config = array_merge($config, $config_theme);
    }
    return $config;
}