Permalink
Browse files

Added CodeMirror; application folder refactor

  • Loading branch information...
1 parent 49d9511 commit ab09dcc4f1f6117da54148f9ff2bdf5dc2009acc @benkeen committed Oct 7, 2012
Showing 401 changed files with 69,063 additions and 18 deletions.
View
@@ -78,7 +78,6 @@ public function loadSettingsFile() {
if (file_exists($settingsFilePath)) {
self::$settingsFileExists = true;
require_once($settingsFilePath);
-
self::$dbHostname = (isset($dbHostname)) ? $dbHostname : null;
self::$dbName = (isset($dbName)) ? $dbName : null;
self::$dbUsername = (isset($dbUsername)) ? $dbUsername : null;
@@ -101,7 +100,7 @@ public function loadSettingsFile() {
private function initSmarty() {
self::$smarty = new Smarty();
- self::$smarty->template_dir = realpath(dirname(__FILE__) . "/../templates/");
+ self::$smarty->template_dir = realpath(dirname(__FILE__) . "/../resources/templates/");
self::$smarty->compile_dir = realpath(dirname(__FILE__) . "/../cache/");
self::$smarty->assign("version", self::getVersion());
self::$smarty->assign("samePage", Utils::getCleanPhpSelf());
@@ -31,7 +31,7 @@ function __construct($languageFile, $overrideDefault = true) {
// TODO exception handling here
- $fileAndPath = realpath(dirname(__FILE__) . "/../lang/" . $this->currentLanguageFile . ".php");
+ $fileAndPath = realpath(dirname(__FILE__) . "/../resources/lang/" . $this->currentLanguageFile . ".php");
require($fileAndPath);
$this->currentLanguageStrings = $L;
}
@@ -11,7 +11,7 @@ class Translations {
* @return array a hash of filename => language name
*/
function __construct() {
- $translationsFolder = realpath(dirname(__FILE__) . "/../lang/");
+ $translationsFolder = realpath(dirname(__FILE__) . "/../resources/lang/");
$translations = array();
if ($handle = opendir($translationsFolder)) {
while (false !== ($item = readdir($handle))) {
View
@@ -157,7 +157,7 @@ public static function getCleanPhpSelf() {
static function displayPage($template, $pageVars = array()) {
// check the compile directory has the write permissions
- if (!is_writable(Core::$smarty->compile_dir)) {
+ if (!is_writable(Core::$smarty->compile_dir) && is_readable(Core::$smarty->compile_dir)) {
Utils::displaySeriousError("The <b>/cache</b> folder isn't writable. This folder is used by Smarty to generate temporary files for speedy page loads. You'll need to update that folder's permissions to allow read and write permissions (777 on unix/mac).");
exit;
}
@@ -172,17 +172,19 @@ static function displayPage($template, $pageVars = array()) {
}
Core::$smarty->assign("L", Core::$language->getCurrentLanguageStrings());
- //Core::$smarty->assign("SESSION", $_SESSION["gd"]);
Core::$smarty->assign("queryString", $_SERVER["QUERY_STRING"]);
// now add the custom variables for this template, as defined in $page_vars
foreach ($pageVars as $key=>$value) {
Core::$smarty->assign($key, $value);
}
- Core::$smarty->display(realpath(dirname(__FILE__) . "/../$template"));
-
- //gd_db_disconnect($g_link);
+ try {
+ Core::$smarty->display(realpath(dirname(__FILE__) . "/../$template"));
+ } catch (Exception $e) {
+ Utils::displaySeriousError("Smarty encountered a problem writing to the /cache folder. The (probably quite abstruse) error message returned is:<br /><br /><i>{$e}</i>");
+ exit;
+ }
}
@@ -206,7 +208,7 @@ static function displaySeriousError($error) {
<html>
<head>
<title>Things just ain't right.</title>
- <link rel="stylesheet" type="text/css" href="css/styles.css">
+ <link rel="stylesheet" type="text/css" href="resources/css/styles.css">
<script src="scripts/libs/jquery.js"></script>
<script>
$(function() {
View
@@ -0,0 +1,9 @@
+<?php
+$page = "translations";
+require_once("templates/header.php");
+?>
+
+
+<?php
+require_once("templates/footer.php");
+?>
View
@@ -0,0 +1,18 @@
+<?php
+$page = "country";
+require_once("templates/header.php");
+?>
+
+ <div class="container">
+ <div class="row">
+ <div class="span12">
+ <section>
+
+ </section>
+ </div>
+ </div>
+ </div>
+
+<?php
+require_once("templates/footer.php");
+?>
Oops, something went wrong.

0 comments on commit ab09dcc

Please sign in to comment.