Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Increase readability #741

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removing unnecessary parenthesis
  • Loading branch information
rotelok committed Jun 16, 2018
commit 05ee5e5f7020d74336b7a60c7ef42b2268d85bf6
6 changes: 3 additions & 3 deletions editor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
include "lib/headers.php";
include "lib/settings.php";
$t = $text['editor'];
?>
<!DOCTYPE html>
Expand Down Expand Up @@ -317,7 +317,7 @@ function createNewCMInstance(num) {

<div style="position: absolute; display: none; height: 100%; width: 100%; top: 0; padding: 3px 0 0 60px; line-height: 16px; font-family: monospace; font-size: 13px; z-index: 2147483647" id="game"></div>

<?php include_once("processes/on-editor-load.php"); ?>
<?php include_once "processes/on-editor-load.php"; ?>

</body>

Expand Down
4 changes: 2 additions & 2 deletions files.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
include "lib/headers.php";
include "lib/settings.php";
$t = $text['files'];

// Is our dir in the list of GitHub local paths?
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
include "lib/headers.php";
include "lib/settings.php";
$t = $text['index'];

$updateMsg = '';
Expand Down
6 changes: 3 additions & 3 deletions lib/auto-logout-warning.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['auto-logout-warning'];
?>
<!DOCTYPE html>
Expand All @@ -21,4 +21,4 @@

</body>

</html>
</html>
6 changes: 3 additions & 3 deletions lib/backup-versions-preview-loader.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Load common functions
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";

$file = str_replace("|","/",xssClean($_GET['file'],'html'));

Expand Down Expand Up @@ -33,4 +33,4 @@
parent.document.getElementById('buttonsContainer').style.display = 'inline-block';
parent.editor.setValue(document.getElementById('loadedFile').value);
parent.document.getElementById('infoContainer').innerHTML = 'Date & Time:<br><?php echo $datetime;?><br><br>Size:<br><?php echo $size;?>';
</script>
</script>
6 changes: 3 additions & 3 deletions lib/backup-versions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Load common functions
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$text = $_SESSION['text'];
$t = $text['backup-versions'];

Expand Down Expand Up @@ -110,7 +110,7 @@

<?php
echo "fileName = '".basename($file)."';";
include(__DIR__."/language-modes-partial.js");
include __DIR__."/language-modes-partial.js";
?>

var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
Expand Down
6 changes: 3 additions & 3 deletions lib/bug-files-check.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Load common functions
include("headers.php");
include_once("settings-common.php");
include "headers.php";
include_once "settings-common.php";
$text = $_SESSION['text'];
$t = $text['bug-files-check'];

Expand Down Expand Up @@ -107,7 +107,7 @@
);

// Include our process once our bug checking work is done
include("../processes/on-bug-check.php");
include "../processes/on-bug-check.php";

// Finally, display our status in JSON format as the XHR response text
echo json_encode($status);
Expand Down
6 changes: 3 additions & 3 deletions lib/download.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";

// Establish the real absolute path to the file
$file = realpath($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['file'])));
Expand All @@ -24,4 +24,4 @@
readfile($file);
exit;
}
?>
?>
30 changes: 15 additions & 15 deletions lib/file-control-xhr.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
include("headers.php");
include("settings.php");
include("ftp-control.php");
include "headers.php";
include "settings.php";
include "ftp-control.php";
$t = $text['file-control'];

// ===============================
Expand Down Expand Up @@ -260,7 +260,7 @@ function stitchChanges($fileLines) {
// MDT'S MATCH, WRITE FILE
// =======================

if (!(isset($_GET['fileMDT']))||$filemtime==$_GET['fileMDT']) {
if (!isset($_GET['fileMDT']) ||$filemtime==$_GET['fileMDT']) {

// FTP Saving
if (isset($ftpSite)) {
Expand Down Expand Up @@ -485,7 +485,7 @@ function stitchChanges($fileLines) {
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);';

// Run our custom processes
include_once("../processes/on-file-save.php");
include_once "../processes/on-file-save.php";

// ======================================================
// MDT'S DON'T MATCH, OFFER TO LOAD FILE & SHOW DIFF VIEW
Expand Down Expand Up @@ -557,7 +557,7 @@ function stitchChanges($fileLines) {
}
$finalAction = "newFolder";
// Run our custom processes
include_once("../processes/on-new-dir.php");
include_once "../processes/on-new-dir.php";
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot create...']."\\\\n".$fileLoc."');";
$finalAction = "nothing";
Expand Down Expand Up @@ -603,7 +603,7 @@ function stitchChanges($fileLines) {
}
$finalAction = "move";
// Run our custom processes
include_once("../processes/on-file-dir-move.php");
include_once "../processes/on-file-dir-move.php";
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot move']."\\\\n".str_replace("|","/",strClean($_GET['oldFileName']))."\\\\n\\\\n".$t['Maybe public write...']."');";
$finalAction = "nothing";
Expand Down Expand Up @@ -641,7 +641,7 @@ function stitchChanges($fileLines) {
}
$finalAction = "rename";
// Run our custom processes
include_once("../processes/on-file-dir-rename.php");
include_once "../processes/on-file-dir-rename.php";
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot rename']."\\\\n".strClean($_GET['oldFileName'])."\\\\n\\\\n".$t['Maybe public write...']."');";
$finalAction = "nothing";
Expand Down Expand Up @@ -698,7 +698,7 @@ function stitchChanges($fileLines) {
$doNext .= 'top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.basename($dest).'\',false,false,false,\''.$fileOrFolder.'\');';
$finalAction = "pasteFile";
// Run our custom processes
include_once("../processes/on-file-dir-paste.php");
include_once "../processes/on-file-dir-paste.php";
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot copy']." \\\\n".str_replace($docRoot,"",$source)."\\\\n ".$t['into']." \\\\n".str_replace($docRoot,"",$dest)."');";
$finalAction = "nothing";
Expand Down Expand Up @@ -759,7 +759,7 @@ function getDetails($fileArr) {
$fileUploader=new fileUploader($uploads);
}
// Run our custom processes
include_once("../processes/on-file-upload.php");
include_once "../processes/on-file-upload.php";
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot upload...']."');";
$finalAction = "nothing";
Expand Down Expand Up @@ -789,7 +789,7 @@ function getDetails($fileArr) {
$doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
$finalAction = "delete";
// Run our custom processes
include_once("../processes/on-file-dir-delete.php");
include_once "../processes/on-file-dir-delete.php";
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot delete']."\\\\n".$fileLoc."/".$fileName."');";
$finalAction = "nothing";
Expand Down Expand Up @@ -823,7 +823,7 @@ function getDetails($fileArr) {
$doNext .= 'top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
$finalAction = "delete";
// Run our custom processes
include_once("../processes/on-file-dir-delete.php");
include_once "../processes/on-file-dir-delete.php";
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot delete']."\\\\n".str_replace($docRoot,"",$fullPath)."');";
$finalAction = "nothing";
Expand Down Expand Up @@ -870,7 +870,7 @@ function rrmdir($dir) {
fclose($fh);
$finalAction = "replaceText";
// Run our custom processes
include_once("../processes/on-file-replace-text.php");
include_once "../processes/on-file-replace-text.php";
} else {
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot replace...']."\\\\n".$file."');";
$finalAction = "nothing";
Expand All @@ -894,7 +894,7 @@ function rrmdir($dir) {
$doNext .= 'top.ICEcoder.goToLine('.$lineNumber.');';
$finalAction = "getRemoteFile";
// Run our custom processes
include_once("../processes/on-get-remote-file.php");
include_once "../processes/on-get-remote-file.php";
} else {
$finalAction = "nothing";
$doNext .= 'top.ICEcoder.message(\''.$t['Sorry, could not...'].' '.$file.'\');';
Expand Down Expand Up @@ -929,7 +929,7 @@ function rrmdir($dir) {
}
$finalAction = "perms";
// Run our custom processes
include_once("../processes/on-file-dir-perms.php");
include_once "../processes/on-file-dir-perms.php";
} else {
$finalAction = "nothing";
$doNext .= "top.ICEcoder.message('".$t['Sorry, cannot change...']." \\n".strClean($file)."');";
Expand Down
8 changes: 4 additions & 4 deletions lib/file-control.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
include("headers.php");
include("settings.php");
include("ftp-control.php");
include "headers.php";
include "settings.php";
include "ftp-control.php";
$t = $text['file-control'];
?>
<?php if ($_SESSION['githubDiff']) { ?>
Expand Down Expand Up @@ -118,7 +118,7 @@
$loadedFile = preg_replace('/\\n/','&#13;',$loadedFile);
echo '</script><textarea name="loadedFile" id="loadedFile">'.$loadedFile.'</textarea><script>';
// Run our custom processes
include_once("../processes/on-file-load.php");
include_once "../processes/on-file-load.php";
} else if (strpos($finfo,"image")===0) {
echo 'fileType="image";fileName=\''.$fileLoc."/".$fileName.'\';';
} else {
Expand Down
4 changes: 2 additions & 2 deletions lib/ftp-manager.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['ftp-manager'];

// If we have an action to perform
Expand Down
8 changes: 4 additions & 4 deletions lib/get-branch.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
if (!isset($ICEcoder['root'])) {
include("headers.php");
include("settings.php");
include("ftp-control.php");
include "headers.php";
include "settings.php";
include "ftp-control.php";
}

if (!$_SESSION['loggedIn']) {
Expand Down Expand Up @@ -100,7 +100,7 @@ function parseGitignore($file) { # $file = '/absolute/path/to/.gitignore'
// Exclude the .git dir as first item as we don't want to see that
$excluded = array("/.git");
foreach ($gi as $scanpath) {
$excludedTest = (parseGitignore($scanpath));
$excludedTest = parseGitignore($scanpath);
if (count($excludedTest) > 0) {
$excluded = array_merge($excluded, $excludedTest);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/github-manager.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['github-manager'];

// If we have an action to perform
Expand Down
4 changes: 2 additions & 2 deletions lib/github.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['github'];

// SSL check, as everything is over https
Expand Down
4 changes: 2 additions & 2 deletions lib/go-localhost-root.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include_once("settings.php");
include_once "settings.php";
$text = $_SESSION['text'];
$t = $text['settings-update'];

Expand All @@ -15,7 +15,7 @@
$settingsContents =
substr($settingsContents,0,$repPosStart).
'"root" => "",'.PHP_EOL.
substr($settingsContents,($repPosEnd),strlen($settingsContents));
substr($settingsContents, $repPosEnd,strlen($settingsContents));

// Now update the config file
if (is_writable($settingsFile)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}

// Load common functions
include_once(__DIR__."/settings-common.php");
include_once __DIR__."/settings-common.php";
if (isset($_SESSION['text'])) {
$text = $_SESSION['text'];
$t = $text['headers'];
Expand Down
4 changes: 2 additions & 2 deletions lib/help.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['help'];
?>
<!DOCTYPE html>
Expand Down
4 changes: 2 additions & 2 deletions lib/login.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['login'];
?>
<!DOCTYPE html>
Expand Down
4 changes: 2 additions & 2 deletions lib/multiple-results.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['multiple-results'];
?>
<?php
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins-display.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
include("headers.php");
include "headers.php";

$onLoadExtras = "";
$pluginsDisplay = "";
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins-manager.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['plugins-manager'];

// Set the plugin data source
Expand Down
4 changes: 2 additions & 2 deletions lib/properties.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['properties'];

// Establish the real absolute path to the file/folder
Expand Down
6 changes: 3 additions & 3 deletions lib/session-active-ping.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// Load headings and settings
// Do this every 5 mins to keep session alive
include("headers.php");
include("settings.php");
?>
include "headers.php";
include "settings.php";
?>
Loading