Examples::CodeLinks PHP Method

    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 .= ' &nbsp; | &nbsp; ';
        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 .= ' &nbsp; | &nbsp; ';
        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 .= ' &nbsp; | &nbsp; ';
        $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 .= ' &nbsp; | &nbsp; ';
            $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 .= ' &nbsp; | &nbsp; ';
                }
                $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();
        }
    }

Usage Example

Example #1
0
"></link>
		<link rel="stylesheet" type="text/css" href="<?php 
_p(__VIRTUAL_DIRECTORY__ . __EXAMPLES__ . '/includes/examples.css');
?>
"></link>
	</head>
	<body>
		<div id="page">
			<div id="header">
				<div id="headerLeft">
					<div id="pageName"><?php 
_p(Examples::PageName($strReference));
?>
 - View Source</div>
					<div id="pageLinks"><span class="headerSmall"><?php 
_p(Examples::CodeLinks($strReference, $strScript), false);
?>
</span></div>
				</div>
				<div id="headerRight">
					<div id="closeWindow"><a href="javascript:window.close()">Close Window</a></div>
				</div>
			<div>
			<div id="content">
<?php 
// Filename Cleanup
if ($strScript == 'header.inc.php' || $strScript == 'footer.inc.php' || $strScript == 'examples.css') {
    $strFilename = 'includes/' . $strScript;
} else {
    if ($strScript == 'mysql_innodb.sql' || $strScript == 'sql_server.sql') {
        $strFilename = $strScript;
All Usage Examples Of Examples::CodeLinks