LP6 Style Guide: Core Settings page Template = lp6-docs

Overview

Core Settings refers to our standard, global, system-level functions, variables, and more.

Server Specifics

Server Specifics refers to the initial set up required to run LP5/LP6 on a web server. This set up is done in _serverSpecifics.php. Note this file is Git-ignored to prevent conflicts in the repository. Use _serverSpecifics-template.php for initial setup.

  • $localPathMask

    This is the file path up to http root.

  • $mySite

    This is the default site name used in banners, etc...

  • $myDomainString

    This is needed for some forms and redirects.

  • $oneTrust

    This is the path to specific OneTust cookie management script unique to each domain. Soon to be deprecated.

  • returnDomain($brand)

    This sets the $GLOBALS["myDomain"] value to the current branded subdomain.

Functions

PHP Variables Back to Top

Below are all the PHP vars declared in the /core/_functions.php file.

  • $GLOBALS["myTitle"]

    Page Title

  • $GLOBALS["academicArea"]

    Academic Area options = art, bus, edu, hs, sgs, stem

  • $GLOBALS["description"]

    Unique page description under 160 characters, use %shortName% or %longName% for university name, leave blank for generic info

  • $GLOBALS["myScripts"]

    Determines what script-common file loads.

  • $GLOBALS["accreditedTitle"]

    Optional override for accredited heading

  • $GLOBALS["affordTitle"]

    Optional override for affordability heading

  • $GLOBALS["tuitAssistTitle"]

    Optional override for tuition assistance heading

  • $GLOBALS["nextStepsTitle"]

    Optional override for next steps heading

  • $GLOBALS["attributesTitle"]

    Optional override for attributes heading

  • $GLOBALS["optimize"]

    Optional optimize anti-flicker timing in ms

  • $longName

    Default full name of the University.

  • $shortName

    Default acronymn of the University.

  • $degreeType

    Set to $GLOBALS["mySite"] value. The default value comes from _serverSpecifics.php.

  • $defaultBanner

    Set to "online-degrees." The default value for banners, can be overridden by $myBanner.

  • Program Matrix

    $json_a

    Temp variable to load exported programs array in JSON format which is located at /core/_includes/programs.json.

    $matrix

    Variable to store the above $json_a array decoded as actual JSON data.

    $GLOBALS["matrix"]

    The GLOBAL Matrix variable containing the JSON array data for use in various site functionality.

  • Program Finder

    $GLOBALS["finder"]

    Stores the default Finder section title.

    $GLOBALS["finderIntro"]

    Stores the default Finder section introduction text.

  • $defaultTemplate

    Current default page template.

  • $templateName

    Active template. Defaulted to defaultTemplate above.

  • $templateCat

    Template category: 1=default, 2=override, 3=missing. Default value is 1.

  • $templatePath

    Relative path to template folder: _templates.

  • $suffix

    Standard filetype for includes. Defaulted to .php.

  • $thisYear

    Current year (Y).

  • $todaysDate

    Current date ('Y-m-d'): Date compare functions use actual day-of-the-year number.

  • $nextYear

    = (int) $GLOBALS["thisYear"] + 1. Used for date compare functions.

  • $myTitle

    Defaults to "untitled." Otherise set in core/page.

  • $GLOBALS["commonContent"]

    Relative path to common content folder: ../../common/. Used for some relative links to common assets.

  • $coreContentDir

    Globalize variable as $GLOBALS["coreContentDir"]. This is the loocation of core files.

  • $localPathLen

    Character length of $localPathMask: strlen($localPathMask).

  • $debug

    Debug Mode: True (1) or False (0). Currently defaulted to True. Eventually this mode will be used in conjunction with LP6 css minification. False being minified. True loading assets individually for easy debugging.

  • Keywords

    $allKeywords

    Base keywords: loads core/_includes/kw-all.txt.

    $keySortOrder

    Leave blank for default = alphabetically; page = list page keywords first; site = list site keywords first.

  • $conversionQS

    Default value: cv=1. This is the conversion URI fragment for the Analytics team to measure an RFI conversion.

  • $vcContact

    Public Safety Visor Cards contact information. Array values: "name" => "our Public Safety Outreach team", "email" => "publicsafety@apus.edu".

  • Application

    $applyNowText

    Regular application link text: Apply Now.

    $applyNowURLPart1

    Unbranded application URL part: https://online-campus.apus.edu/Home/index/.

  • Doctoral Application

    $applyNowTextAd

    Default Doctoral application text: Apply Now.

    $applyNowURLAdPart1

    Unbranded Doctoral application URL part: https://online-campus.apus.edu/doctorate/home/index/.

Check Templates Back to Top

checkTemplates($myTemplate) is a php function for determining the active page template. The function scans the templates directory and creates an array of all existing templates. It then checks to make sure the active, override template exists, and if so uses it as the page template. Otherwise the default template is used in two cases:

  • if no override template is specified
  • if the override template is not found.

Include Template Section Back to Top

incTemplateSection($thisSection) is a php function that finds template sections or parts in the active template directory and includes them in the page.

Include CSS Back to Top

incCSS($thisCSSName) is a php function that would toggle between the debug/unminified css and the live/minified css. It's currently not actively used in LP5 and will be deprecated for LP6.

Brand Functions Back to Top

setBrand

setBrand($a) is a php function used to get the brand from the server file path. This particular function is deprecated for CCL pages.

returnBrand($a, $b)

The returnBrand($a, $b) function uses a switch statement to match brand cases; a variety of other global variables are then given brand-specific values. The function can also be referenced to specifically echo the longName or shortName.

  • $GLOBALS["longName"]

    The full name of the university.

  • $GLOBALS["shortName"]

    The university acronym.

  • $GLOBALS["tagLine"]

    The university tagline.

  • $GLOBALS["tel"]

    The university phone number (alphanumeric).

  • $GLOBALS["telDigit"]

    The university phone number (numeric only).

Doctoral Overrides Back to Top

If the degreeCode indicates a doctoral degree, other custom variable values are set.

  • $GLOBALS["applyNowURL"]

    Custom doctoral application URL.

  • $GLOBALS["applyNowText"] / $GLOBALS["applyNowTextAd"]

    Custom doctoral application text.

  • $GLOBALS["tel"]

    Custom doctoral phone number (alphanumeric).

  • $GLOBALS["telDigit"]

    Custom doctoral phone number (numeric only).

Include Match Content Back to Top

incMatchContent($a,$d)

This is a php function that was deprecated after CCL implementation but may still be used in legacy pages. It matched the subdomain directory and page to core content directory and page.

Show Path Back to Top

showPath($whichFile)

This is a debug php function that prints the full file path in an HTML comment.

showIncPath($whichFile)

This is a debug php function that prints the full file path in an HTML comment.

Keyword Function Back to Top

insertKeywords()

This php function inserts keywords metadata into pages.

  • $kwAll

    Default, global keywords across the site.

  • $kwBrand

    The full branded name of the university as a keyword.

  • $kwSchool

    The program's school is used to load a set of school-related keywords. Matches against $GLOBALS["academicArea"] to include proper text file. Ignored if null.

  • $kwProgram

    Page-level custom keywords using $GLOBALS["myKeywords"] value.

  • $GLOBALS["keySortOrder"]

    Orders keywords using a switch statement: page, site, null. Page value lists page keywords first, site lists site keywords first, default or null value is alphabetical sorting.

  • $GLOBALS["allKeywords"]

    Full listing of a page's keywords.

Degree Type Back to Top

setDegreeDefault($whichType)

This php function determines the default label/name of a degree (e.g., Associate of Applied Science).

Momentum

If the program is momentum (deprecated?) we set a special Momentum™ prefix to the degree type. Otherwise all programs' have a standard "online" prefix.

A switch statement is used to determine the default program type. It matches the value of $GLOBALS["degreeType"] against the cases. The expected format is the degree level/type acronymn. For example: gc, ba, ms, etc.

setDegreeType($a)

This php function determines the degree type by looking up the $GLOBALS["degreeType"] and passes the value to the setDegreeDefault($whichType) (see above) to generate the default label.

Deadline Functions Back to Top

returnDeadlineMessage()

This php function returns an application and/or classes start deadline message. Doctoral programs have special messaging that is determined by their degree code, $GLOBALS["degreeCode"].

returnDeadline()

This php function returns an application and/or classes start date. Doctoral programs have special messaging that is determined by their degree code, $GLOBALS["degreeCode"].

Form Functions Back to Top

  • $GLOBALS["arr_fields"]

    An array of form field IDs with sub-array data(label[0], placeholder[1], type[2], maxlength[3], required[4], embeddedArray[5], chooseOption[6], otherOption[7], shuffle[8]). I think this is deprecated. George to confirm.

  • $GLOBALS["reqMark"]

    Variable denoting a required field marker. Currently this is an asterisk. Deprecated since LP6 fields are required by default. Conversely, optional fields are noted as such.

  • $GLOBALS["templatePre"]

    Templated form field label and opening span.

    						
    							<label for="%name%"> %label% %reqMark% </label><span class="mktInput">
    						
    					
  • $GLOBALS["templatePost"]

    Templated form field contextual messaging and closing span.

    						
    							<span class="mktFormMsg"></span></span>
    						
    					
  • $GLOBALS["templateInput"]

    Templated form field text input.

    						
    							<input class="mktFormText mktFormString" name="%name%" placeholder="%placeholder%" id="%name%" type="%type%" value="" maxlength="%maxlength%" %tabIndex% %required%>
    						
    					
  • $GLOBALS["templateNumber"]

    Templated form field number input.

    						
    							<input class="mktFormText mktFormString" name="%name%" placeholder="%placeholder%" id="%name%" type="%type%" value="" min="1" maxlength="%maxlength%" %tabIndex% %required%>
    						
    					
  • $GLOBALS["templateTextArea"]

    Templated form field textarea.

    						
    							<textarea class="mktFormTextarea mktFormTextarea" name="%name%" placeholder="%placeholder%" id="%name%" rows="3" %tabIndex% %required%></textarea>
    						
    					
  • $GLOBALS["templateSelectPre"]

    Templated form field select.

    						
    							<select class="mktFormSelect" name="%name%" id="%name%" size="1" placeholder="%placeholder%" %tabIndex% %required%>';
    						
    					
  • $GLOBALS["templateSelectPost"]

    Templated form field select closing tag.

    						
    							'</select>
    						
    					
  • function createField($name, $tabIndexValue = NULL)

    This function creates a form field input based on the supplied name. It looks up the name in the $GLOBALS["arr_fields"] array and constructs the HTML based on the type[2].

    The LP5 Marketo "prewrap" structure ($GLOBALS["templatePre"]) is then generated along with the $fieldType template determined via a switch statement.

    All the temporary strings in the template are then repalced with the matching data in $GLOBALS["arr_fields"].

    						
    							$formStuff = str_replace("%name%", $name, $formStuff);
    							$formStuff = str_replace("%label%", $GLOBALS["arr_fields"][$name][0], $formStuff);
    							$formStuff = str_replace("%placeholder%", $GLOBALS["arr_fields"][$name][1], $formStuff);
    							$formStuff = str_replace("%type%", $GLOBALS["arr_fields"][$name][2], $formStuff);
    							$formStuff = str_replace("%maxlength%", $GLOBALS["arr_fields"][$name][3], $formStuff);
    						
    					
    • $tabIndexValue

      tabIndex is generated if a value is supplied.

    • Required Field

      If it's a required field, mark and required attribute are generated.

    • Select Menu Format

      If it's a select menu, use the correct format. If chooseOption[6] selected, add "Please choose" prompt. Choose list of items from /core/_includes/form-select_arrays.php. If program of interest, use special format else use standard menu format. If otherOption[7] selected add "Other" option to menu. Append the select field & messaging postwrap to the updated template

  • listOptions($a)

    This php function outputs a select menu's options for each key in the supplied array.

  • incMSForm($msForm,$defaultForm = NULL)

    This function is for the deprecated multi-step form.

  • insertThanksPage($conversionOption = NULL)

    This function inserts the response page for Marketo forms with option to suppress conversion tracking value. It can also append additional utm tracking info if desired.

Blog UTM Tracking Back to Top

$GLOBALS["blogListArray"]

This php variable stores an array of information about our blogs: blogLongName[0], blogURL[1], blogImg[2], blogDescription[3], blogPublishSchedule[4].

listBlog($a)

This php function outputs a templated link to the specified blog with UTM tracking.

				
	<a href="%blogURL%%googleTrackingQS1%" target="_blank">
	<img src="%blogImg%" alt="%blogLongName%" title="%blogLongName%"></a>
	<p>%blogDescription% <a href="%blogURL%%blogSubpath%%googleTrackingQS2%" target="_blank">Subscribe.</a><br>
	<em>%blogPublishSchedule%</em></p>
				
			

RFI Button Function Back to Top

rfiButton($a = "", $myID = "")

This php function generates an RFI Overlay button on any page. You can optionally (in LP6 you must) supply a class name as a paramter and/or another identifier to create a unique ID for each button: rfiButton("button-primary","button-in-hero"). The function then reads the current page URL and breaks that URL into parts in order to determine the current degree folder and degree-level page names. Those values are then fed into switch statements to determine the plain language names of the degree's name and level. This outputs a button-styled hyperlink with the degree data inserted into data attributes (see below).

				
	<a id="lp5_rfi_overlay"
		class="rfi-overlay-button button ' . $a . '"
		title="Request Information"
		data-level="' . $levelSelect . '"
		data-program="' . $rfiSelect . '"
		href="#rfi-off-canvas">
		Request Information
	</a>
				
			

form-onclickSelect.php

This file in /core/_includes/ contains the javascript assets that control the above button to preselect the degree data select dropdowns in the RFI Overlay.

JS Snippet

				
	$("#my_Program_of_Interest").chained("#my_Degree_Level");
var links = $("a.rfi-overlay-button"); //search container so all links aren't scanned

	for (var i = 0; i < links.length ; i++) {
	//Event Listener for Flex anchors
	links[i].addEventListener("click",
	  function () {
			//set dropdown options to anchor data values
			var level = $(this).data("level");
			var program = $(this).data("program");
			var desc = $(this).data("desc");

				$("#my_Degree_Level").val(level).change(); //trigger degree select change
				$("#my_Program_of_Interest").val(program).change(); //trigger program select change
	  },
	false);
				
			

Testimonial Functions Back to Top

See Testimonials page for details on usage and data management.

listTestimonials($pageTestimonial)

This php function creates an unordered flex list of the desired Testimonials in alphanetical order.

				
function listTestimonials($pageTestimonial) {
  //count commas for formatting
  $myCommas = substr_count($pageTestimonial, ",");
  if($myCommas === 3) {
    $cols = "four-1300";
  }
  elseif($myCommas === 4) {
    $cols = "four-1300 five-1600";
  }
  elseif($myCommas === 5) {
    $cols = "four-1300 five-1600 six-1900";
  }
  echo $cols;

  //create unordered list
  echo '<ul class="testimonials flex one two-500 three-1000 ' . $cols . ' center">';
  foreach ($GLOBALS["matrix-tms"]["testimonials"] as $testimonial) {
    if(strpos($pageTestimonial, $testimonial["name"]) !== false){
      echo '<li>';

      if(!empty($testimonial["image"])){
        echo '<img src="/common/images/students/' . $testimonial["image"] . '" alt="' . $testimonial["name"] . '">';
      }
			// replace variables %longName% & %shortName% with appropriate values for brand agnostic quotes
			$myQuote = str_replace("%longName%", $GLOBALS["longName"], $testimonial["quote".$quote]);
			$myQuote = str_replace("%shortName%", $GLOBALS["shortName"], $myQuote);

      echo '<blockquote>
    		<p>' . $myQuote . '</p>
    		<cite><h3>'. $testimonial["name"];

      if(!empty($testimonial["creds"])){
        echo ', ' . $testimonial["creds"];
      }

      echo '</h3>';
			if(!empty($testimonial["nondegreeTitles"])){
				echo '<span>' . $testimonial["nondegreeTitles"] . '</span>';
			}
			if(!empty($testimonial["degrees"])){
				echo '<span><a href="' . $testimonial["degreeURL"] . '">' . $testimonial["degrees"] . '</a></span>';
			}
			if(!empty($testimonial["degrees2"])){
				echo '<span><a href="' . $testimonial["degree2URL"] . '">' . $testimonial["degrees2"] . '</a></span>';
			}
			if(!empty($testimonial["degrees3"])){
				echo '<span><a href="' . $testimonial["degree3URL"] . '">' . $testimonial["degrees3"] . '</a></span>';
			}
    	echo '</cite></blockquote></li>';
    }
  }
  echo '</ul>';
}
				
			

getTestimonialPanel($pageTestimonial, $quote)

This php function creates a single blockquote of the desired Testimonial.

				
function getTestimonialPanel($pageTestimonial, $quote="") {

  foreach ($GLOBALS["matrix-tms"]["testimonials"] as $testimonial) {
    if(strpos($pageTestimonial, $testimonial["name"]) !== false){
      echo '<div class="testimonial-panel flex one two-700 center">';

      if(!empty($testimonial["imagePanel"])){
        echo '<div class="testimonial-image" style="background-image: url(/common/images/banners/' . $testimonial["imagePanel"] . '); background-size: cover; background-position: ' . $testimonial["imagePanelPos"] . ';"></div>';
      }

			// replace variables %longName% & %shortName% with appropriate values for brand agnostic quotes
			$myQuote = str_replace("%longName%", $GLOBALS["longName"], $testimonial["quote".$quote]);
			$myQuote = str_replace("%shortName%", $GLOBALS["shortName"], $myQuote);

      echo '<blockquote class="full two-third-700 half-900 third-1500 three-fifth-1800">
    		<p>' . $myQuote . '</p>
    		<cite><h3>'. $testimonial["name"];

        if(!empty($testimonial["creds"])){
          echo ', ' . $testimonial["creds"];
        }

        echo '</h3>';
				if(!empty($testimonial["nondegreeTitles"])){
    			echo '<span>' . $testimonial["nondegreeTitles"] . '</span>';
				}
				if(!empty($testimonial["degrees"])){
    			echo '<span><a href="' . $testimonial["degreeURL"] . '">' . $testimonial["degrees"] . '</a></span>';
				}
				if(!empty($testimonial["degrees2"])){
    			echo '<span><a href="' . $testimonial["degree2URL"] . '">' . $testimonial["degrees2"] . '</a></span>';
				}
				if(!empty($testimonial["degrees3"])){
    			echo '<span><a href="' . $testimonial["degree3URL"] . '">' . $testimonial["degrees3"] . '</a></span>';
				}
				echo '</cite>
    	</blockquote></div>';
    }
  }
}
				
			

getTestimonialVideo($pageTestimonial, $quote)

This php function creates a single video embed with blockquote of the desired Testimonial.

				
function getTestimonialVideo($pageTestimonial, $quote="") {
	foreach ($GLOBALS["matrix-tms"]["testimonials"] as $testimonial) {
    if(strpos($pageTestimonial, $testimonial["name"]) !== false) {
      echo '<div class="flex one three-900">';

      if(!empty($testimonial["video"])){
        echo '<div class="video-player two-third-900 video-player">
					<div class="embed">
						<iframe frameborder="0" allowfullscreen src="//www.youtube-nocookie.com/embed/' . $testimonial["video"] . '?controls=0&fs=1&rel=0&showinfo=0&theme=light&enablejsapi=1&wmode=transparent"></iframe>
					</div>
				</div>';
      }

      echo '<div class="video-content third-900"><blockquote>
    		<cite><h3>'. $testimonial["name"];

        if(!empty($testimonial["creds"])){
          echo ', ' . $testimonial["creds"];
        }

        echo '</h3>';
				if(!empty($testimonial["nondegreeTitles"])){
    			echo '<span>' . $testimonial["nondegreeTitles"] . '</span>';
				}
				if(!empty($testimonial["degrees"])){
    			echo '<span><a href="' . $testimonial["degreeURL"] . '">' . $testimonial["degrees"] . '</a></span>';
				}
				if(!empty($testimonial["degrees2"])){
    			echo '<span><a href="' . $testimonial["degree2URL"] . '">' . $testimonial["degrees2"] . '</a></span>';
				}
				if(!empty($testimonial["degrees3"])){
    			echo '<span><a href="' . $testimonial["degree3URL"] . '">' . $testimonial["degrees3"] . '</a></span>';
				}
				// replace variables %longName% & %shortName% with appropriate values for brand agnostic quotes
				$myQuote = str_replace("%longName%", $GLOBALS["longName"], $testimonial["quote".$quote]);
				$myQuote = str_replace("%shortName%", $GLOBALS["shortName"], $myQuote);

    		echo '</cite>
	    	<p>' . $myQuote . '</p>
    	</blockquote></div></div>';
    }
  }
}
				
			

getTestimonialCarousel($pageTestimonial, $quote)

This php function creates a list-item blockquote for use inside a carousel. This function requires the carousel container be created in HTML.

				
function getTestimonialCarousel($pageTestimonial, $quote="") {
	foreach ($GLOBALS["matrix-tms"]["testimonials"] as $testimonial) {
    if(strpos($pageTestimonial, $testimonial["name"]) !== false) {
			echo '<li class="flex one two-700">';

			if(!empty($testimonial["imagePanel"])){
        echo '<div class="testimonial-image" style="background-image: url(' . $testimonial["imagePanel"] . '); background-size: cover; background-position: ' . $testimonial["imagePanelPos"] . ';"></div>';
      }
			// replace variables %longName% & %shortName% with appropriate values for brand agnostic quotes
			$myQuote = str_replace("%longName%", $GLOBALS["longName"], $testimonial["quote".$quote]);
			$myQuote = str_replace("%shortName%", $GLOBALS["shortName"], $myQuote);

      echo '<blockquote>
    		<p>' . $myQuote . '</p>
    		<cite><h3>'. $testimonial["name"];

        if(!empty($testimonial["creds"])){
          echo ', ' . $testimonial["creds"];
        }

        echo '</h3>';
				if(!empty($testimonial["nondegreeTitles"])){
    			echo '<span>' . $testimonial["nondegreeTitles"] . '</span>';
				}
				if(!empty($testimonial["degrees"])){
    			echo '<span><a href="' . $testimonial["degreeURL"] . '">' . $testimonial["degrees"] . '</a></span>';
				}
				if(!empty($testimonial["degrees2"])){
    			echo '<span><a href="' . $testimonial["degree2URL"] . '">' . $testimonial["degrees2"] . '</a></span>';
				}
				if(!empty($testimonial["degrees3"])){
    			echo '<span><a href="' . $testimonial["degree3URL"] . '">' . $testimonial["degrees3"] . '</a></span>';
				}
				echo '</cite>
    	</blockquote></li>';
    }
  }
}
				
			

fullTestimonial($pageTestimonial, $quot)

This php function creates a single section blockquote testimonial.

				
function fullTestimonial($pageTestimonial, $quote="") {

  foreach ($GLOBALS["matrix-tms"]["testimonials"] as $testimonial) {
    if(strpos($pageTestimonial, $testimonial["name"]) !== false){
      echo '<section class="testimonial-panel creative"';
			if(!empty($testimonial["imageFull"])){
				echo ' style="background: linear-gradient(0deg,rgba(0,0,0,0.5),rgba(0,0,0,0.3)), url(' . $testimonial["imageFull"] . '); background-size: cover; background-position:' . $testimonial["imageFullPos"] . ';">';
			}
			// replace variables %longName% & %shortName% with appropriate values for brand agnostic quotes
			$myQuote = str_replace("%longName%", $GLOBALS["longName"], $testimonial["quote".$quote]);
			$myQuote = str_replace("%shortName%", $GLOBALS["shortName"], $myQuote);

      echo '<blockquote class="testimonial-overlay">
    		<p>&quot;' . $myQuote . '&quot;</p>
				<cite>'. $testimonial["name"];

        if(!empty($testimonial["creds"])){
          echo ', ' . $testimonial["creds"];
        }

				if(!empty($testimonial["nondegreeTitles"])){
        	echo ' | ';
    			echo $testimonial["nondegreeTitles"];
				}

				if(!empty($testimonial["degrees"])){
        	echo ' | ';
					echo '<a href="' . $testimonial["degreeURL"] . '">' . $testimonial["degrees"] . '</a>';
				}
				if(!empty($testimonial["degrees2"])){
					echo ', <a href="' . $testimonial["degree2URL"] . '">' . $testimonial["degrees2"] . '</a>';
				}
				if(!empty($testimonial["degrees3"])){
					echo ', <a href="' . $testimonial["degree3URL"] . '">' . $testimonial["degrees3"] . '</a>';
				}
				echo '</cite>
    	</blockquote></section>';
    }
  }
}
				
			

fullTestimonialCarousel($pageTestimonial, $quote)

This function creates a list-item blockquote for use inside a carousel. This function requires the carousel container be created in HTML.

				
function fullTestimonialCarousel($pageTestimonial, $quote="") {
	foreach ($GLOBALS["matrix-tms"]["testimonials"] as $testimonial) {
		if(strpos($pageTestimonial, $testimonial["name"]) !== false){
      echo '<li class="testimonial-panel creative"';
			if(!empty($testimonial["imageFull"])){
				echo ' style="background: linear-gradient(0deg,rgba(0,0,0,0.5),rgba(0,0,0,0.3)), url(' . $testimonial["imageFull"] . '); background-size: cover; background-position:' . $testimonial["imageFullPos"] . ';">';
			}

			// replace variables %longName% & %shortName% with appropriate values for brand agnostic quotes
			$myQuote = str_replace("%longName%", $GLOBALS["longName"], $testimonial["quote".$quote]);
			$myQuote = str_replace("%shortName%", $GLOBALS["shortName"], $myQuote);

      echo '<blockquote class="testimonial-overlay">
    		<p>&quot;' . $myQuote . '&quot;</p>
				<cite>'. $testimonial["name"];

        if(!empty($testimonial["creds"])){
          echo ', ' . $testimonial["creds"];
        }

				if(!empty($testimonial["nondegreeTitles"])){
        	echo ' | ';
    			echo $testimonial["nondegreeTitles"];
				}

				if(!empty($testimonial["degrees"])){
        	echo ' | ';
					echo '<a href="' . $testimonial["degreeURL"] . '">' . $testimonial["degrees"] . '</a>';
				}
				if(!empty($testimonial["degrees2"])){
					echo ', <a href="' . $testimonial["degree2URL"] . '">' . $testimonial["degrees2"] . '</a>';
				}
				if(!empty($testimonial["degrees3"])){
					echo ', <a href="' . $testimonial["degree3URL"] . '">' . $testimonial["degrees3"] . '</a>';
				}
				echo '</cite>
    	</blockquote></li>';
    }
  }
}
				
			

optimalTestimonial($pageTestimonial, $quote="")

This php function creates a single section blockquote testimonial. The layout has been optimized to avoid awkward text/image placement.

				
function optimalTestimonial($pageTestimonial, $quote="") {

  foreach ($GLOBALS["matrix-tms"]["testimonials"] as $testimonial) {
    if(strpos($pageTestimonial, $testimonial["name"]) !== false){
      echo '<section class="testimonial-panel creative optimized"';
			if(!empty($testimonial["imageOptimal"])){
				echo ' style="background: linear-gradient(0deg,rgba(0,0,0,0.5),rgba(0,0,0,0.3)), url(' . $testimonial["imageOptimal"] . '); background-size: cover; background-position:';
				if(!empty($testimonial["imageOptimalPos"])){
					echo $testimonial["imageOptimalPos"] . ';">';
				}
				else{
					echo '65% center;">'; //default positioning 10% off center
				}
			}
			// replace variables %longName% & %shortName% with appropriate values for brand agnostic quotes
			$myQuote = str_replace("%longName%", $GLOBALS["longName"], $testimonial["quote".$quote]);
			$myQuote = str_replace("%shortName%", $GLOBALS["shortName"], $myQuote);

      echo '<blockquote class="testimonial-overlay">
    		<p>&quot;' . $myQuote . '&quot;</p>
				<cite>'. $testimonial["name"];

        if(!empty($testimonial["creds"])){
          echo ', ' . $testimonial["creds"];
        }

				if(!empty($testimonial["nondegreeTitles"])){
        	echo ' | ';
    			echo $testimonial["nondegreeTitles"];
				}

				if(!empty($testimonial["degrees"])){
        	echo ' | ';
					echo '<a href="' . $testimonial["degreeURL"] . '">' . $testimonial["degrees"] . '</a>';
				}
				if(!empty($testimonial["degrees2"])){
					echo ', <a href="' . $testimonial["degree2URL"] . '">' . $testimonial["degrees2"] . '</a>';
				}
				if(!empty($testimonial["degrees3"])){
					echo ', <a href="' . $testimonial["degree3URL"] . '">' . $testimonial["degrees3"] . '</a>';
				}
				echo '</cite></blockquote><div class="placeholder"></div></section>';
    }
  }
}
				
			

optimalTestimonialCarousel($pageTestimonial, $quote)

This function creates an optimized list-item blockquote for use inside a carousel. This function requires the carousel container be created in HTML.

				
function optimalTestimonialCarousel($pageTestimonial, $quote="") {
	foreach ($GLOBALS["matrix-tms"]["testimonials"] as $testimonial) {
    if(strpos($pageTestimonial, $testimonial["name"]) !== false){
			echo '<li class="testimonial-panel creative optimized"';
			if(!empty($testimonial["imageOptimal"])){
				echo ' style="background: linear-gradient(0deg,rgba(0,0,0,0.5),rgba(0,0,0,0.3)), url(' . $testimonial["imageOptimal"] . '); background-size: cover; background-position:';
				if(!empty($testimonial["imageOptimalPos"])){
					echo $testimonial["imageOptimalPos"] . ';">';
				}
				else{
					echo '65% center;">'; //default positioning 10% off center
				}
			}
			// replace variables %longName% & %shortName% with appropriate values for brand agnostic quotes
			$myQuote = str_replace("%longName%", $GLOBALS["longName"], $testimonial["quote".$quote]);
			$myQuote = str_replace("%shortName%", $GLOBALS["shortName"], $myQuote);

      echo '<blockquote class="testimonial-overlay">
    		<p>&quot;' . $myQuote . '&quot;</p>
				<cite>'. $testimonial["name"];

        if(!empty($testimonial["creds"])){
          echo ', ' . $testimonial["creds"];
        }

				if(!empty($testimonial["nondegreeTitles"])){
        	echo ' | ';
    			echo $testimonial["nondegreeTitles"];
				}

				if(!empty($testimonial["degrees"])){
        	echo ' | ';
					echo '<a href="' . $testimonial["degreeURL"] . '">' . $testimonial["degrees"] . '</a>';
				}
				if(!empty($testimonial["degrees2"])){
					echo ', <a href="' . $testimonial["degree2URL"] . '">' . $testimonial["degrees2"] . '</a>';
				}
				if(!empty($testimonial["degrees3"])){
					echo ', <a href="' . $testimonial["degree3URL"] . '">' . $testimonial["degrees3"] . '</a>';
				}
				echo '</cite></blockquote><div class="placeholder"></div></li>';
    }
  }
}
				
			

accreditedBadge()

This function adds a list-item for an accreditation badge to the degree at-a-glance include. Note: the include must be on the page or in the page's template. You must also declare on-page: $GLOBALS["accredited"] = TRUE;.

The switch statement inside this function must be kept up-to-date with all programs and respective degrees to which a specialty accreditation badge applies.

				
function accreditedBadge() {
	$currentURL = $_SERVER['REQUEST_URI'];
	// make an array
	$b =  explode('/',$currentURL);
	// Second-to-last element in array is parent folder
	$c = $b[count($b)-2];
	$d = $b[count($b)-1];

	if ($GLOBALS["accredited"] == TRUE) {
		switch ($c) {
		//programs with accreditation
		case "accounting":
		  $currentProgram = "Accounting";
			//degree levels with accreditation
			$levels = array("associate-of-science", "bachelor-of-science", "master-of-science");
			//check current page against array and strip test page string '-2'
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "business-administration":
		  $currentProgram = "Business Administration";
			$levels = array("associate-of-arts", "bachelor-of-business-administration", "master-of-business-administration");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "entrepreneurship":
		  $currentProgram = "Entrepreneurship";
			$levels = array("bachelor-of-arts", "master-of-arts");
	 		if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "hospitality-management":
		  $currentProgram = "Hospitality Management";
			$levels = array("associate-of-arts", "bachelor-of-arts");
	 		if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "marketing":
			$currentProgram = "Marketing";
			$levels = array("bachelor-of-arts");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "management":
			$currentProgram = "Management";
			$levels = array("associate-of-arts", "bachelor-of-arts", "master-of-arts");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "retail-management":
			$currentProgram = "Retail Management";
			$levels = array("associate-of-arts", "bachelor-of-arts");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "real-estate-studies":
			$currentProgram = "Real Estate Studies";
			$levels = array("associate-of-arts");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "reverse-logistics-management":
			$currentProgram = "Reverse Logistics Management";
			$levels = array("bachelor-of-arts", "master-of-arts");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "transportation-logistics-management":
			$currentProgram = "Transportation Logistics Management";
			$levels = array("bachelor-of-arts", "master-of-arts");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/acbsp.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "nursing":
			$currentProgram = "Nursing";
			$levels = array("bachelor-of-science", "master-of-science");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/ccne.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "nursing-rn-msn":
			$currentProgram = "Nursing RN to MSN";
			$levels = array("master-of-science");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/ccne.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "public-health":
			$currentProgram = "Public Health";
			$levels = array("master-of-public-health");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/ccne.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "fire-science":
			$currentProgram = "Fire Science";
			$levels = array("associate-of-science");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/ifsac.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "fire-science-management":
			$currentProgram = "Fire Science Management";
			$levels = array("bachelor-of-science");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/ifsac.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "emergency-disaster-management":
			$currentProgram = "Emergency Disaster Management";
			$levels = array("bachelor-of-arts", "master-of-arts");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/ifsac.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "emergency-disaster-management-homeland-security":
			$currentProgram = "Emergency Disaster Management and homeland Security";
			$levels = array("master-of-arts");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/ifsac.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;

		case "health-information-management":
			$currentProgram = "Health Information Management";
			$levels = array("bachelor-of-science");
			if (in_array(str_replace("-2","",$d), $levels)) {
				echo '<li class="panes">
					<div class="pane">
						<h3 class="pane-heading fact-title">Accredited</h3>
						<div class="pane-body">
							<span class="fact-image">
								<img src="/common/images/accredited/cahiim.png">
							</span>
						</div>
					</div>
				</li>';
			}
			break;
		}
	}
}
				
			

programListByTag()

This function outputs a list of programs matching a single tag. The function accepts two parameters: 1) the tag name; and 2) the list type. The list types are: 1) block; 2) list; and 3) inline. See examples below. The second parameter, list type, is not required as the list will default to the block format. The function first matches the list-type against a switch statement to determine the format, then it compares the tag name to our programs.json data. If the tag exists in the relatedKey field for a program, the overview page for that program is returned. Otherwise, if the tag exists for each degree/cert, multiple results for a program can be returned. Tagging is managed in the Program Matrix.

				
function programListByTag($tagFilter, $listType="block") {
	switch ($listType) {
		case 'block':
		echo('<ul class="image-blocks flex one two-700 four-1400 five-1800 six-2000 center">');
		foreach ($GLOBALS["matrix"]["programs"] as $program) {
			// check for overview-level match on relatedKey first
			if (preg_match("/\b".$tagFilter."\b/", $program["relatedKey"], $pass_fail) == true)
			{
				//find first degree level for image
				preg_match('/([a-z])\w/', $program["degreeLevel"]["degreeLevel"], $m );
	      echo '<li>
	        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-' . $m[0] . '.jpg) center center no-repeat;">
	          <a href="'. $program["progName"] . '/overview">
	            <h3>' . $program["name"] . '</h3>
	          </a>
	        </div>
	      </li>';echo "\n";
			}
			else {
				// check each degree level for ag-energy-utilities tagging
				//AA
				if (preg_match("/\baa\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["aa"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-aa.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["aa"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["aa"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//AAS
				if (preg_match("/\baas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["aas"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-aas.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["aas"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["aas"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//AS
				if (preg_match("/\bas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["as"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-as.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["as"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["as"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//BA
				if (preg_match("/\bba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ba"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-ba.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["ba"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["ba"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//BAS
				if (preg_match("/\bbas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bas"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-bas.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["bas"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["bas"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//BBA
				if (preg_match("/\bbba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bba"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-bba.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["bba"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["bba"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//BE
				if (preg_match("/\bbe\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["be"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-be.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["be"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["be"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//BS
				if (preg_match("/\bbs\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bs"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-bs.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["bs"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["bs"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//MA
				if (preg_match("/\bma\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ma"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-ma.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["ma"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["ma"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//MBA
				if (preg_match("/\bmba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mba"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-mba.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["mba"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["mba"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//ME
				if (preg_match("/\bme\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["me"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-me.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["me"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["me"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//MS
				if (preg_match("/\bms\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ms"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-ms.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["ms"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["ms"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//MPA
				if (preg_match("/\bmpa\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mpa"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-mpa.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["mpa"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["mpa"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//MPH
				if (preg_match("/\bmph\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mph"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-mph.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["mph"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["mph"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//MPP
				if (preg_match("/\bmpp\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mpp"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-mpp.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["mpp"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["mpp"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//AD
				if (preg_match("/\bad\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ad"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-ad.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["ad"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["ad"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//GCERT
				if (preg_match("/\bgcert\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["gcert"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-gcert.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["gcert"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["gcert"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
				//UCERT
				if (preg_match("/\bucert\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ucert"]["tags"], $pass_fail) == true)
				{
		      echo '<li>
		        <div class="image-block" style="background: url(/common/images/program-finder-thumbnails/'. $program["progName"] . '-ucert.jpg) center center no-repeat;">
		          <a href="'. $program["degreeLevel"]["ucert"]["url"] . '">
		            <h3>' . $program["degreeLevel"]["ucert"]["abbr"] . ", " . $program["name"] . '</h3>
		          </a>
		        </div>
		      </li>';echo "\n";
				}
			}
		}
		echo('</ul>');
		break;

		// inline list
		case 'inline':
		echo('<span class="programs-inline">');
		foreach ($GLOBALS["matrix"]["programs"] as $program) {
			// check for overview-level match on relatedKey first
			if (preg_match("/\b".$tagFilter."\b/", $program["relatedKey"], $pass_fail) == true)
			{
				//find first degree level for image
				preg_match('/([a-z])\w/', $program["degreeLevel"]["degreeLevel"], $m );
	      echo '<a href="'. $program["progName"] . '/overview">' . $program["name"] . '</a>, ';echo "\n";
			}
			else {
				// check each degree level for ag-energy-utilities tagging
				//AA
				if (preg_match("/\baa\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["aa"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["aa"]["url"] . '">' . $program["degreeLevel"]["aa"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//AAS
				if (preg_match("/\baas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["aas"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["aas"]["url"] . '">' . $program["degreeLevel"]["aas"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//AS
				if (preg_match("/\bas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["as"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["as"]["url"] . '">' . $program["degreeLevel"]["as"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//BA
				if (preg_match("/\bba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ba"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["ba"]["url"] . '">' . $program["degreeLevel"]["ba"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//BAS
				if (preg_match("/\bbas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bas"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["bas"]["url"] . '">' . $program["degreeLevel"]["bas"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//BBA
				if (preg_match("/\bbba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bba"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["bba"]["url"] . '">' . $program["degreeLevel"]["bba"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//BE
				if (preg_match("/\bbe\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["be"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["be"]["url"] . '">' . $program["degreeLevel"]["be"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//BS
				if (preg_match("/\bbs\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bs"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["bs"]["url"] . '">' . $program["degreeLevel"]["bs"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//MA
				if (preg_match("/\bma\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ma"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["ma"]["url"] . '">' . $program["degreeLevel"]["ma"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//MBA
				if (preg_match("/\bmba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mba"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["mba"]["url"] . '">' . $program["degreeLevel"]["mba"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//ME
				if (preg_match("/\bme\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["me"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["me"]["url"] . '">' . $program["degreeLevel"]["me"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//MS
				if (preg_match("/\bms\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ms"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["ms"]["url"] . '">' . $program["degreeLevel"]["ms"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//MPA
				if (preg_match("/\bmpa\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mpa"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["mpa"]["url"] . '">' . $program["degreeLevel"]["mpa"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//MPH
				if (preg_match("/\bmph\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mph"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["mph"]["url"] . '">' . $program["degreeLevel"]["mph"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//MPP
				if (preg_match("/\bmpp\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mpp"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["mpp"]["url"] . '">' . $program["degreeLevel"]["mpp"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//AD
				if (preg_match("/\bad\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ad"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["ad"]["url"] . '">' . $program["degreeLevel"]["ad"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//GCERT
				if (preg_match("/\bgcert\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["gcert"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["gcert"]["url"] . '">' . $program["degreeLevel"]["gcert"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
				//UCERT
				if (preg_match("/\bucert\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ucert"]["tags"], $pass_fail) == true)
				{
		      echo '<a href="'. $program["degreeLevel"]["ucert"]["url"] . '">' . $program["degreeLevel"]["ucert"]["abbr"] . " " . $program["name"] . '</a>, ';
				}
			}
		}
		echo('</span>');
		//remove last comma, add and after new last comma
		echo('<script>
			$(document).ready(function(){
				var str = $(".programs-inline").html().slice(0,-2);
				str = str.replace(/,([^,]*)$/, ", and $1");
				$(".programs-inline").html(str);
			})
		</script>');
		break;

		// standard list
		case 'list':
		echo('<ul class="list-disc">');
		foreach ($GLOBALS["matrix"]["programs"] as $program) {
			// check for overview-level match on relatedKey first
			if (preg_match("/\b".$tagFilter."\b/", $program["relatedKey"], $pass_fail) == true)
			{
				//find first degree level for image
				preg_match('/([a-z])\w/', $program["degreeLevel"]["degreeLevel"], $m );
	      echo '<li><a href="'. $program["progName"] . '/overview">' . $program["name"] . '</a></li>';echo "\n";
			}
			else {
				// check each degree level for ag-energy-utilities tagging
				//AA
				if (preg_match("/\baa\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["aa"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["aa"]["url"] . '">' . $program["degreeLevel"]["aa"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//AAS
				if (preg_match("/\baas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["aas"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["aas"]["url"] . '">' . $program["degreeLevel"]["aas"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//AS
				if (preg_match("/\bas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["as"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["as"]["url"] . '">' . $program["degreeLevel"]["as"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//BA
				if (preg_match("/\bba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ba"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["ba"]["url"] . '">' . $program["degreeLevel"]["ba"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//BAS
				if (preg_match("/\bbas\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bas"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["bas"]["url"] . '">' . $program["degreeLevel"]["bas"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//BBA
				if (preg_match("/\bbba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bba"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["bba"]["url"] . '">' . $program["degreeLevel"]["bba"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//BE
				if (preg_match("/\bbe\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["be"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["be"]["url"] . '">' . $program["degreeLevel"]["be"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//BS
				if (preg_match("/\bbs\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["bs"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["bs"]["url"] . '">' . $program["degreeLevel"]["bs"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//MA
				if (preg_match("/\bma\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ma"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["ma"]["url"] . '">' . $program["degreeLevel"]["ma"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//MBA
				if (preg_match("/\bmba\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mba"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["mba"]["url"] . '">' . $program["degreeLevel"]["mba"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//ME
				if (preg_match("/\bme\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["me"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["me"]["url"] . '">' . $program["degreeLevel"]["me"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//MS
				if (preg_match("/\bms\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ms"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["ms"]["url"] . '">' . $program["degreeLevel"]["ms"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//MPA
				if (preg_match("/\bmpa\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mpa"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["mpa"]["url"] . '">' . $program["degreeLevel"]["mpa"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//MPH
				if (preg_match("/\bmph\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mph"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["mph"]["url"] . '">' . $program["degreeLevel"]["mph"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//MPP
				if (preg_match("/\bmpp\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["mpp"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["mpp"]["url"] . '">' . $program["degreeLevel"]["mpp"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//AD
				if (preg_match("/\bad\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ad"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["ad"]["url"] . '">' . $program["degreeLevel"]["ad"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//GCERT
				if (preg_match("/\bgcert\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["gcert"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["gcert"]["url"] . '">' . $program["degreeLevel"]["gcert"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
				//UCERT
				if (preg_match("/\bucert\b/", $program["degreeLevel"]["degreeLevel"], $pass_fail) == true && preg_match("/\b".$tagFilter."\b/", $program["degreeLevel"]["ucert"]["tags"], $pass_fail) == true)
				{
		      echo '<li><a href="'. $program["degreeLevel"]["ucert"]["url"] . '">' . $program["degreeLevel"]["ucert"]["abbr"] . ", " . $program["name"] . '</a></li>';
				}
			}
		}
		echo('</span>');
		break;
	}
}
				
			
Examples

<?php programListByTag("ag-public-safety"); ?>

    <?php programListByTag("ag-public-safety", "list"); ?>

      <?php programListByTag("ag-public-safety", "inline"); ?>

      Fast Facts

      _fastFacts.php is an array of data used to centralize university statistics and data. See Fast Facts component for more information.