Else & if conds added to get GitHub repo

Added an else condition to work with empty folders, establishes local
and remote paths and works out of the $iceRoot is one of our local paths
If so, inform the user their folder is empty and ask the user if they'd
like to clone the repo
If so, show the loading mask and call our GitHub script to begin the
process
This commit is contained in:
Matt Pass
2014-06-03 08:40:48 +01:00
parent 5e792b80a9
commit f5cd2b46b9

View File

@@ -90,6 +90,20 @@ if (isset($_GET['location'])) {
newUL.innerHTML = showContent;
locNest.parentNode.insertBefore(newUL,locNest.nextSibling);
},4);
} else {
<?php
$iceGithubLocalPaths = $ICEcoder["githubLocalPaths"];
$iceGithubRemotePaths = $ICEcoder["githubRemotePaths"];
$pathPos = array_search($iceRoot,$iceGithubLocalPaths);
if ($pathPos !== false) {
?>
if (top.ICEcoder.ask("Your local folder is empty, would you like to clone <?php echo $iceGithubRemotePaths[$pathPos];?>?")) {
setTimeout(function() {
top.ICEcoder.showHide('show',top.get('loadingMask'));
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/github.php?action=clone&csrf="+top.ICEcoder.csrf;
},4);
}
<?php ;}; ?>
}
</script>
<?php