diff --git a/2017/includes/class-Header.php b/2017/includes/class-Header.php index 0dcc218..f83cc1d 100644 --- a/2017/includes/class-Header.php +++ b/2017/includes/class-Header.php @@ -1,172 +1,187 @@ . class Header { static function spawn($menu_uid = null, $args = [] ) { $menu = menu_entry($menu_uid); $args = array_replace( [ 'show-title' => true, 'nav' => true, 'nav-title' => SITE_NAME_SHORT, 'head-title' => null, 'title' => $menu->name, 'url' => $menu->url, 'not-found' => false, 'user-navbar' => true, 'container' => true, 'alert' => null, 'alert.type' => null, 'noindex' => NOINDEX ], $args ); + // adjust the URL for our convenience + if( $args['url'] ) { + + // force an absolute URL + $args['url'] = site_page( $args['url'], true ); + + // force to that language (TODO) + // $args['url'] = keep_url_in_language( $args['url'] ); + } + + // eventually force to this correct permalik + if( $args['url'] && FORCE_PERMALINK ) { + force_permalink( $args['url'] ); + } + if( ! isset( $args['og'] ) ) { $args['og'] = []; } $args['og'] = array_replace( [ 'image' => STATIC_URL . '/ld-2017-logo-470.png', // It's better an absolute URL here 'type' => 'website', 'url' => $args['url'], 'title' => $args['title'] ], $args['og'] ); if( $args['head-title'] === null ) { $args['head-title'] = sprintf( __("%s - %s"), $args['title'], $args['nav-title'] ); } header('Content-Type: text/html; charset=' . CHARSET); if( $args['not-found'] ) { header('HTTP/1.1 404 Not Found'); } enqueue_css('materialize'); enqueue_css('materialize.custom'); enqueue_css('materialize.icons'); enqueue_js('jquery'); enqueue_js('materialize'); // Close header - Start $args['container'] && inject_in_module('footer', function() { ?> getISO(); } else { $l = 'it'; } ?> <?php echo $args['head-title'] ?> $value): ?>

. require 'load.php'; $conference = FullConference::factoryFromUID( CURRENT_CONFERENCE_UID ) ->queryRow(); $conference or die_with_404(); -FORCE_PERMALINK - and $conference->forceConferencePermalink(); - enqueue_js('leaflet'); enqueue_js('leaflet.init'); enqueue_js('scrollfire'); enqueue_js('typed'); enqueue_css('leaflet'); enqueue_css('home'); Header::spawn('conference', [ 'nav' => false, 'show-title' => false, 'head-title' => $s = $conference->getConferenceTitle(), 'title' => $s, 'url' => $conference->getConferenceURL(), 'container' => false ] ); ?>

Torino") ?>

', '' ) ?>

%d relatori, distribuiti su %d sessioni tematiche."), 16, 4 ) ); ?>
28 ottobre 2017 dalle 14:00 alle 19:00.") ); $fuffa_box( __("Extras"), 'extension', _("Linux Install Party, Restart Party, CoderDojo, Open Source Saturday") ); ?>

;
;

printLocationLeaflet() ?>

false] );