diff --git a/page-schedule.php b/page-schedule.php index de41268..99625a8 100644 --- a/page-schedule.php +++ b/page-schedule.php @@ -5,6 +5,17 @@ wp_nav_menu( array( 'theme_location' => 'footer-schedule', 'container_class' => $lang = pll_current_language('slug'); + +/* TODO make this read the ids from the proper place, as this breaks other years*/ +if ( preg_match('/^workshop/', $pagename) ) { + $workshop = true; + $allowedhallids = array(9); +} else { + $workshop = false; + $allowedhallids = array(6,7,8); +} + + /* * There is no better way to get where the speakers are */ diff --git a/page-speakers.php b/page-speakers.php index 50ff941..ec47910 100644 --- a/page-speakers.php +++ b/page-speakers.php @@ -3,6 +3,8 @@ get_header(); wp_nav_menu( array( 'theme_location' => 'footer-schedule', 'container_class' => 'content subnav cf' ) ); +$allowedhallids = array(6,7,8,9); + $content = require __DIR__ . DIRECTORY_SEPARATOR . 'schedule' . DIRECTORY_SEPARATOR . 'parse.php'; //var_dump($data); ?> diff --git a/schedule/load.php b/schedule/load.php index fc9c8af..c90b7a2 100644 --- a/schedule/load.php +++ b/schedule/load.php @@ -12,6 +12,10 @@ $filenames = [ 'slots' => 'slots.json', ]; + +if (empty($allowedhallids)) { + $allowedhallids = array (6,7,8); +} $data = []; foreach ($filenames as $name => $filename) { @@ -31,12 +35,13 @@ foreach ($filenames as $name => $filename) { } $add = true; - switch ($name) { case 'halls': - $decoded = array_map(function($el) { - return $el['name']; - }, $decoded); + $ret = array(); + foreach($decoded as $id => $hall) { + if (in_array($id, $allowedhallids)) $ret[$id] = $hall['name']; + } + $decoded = $ret; break; case 'slots': $decoded = array_map(function($el) { @@ -63,6 +68,6 @@ uasort($data['slots'], function($a, $b) { return compareKeys($a, $b, 'starts_at') ?: compareKeys($a, $b, 'hall_id'); }); -array_pop($data['halls']); +//array_pop($data['halls']); return $data;