diff --git a/TODO b/TODO new file mode 100644 index 0000000..b4b206d --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +- Add mongoDB support +- Implement gravatar support +- \ No newline at end of file diff --git a/application/Bootstrap.php b/application/Bootstrap.php index c3e1223..3bfd51a 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -4,6 +4,13 @@ */ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { + protected function _initDev() + { + // TODO: Move this out of dev. + Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/../library/Fiktiv/Controller/Action/Helper', 'Fiktiv_Controller_Action_Helper'); + } + + /** * Setup navigaion * @@ -98,7 +105,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap $this->bootstrap('front'); $router = $this->getResource('front')->getRouter(); - + $route = new Zend_Controller_Router_Route( ':lang/:module/:controller/:action/*', array( @@ -106,7 +113,10 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap 'module' => 'default', 'controller' => 'index', 'action' => 'index' - ) + ), + array( + 'lang' => '[a-z]{2}' + ) ); $router->addRoute('default', $route); @@ -188,6 +198,11 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap // Use the adapter by default Zend_Db_Table::setDefaultAdapter($database); + // Fire up the db service for easier access to the tables + // TODO: Better definition of tables in the database, maybe read meta? + $dbLayer = Fiktiv_Db_Service::getInstance(); + $dbLayer->setTables(array('users')); + return $database; } diff --git a/application/configs/application.ini b/application/configs/application.ini index 63d226d..6e6c177 100644 --- a/application/configs/application.ini +++ b/application/configs/application.ini @@ -8,7 +8,11 @@ app.name = "Fiktivkod" app.version = "1.0" app.url = "fiktivkod.org" +// Defaults +defaults.lang = sv + // Database +db.adapter = mongo db.host = 127.0.0.1 db.username = fiktivkod db.password = pw diff --git a/application/languages/se.ini b/application/languages/se.ini index 9c85ff9..5ef003f 100644 --- a/application/languages/se.ini +++ b/application/languages/se.ini @@ -16,8 +16,9 @@ ERROR_404 = "Sidan kunde inte visas" ERROR_404_TXT = "Sidan du försöker besöka existerar inte." ERROR_500 = "Oops, något blev fel" ERROR_500_TXT = "Vi kollar på detta så fort vi kan." + ERROR_TXT_WHAT = "Följande har gått fel" class = klass function = funktion -line = rad \ No newline at end of file +line = rad diff --git a/application/models/User.php b/application/models/User.php new file mode 100644 index 0000000..27bdc81 --- /dev/null +++ b/application/models/User.php @@ -0,0 +1,19 @@ +toArray(), array_flip($this->_hiddenFields))) . '}'; + } +} \ No newline at end of file diff --git a/application/models/Users.php b/application/models/Users.php index faeb8d5..39c09eb 100644 --- a/application/models/Users.php +++ b/application/models/Users.php @@ -1,12 +1,14 @@ fetchRow($this->getAdapter()->quoteInto('email = ?', $email)); + } + + return null; + } } \ No newline at end of file diff --git a/application/modules/blog/controllers/IndexController.php b/application/modules/blog/controllers/IndexController.php index f2d5ff2..ec805dd 100644 --- a/application/modules/blog/controllers/IndexController.php +++ b/application/modules/blog/controllers/IndexController.php @@ -4,6 +4,5 @@ class Blog_IndexController extends Zend_Controller_Action { public function indexAction() { - } } diff --git a/application/modules/default/controllers/IndexController.php b/application/modules/default/controllers/IndexController.php index 3bdb90e..e746cf6 100644 --- a/application/modules/default/controllers/IndexController.php +++ b/application/modules/default/controllers/IndexController.php @@ -12,6 +12,17 @@ class IndexController extends Zend_Controller_Action public function aboutAction() { - + //$dbLayer = Fiktiv_Db_Service::getInstance(); + //$me = $dbLayer->users->findByEmail('fredric@fiktivkod.org'); + + $dbLayer = $this->_helper->dbService(); + $me = $dbLayer->users->findByEmail('fredric@fiktivkod.org'); + /* + $users = new Users(); + $me = $users->findByEmail('fredric@fiktivkod.org'); + $dbLayer->users->findByEmail(); + */ + echo $me; + } } \ No newline at end of file diff --git a/application/modules/default/views/scripts/index/index.phtml b/application/modules/default/views/scripts/index/index.phtml index 4c7f57c..2d1412c 100644 --- a/application/modules/default/views/scripts/index/index.phtml +++ b/application/modules/default/views/scripts/index/index.phtml @@ -3,6 +3,25 @@
=$this->translate('START_TXT') ?>
+ $val ) + $url .= ' ' . $key . '="' . $val . '"'; + $url .= ' />'; + } + return $url; +} + +echo 'Translated: =$this->translate('uw:example', 'home', 'about', true) ?>