Permalink
Browse files

Minor bug fixes

  • Loading branch information...
1 parent 48e62b4 commit c7c5c56c927a074bcbd77117e6e1a578d6f7f11e @milesj milesj committed Apr 3, 2012
View
@@ -100,11 +100,11 @@ public static function initialize() {
self::install('app', new Application(), true);
self::install('cache', new Cache(), true);
self::install('config', new Config(), true);
- self::install('event', new Event(), true);
self::install('registry', new Registry(), true);
self::install('router', new Router(), true);
self::install('g11n', new G11n(), true);
self::install('environment', new Environment(), true);
+ self::install('event', new Event(), true);
self::install('dispatch', new Dispatch(), true);
}
@@ -43,7 +43,7 @@ class Dispatch {
* @return void
*/
public function run() {
- $params = Titon::router()->current()->params();
+ $params = Titon::router()->current()->getParams();
$dispatcher = null;
if (!empty($this->_mapping)) {
@@ -124,12 +124,12 @@ public function getListeners() {
* @return void
*/
public function notify($event, $object = null) {
- if (empty($this->_listeners)) {
+ $route = Titon::router()->current();
+
+ if (!$route || empty($this->_listeners)) {
return;
}
- $route = Titon::router()->current();
-
foreach ($this->_listeners as &$listener) {
if (isset($listener['executed'][$event])) {
continue;
@@ -35,6 +35,7 @@ class G11n {
const FORMAT_1 = 1;
const FORMAT_2 = 2;
const FORMAT_3 = 3;
+ const FORMAT_4 = 3;
/**
* Currently active locale bundle based on the client.
@@ -95,6 +96,9 @@ public function canonicalize($key, $format = self::FORMAT_1) {
case self::FORMAT_3:
$return .= '_' . strtoupper($parts[1]);
break;
+ case self::FORMAT_4:
+ $return .= strtoupper($parts[1]);
+ break;
}
}
@@ -38,9 +38,7 @@
*/
public function initialize() {
$this->findBundle(array(
- APP_MODULES . '{module}/resources/messages/{bundle}/LC_MESSAGES/',
APP_MODULES . '{module}/resources/messages/{bundle}/',
- APP_RESOURCES . 'messages/{bundle}/LC_MESSAGES/',
APP_RESOURCES . 'messages/{bundle}/',
TITON_RESOURCES . 'messages/{bundle}/'
));

0 comments on commit c7c5c56

Please sign in to comment.