Permalink
Browse files

Fixes for Ushahidi 2.7 - not backward compatible

  • Loading branch information...
1 parent 0ee8cf3 commit cbd3be0ef4559633a92282dc8bb872246ce246f8 @rjmackay rjmackay committed May 3, 2013
Showing with 10 additions and 18 deletions.
  1. +10 −18 controllers/mobile.php
View
28 controllers/mobile.php
@@ -35,18 +35,20 @@ public function __construct()
// Set Table Prefix
$this->table_prefix = Kohana::config('database.default.table_prefix');
+ $this->themes = new Themes();
+
// Load Header & Footer
$this->template->header = new View('mobile/header');
$this->template->footer = new View('mobile/footer');
$this->template->header->site_name = Kohana::config('settings.site_name');
$this->template->header->site_tagline = Kohana::config('settings.site_tagline');
- plugin::add_javascript('mobile/views/js/jquery');
- plugin::add_javascript('mobile/views/js/jquery.treeview');
- plugin::add_javascript('mobile/views/js/expand');
- plugin::add_stylesheet('mobile/views/css/styles');
- plugin::add_stylesheet('mobile/views/css/jquery.treeview');
+ Requirements::js('plugins/mobile/views/js/jquery.js');
+ Requirements::js('plugins/mobile/views/js/jquery.treeview.js');
+ Requirements::js('plugins/mobile/views/js/expand.js');
+ Requirements::css('plugins/mobile/views/css/styles.css');
+ Requirements::css('plugins/mobile/views/css/jquery.treeview.css');
$this->template->header->show_map = FALSE;
$this->template->header->js = "";
@@ -98,17 +100,7 @@ private function _category_count($category_id = false)
*/
private function _google_analytics($google_analytics = false)
{
- $html = "";
- if (!empty($google_analytics)) {
- $html = "<script type=\"text/javascript\">
- var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");
- document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));
- </script>
- <script type=\"text/javascript\">
- var pageTracker = _gat._getTracker(\"" . $google_analytics . "\");
- pageTracker._trackPageview();
- </script>";
- }
- return $html;
- }
+ return $this->themes->google_analytics();
+ }
+
}

4 comments on commit cbd3be0

@ileana

Hi Robbie! I'm using 2.7 ushahidi version and i have installed ushahidi plugins mobile. When i try to navigate it shows this error:

FATAL ERROR: CALL TO UNDEFINITED METHOD PLUGIN::RENDER() IN .../plugines-mobile-master/views/mobile/header.php on line 8

Could you give me some advices? Thanks!

@rjmackay
Ushahidi member

Looks like I forgot to commit a file. you'll Need this fix too: fd88a29

@ileana

Thanks! Now it works, but there isn't any css. Is it right?

@ileana

p.s. I show you
schermata 2013-05-14 a 21 12 54

Please sign in to comment.