RUNNING IN DRY RUN with LAB LIMIT SET TO 

 0 = No Restrictions		/deck-ansible/
 1 = Only Labs			/deck-ansible/?labs/
 2 = No Labs, only deck		/deck-ansible/?nolabs/

######################################################
	 $htmldir){
	$pretty_htmldir = preg_replace("/^.*\/html_slides/","",$htmldir);
	$pretty_htmldir = preg_replace("/^.*\//","",$pretty_htmldir);
	$pretty_htmldir = preg_replace("/^[0-9]+_+/","",$pretty_htmldir);
	$pretty_htmldir = preg_replace("/^[0-9]+_+/","",$pretty_htmldir);
	$pretty_htmldir = preg_replace("/_+/"," ",$pretty_htmldir);

	$html_files = explode("\n",shell_exec("find $htmldir -maxdepth 1 -type f -iname \"*html\" | sort"));
	$html_files = array_filter($html_files);

	if (($pretty_htmldir) and (count($html_files))){
		if ($dry_run) print "\n#$key \"$pretty_htmldir\" contains " . count($html_files) . " slides\n\n";
		$labid = "LABS-" . preg_replace("/[^0-9a-zA-Z]+/","", $pretty_htmldir);

		foreach( $html_files as $key => $htmlinc){
			if (($dry_run) and ($lab_limit != 1)) print "INCLUDE $htmlinc\n";
			$localdir = str_replace($html_dir . '/',"",$htmlinc);
			$localfile = preg_replace("/^.*\//","",$htmlinc);

			if ((! $dry_run) and ($lab_limit != 1 )) {
				if ( (file_exists($htmlinc)) and (!preg_match("/^_/",$localdir)) and (!preg_match("/^_/",$localfile)) ) include($htmlinc);
			}

		}

		if ($lab_limit != 2){
			$lab_files = explode("\n",shell_exec("find $htmldir/labs -maxdepth 1 -type f -iname \"*html\" | sort"));
			$lab_files = array_filter($lab_files);

			if (count($lab_files)){
				if ($dry_run){
					print "\nSTART-LAB-INCLUDE for \"$pretty_htmldir\"\n\n";
				}else{
					?>
	

LABS:

Click down arrow to continune into the labs

$labinc){ if ($dry_run){ print "INCLUDE-LABS $labinc\n"; }else{ $labdir = str_replace($html_dir . '/',"",$labinc); $labfile = preg_replace("/^.*\//","",$labinc); if ( (file_exists($labinc)) and (!preg_match("/^_/",$labdir)) and (!preg_match("/^_/",$labfile)) ) include($labinc); // print " $labinc\n"; } } if ($dry_run){ print "\nEND-LAB-INCLUDE for \"$pretty_htmldir\"\n"; }else{ ?>

LABS:
Complete!

Click right to continune

\n"; if (! $dry_run) require_once("page_final.html"); ?>