From 49b6b4aac1d53169d34c1f95891d7aa7f72fb2a6 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 Mar 2013 19:51:46 +0100 Subject: [PATCH] Adding mobile support. --- application/classes/Controller/Mobile.php | 39 +++++++++++++++ .../classes/Controller/Mobile/Mumvc.php | 26 ++++++++++ application/views/layout.tpl | 1 + application/views/layout_mobile.tpl | 50 +++++++++++++++++++ application/views/mobile/error404.tpl | 2 + application/views/mobile/index.tpl | 0 application/views/mobile/mumvc/index.tpl | 21 ++++++++ application/views/mobile/mumvc/rhmvc.tpl | 0 application/views/mobile/mumvc/team.tpl | 2 + application/views/mumvc/index.tpl | 16 ++++-- htdocs/assets/css/main.css | 2 + htdocs/index.php | 17 ++++--- modules/MuMVC/ActionController.php | 39 +++++++++++---- modules/MuMVC/Controller.php | 16 +++++- modules/MuMVC/Db/MysqlDriver.php | 4 ++ modules/MuMVC/Root.php | 3 ++ modules/MuMVC/Route.php | 10 +++- modules/MuMVC/Template.php | 11 ++-- 18 files changed, 232 insertions(+), 27 deletions(-) create mode 100644 application/classes/Controller/Mobile.php create mode 100644 application/classes/Controller/Mobile/Mumvc.php create mode 100644 application/views/layout_mobile.tpl create mode 100644 application/views/mobile/error404.tpl create mode 100644 application/views/mobile/index.tpl create mode 100644 application/views/mobile/mumvc/index.tpl create mode 100644 application/views/mobile/mumvc/rhmvc.tpl create mode 100644 application/views/mobile/mumvc/team.tpl diff --git a/application/classes/Controller/Mobile.php b/application/classes/Controller/Mobile.php new file mode 100644 index 0000000..ca15ed4 --- /dev/null +++ b/application/classes/Controller/Mobile.php @@ -0,0 +1,39 @@ +layout = 'layout_mobile.tpl'; + parent::before(); + $this->addCrumb('Mobile', '/mobile/'); + } + public function indexAction() { } + public function error($code, $message) { + $this->action = 'error' . $code; + $this->before(); + if ($message) { + $this->template->asigna('MESSAGE', $message); + } + } + + public function after() { + $this->getBreadcrumbs(); + return parent::after(); + } + + public function getBreadcrumbs() { + foreach(self::$crumbs as $crumb) { + $this->layout->asigna('description', $crumb[0]); + $this->layout->asigna('link', $crumb[1]); + $this->layout->parse('crumb'); + } + } +} \ No newline at end of file diff --git a/application/classes/Controller/Mobile/Mumvc.php b/application/classes/Controller/Mobile/Mumvc.php new file mode 100644 index 0000000..cc8c132 --- /dev/null +++ b/application/classes/Controller/Mobile/Mumvc.php @@ -0,0 +1,26 @@ +controller = 'Mobile/Mumvc'; + parent::__construct(); + } + public function before() { + parent::before(); + $this->addCrumb('MuMVC', '/mobile/MuMVC/'); + } + public function index() { } + public function error($code, $message) { + $this->controller = 'Mobile'; + $this->action = 'error' . $code; + parent::error($code, $message); + } +} \ No newline at end of file diff --git a/application/views/layout.tpl b/application/views/layout.tpl index 31a6d2d..c0f4bea 100644 --- a/application/views/layout.tpl +++ b/application/views/layout.tpl @@ -9,6 +9,7 @@
  • ⊗ English C.V
  • ⊗ Spanish C.V
  • ⊗ μMVC
  • +
  • Mobile version
  • diff --git a/application/views/layout_mobile.tpl b/application/views/layout_mobile.tpl new file mode 100644 index 0000000..f21846f --- /dev/null +++ b/application/views/layout_mobile.tpl @@ -0,0 +1,50 @@ + + + + +Alexey Serikov Kompaniets Online + + + + + + + + +
    +
    +

    Alexey Serikov Kompaniets Online

    +
    +
    + + + + + +
    + +
    + + {$CONTENT} +
      +
    + +
    +
    +
    +
    + + diff --git a/application/views/mobile/error404.tpl b/application/views/mobile/error404.tpl new file mode 100644 index 0000000..10ca929 --- /dev/null +++ b/application/views/mobile/error404.tpl @@ -0,0 +1,2 @@ +

    HTTP/404: Page not found

    +

    Action {$MESSAGE} you were looking for couldn't be found on this server.

    \ No newline at end of file diff --git a/application/views/mobile/index.tpl b/application/views/mobile/index.tpl new file mode 100644 index 0000000..e69de29 diff --git a/application/views/mobile/mumvc/index.tpl b/application/views/mobile/mumvc/index.tpl new file mode 100644 index 0000000..424a70e --- /dev/null +++ b/application/views/mobile/mumvc/index.tpl @@ -0,0 +1,21 @@ +

    About μMVC

    +

    μMVC as it is at the moment +

    Features

    + +

    Missing features

    +

    Features that won't be missed.

    + +

    Filosophy Methodology

    +

    Code

    + +

    Team

    +

    Please see team page.

    \ No newline at end of file diff --git a/application/views/mobile/mumvc/rhmvc.tpl b/application/views/mobile/mumvc/rhmvc.tpl new file mode 100644 index 0000000..e69de29 diff --git a/application/views/mobile/mumvc/team.tpl b/application/views/mobile/mumvc/team.tpl new file mode 100644 index 0000000..83bb978 --- /dev/null +++ b/application/views/mobile/mumvc/team.tpl @@ -0,0 +1,2 @@ +

    μMVC Team

    +

    Project leader:

    Alexey Serikov Kompaniets < kompadre@gmail.com > \ No newline at end of file diff --git a/application/views/mumvc/index.tpl b/application/views/mumvc/index.tpl index 6380826..86a33bd 100644 --- a/application/views/mumvc/index.tpl +++ b/application/views/mumvc/index.tpl @@ -1,6 +1,16 @@ -

    About μMVC -

    Methodology

    -

    Filosophy

    +

    About μMVC

    +

    μMVC as it is at the moment +

    Features

    + +

    Missing features

    +

    Features that won't be missed.

    + +

    The following is a shortlist of features that +

    Filosophy Methodology

    Code