githubDiff mode flag and root loaded by get-branch

Session var used as flag to indicate github diff mode
Instead of now including get-branch.php after setting the | root
location, we now set the src on the fileControl iframe, which does the
loading of the branch as with all other subsequent branches loaded
This commit is contained in:
Matt Pass
2014-07-27 12:42:12 +01:00
parent 64c2cfa06f
commit 6fedd41ced

View File

@@ -22,20 +22,23 @@ $isGitHubRepoDir = in_array($ICEcoder["root"],$ICEcoder['githubLocalPaths']);
<div title="Lock" onClick="top.ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
<?php
$_SESSION['githubDiff'] = false;
if ($isGitHubRepoDir) {
$classExtra = !isset($_GET["githubDiff"]) || $_GET["githubDiff"] == "false" ? "Off" : "On";
if ($classExtra == "On") {
$_SESSION['githubDiff'] = true;
}
echo '<div title="GitHub" onClick="top.ICEcoder.githubDiffToggle()" class="github'.$classExtra.'"></div>';
}
?>
<ul class="fileManager">
<li class="pft-directory dirOpen"><a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" onClick="top.ICEcoder.openCloseDir(this)" style="position: relative; left:-22px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="|">/ <?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?></span> <span style="color: #888; font-size: 8px" id="|_perms"><?php echo $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3) : "";?></span></a></li><?php
$_GET['location'] = "|";
include("lib/get-branch.php");
// tree file items generated by the iFrame 'fileControl' below which loads in the items at location=| (ie, the root)
?>
</ul>
<iframe name="fileControl" style="display: none"></iframe>
<iframe name="fileControl" src="lib/get-branch.php?location=|&csrf=<?php echo $_SESSION['csrf'];?>" style="display: none"></iframe>
<iframe name="testControl" style="display: none"></iframe>