Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updates to framework

Signed-off-by: Adrian Jones <adrianj1998@hotmail.com>
  • Loading branch information...
commit c4fa121c90063d54c40b3e53ec94c69ceb798f9f 1 parent 37d65d6
@adrianj98 adrianj98 authored
View
2  DCore.php
@@ -15,7 +15,7 @@
* @package DCore
*/
class DCore {
-
+
/**
* Hard security check
*
View
2  README.md
@@ -8,7 +8,7 @@ would not hurt. Plus would force for better code standards and documentation.
Second motive is to create a XHP UI framework. The XHP framework would site on top
of DCore and reply on it. DCore would not depend on the XHP framework.
-Can try the [tutorials](docs/tutorials.md)
+Can try the [tutorials](http://dcode.bbfmedia.com/docs/tutorials.md)
Status
View
39 core/i18.class.php
@@ -0,0 +1,39 @@
+<?php
+
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of i18
+ *
+ * @author adrian
+ */
+if (!defined('_DEFAULT_LANGUAGE_'))
+ define('_DEFAULT_LANGUAGE_','eng');
+
+class i18 {
+
+ static $language_id = _DEFAULT_LANGUAGE_;
+
+ function setLanguage($lang)
+ {
+ if (!empty($lang))
+ self::$language_id = $lang;
+ }
+ function getLanguage()
+ {
+ return self::$language_id ;
+ }
+ function loadLanguageFile($filename = '')
+ {
+ if (empty($filename))
+ $filename = self::getLanguage();
+ $filename = 'protected:settings/lang/'.self::getLanguage().'/'.$filename;
+if (DCore::getFilePath($filename,'','','.php',false))
+ DCore::using($filename);
+ }
+}
+
+?>
View
2  core/registry.class.php
@@ -46,7 +46,9 @@ public function __set($index, $value) {
*
*/
public function __get($index) {
+ if (isset($this->vars[$index]))
return $this->vars[$index];
+ return null;
}
/**
View
5 core/router.class.php
@@ -236,15 +236,20 @@ private function getController() {
}
}
$index = 2;
+ if (!$this->registry->request)
+ $this->registry->request = new request();
+ $this->registry->request->addPOST($_POST);
// check if template is even loaded
// a pure xhp app may not need to load it
if ($this->registry->template) {
while (count($parts) > $index + 1) {
$cc = ('get_' . $parts[$index]);
+ $this->registry->request->setGET($parts[$index],$parts[$index + 1]);
$this->registry->template->$cc = $parts[$index + 1];
$index += 2;
}
}
+
if (empty($this->controller)) {
$this->controller = 'index';
}
View
4 core/template.class.php
@@ -100,7 +100,9 @@
*
*/
public function __get($index) {
+ if (isset($this->vars[$index]))
return $this->vars[$index];
+ return null;
}
public function __set($index, $value) {
@@ -108,6 +110,8 @@ public function __set($index, $value) {
}
function __construct($registry, $options = null) {
+
+ $this->vars = array();
parent::__construct($registry, $options);
if (isset($options['useXHP']))
$this->useXHP = $options['useXHP'];
Please sign in to comment.
Something went wrong with that request. Please try again.