public static function CodeLinks($strReference, $strCurrentScript)
{
$blnIsScript = false;
if ($strCurrentScript == 'header.inc.php') {
$strToReturn = '<span class="headingLeftGray">header.inc.php</span>';
$blnIsScript = true;
} else {
$strToReturn = sprintf('<a href="%s/../header.inc.php" class="headingLink">header.inc.php</a>', QApplication::$RequestUri);
}
$strToReturn .= ' | ';
if ($strCurrentScript == 'footer.inc.php') {
$strToReturn .= '<span class="headingLeftGray">footer.inc.php</span>';
$blnIsScript = true;
} else {
$strToReturn .= sprintf('<a href="%s/../footer.inc.php" class="headingLink">footer.inc.php</a>', QApplication::$RequestUri);
}
$strToReturn .= ' | ';
if ($strCurrentScript == 'examples.css') {
$strToReturn .= '<span class="headingLeftGray">examples.css</span>';
$blnIsScript = true;
} else {
$strToReturn .= sprintf('<a href="%s/../examples.css" class="headingLink">examples.css</a>', QApplication::$RequestUri);
}
$strToReturn .= ' | ';
$strScriptname = substr($strReference, strrpos($strReference, '/') + 1);
if ($strCurrentScript == $strScriptname) {
$strToReturn .= sprintf('<span class="headingLeftGray">%s</span>', $strScriptname);
$blnIsScript = true;
} else {
$strToReturn .= sprintf('<a href="%s/../%s" class="headingLink">%s</a>', QApplication::$RequestUri, $strScriptname, $strScriptname);
}
// Current Number of Code Links
$intCount = 4;
if (file_exists(substr(str_replace('.php', '.tpl.php', $strReference), 1))) {
$strToReturn .= ' | ';
$strScriptname = substr(str_replace('.php', '.tpl.php', $strReference), strrpos(str_replace('.php', '.tpl.php', $strReference), '/') + 1);
if ($strCurrentScript == $strScriptname) {
$strToReturn .= sprintf('<span class="headingLeftGray">%s</span>', $strScriptname);
$blnIsScript = true;
} else {
$strToReturn .= sprintf('<a href="%s/../%s" class="headingLink">%s</a>', QApplication::$RequestUri, $strScriptname, $strScriptname);
}
$intCount++;
}
if (array_key_exists($strReference, Examples::$AdditionalCode)) {
foreach (Examples::$AdditionalCode[$strReference] as $strCode) {
if ($intCount % 7 == 0) {
$strToReturn .= '<br/>';
} else {
$strToReturn .= ' | ';
}
$strScriptname = $strCode;
if ($strCurrentScript == $strScriptname) {
$strToReturn .= sprintf('<span class="headingLeftGray">%s</span>', str_replace('___', '', $strScriptname));
$blnIsScript = true;
} else {
$strToReturn .= sprintf('<a href="%s/../%s" class="headingLink">%s</a>', QApplication::$RequestUri, $strScriptname, str_replace('___', '', $strScriptname));
}
$intCount++;
}
}
if ($blnIsScript) {
return $strToReturn;
} else {
QApplication::CloseWindow();
}
}