diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-12-14 15:59:54 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-12-14 15:59:54 +0000 |
commit | 805b61328629813aad77c2e0f935e31cb381e500 (patch) | |
tree | 6f7fbd10bec359516b9dddb437e6472baa1ba431 | |
parent | f49ae662a10351e84e97aebd15394df5a591898f (diff) |
added the first view files of the mobile version
-rw-r--r-- | h-source/Application/Controllers/BaseController.php | 4 | ||||
-rw-r--r-- | h-source/Application/Hooks/BeforeChecks.php | 8 | ||||
-rw-r--r-- | h-source/Application/Include/version.php | 33 | ||||
-rw-r--r-- | h-source/Application/Views/Mobile/Home/left.php | 36 | ||||
-rw-r--r-- | h-source/Application/Views/Mobile/Home/left_es.php | 33 | ||||
-rw-r--r-- | h-source/Application/Views/Mobile/Home/left_fr.php | 32 | ||||
-rw-r--r-- | h-source/Application/Views/Mobile/Home/left_it.php | 32 | ||||
-rw-r--r-- | h-source/Application/Views/Mobile/footer.php | 40 | ||||
-rw-r--r-- | h-source/Application/Views/Mobile/header.php | 69 | ||||
-rw-r--r-- | h-source/Application/Views/Mobile/right.php | 21 |
10 files changed, 304 insertions, 4 deletions
diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php index 756316a..260d6dc 100644 --- a/h-source/Application/Controllers/BaseController.php +++ b/h-source/Application/Controllers/BaseController.php @@ -102,7 +102,9 @@ class BaseController extends Controller //set desktop or mobile version Version::set(); //subfolder of the Views folder where to look for view files - Params::$viewSubfolder = "Desktop"; + Params::$viewSubfolder = Version::getViewSubfolder(); + + $data['tm'] = $this->_topMenuClasses; diff --git a/h-source/Application/Hooks/BeforeChecks.php b/h-source/Application/Hooks/BeforeChecks.php index 03ee247..01ca8c5 100644 --- a/h-source/Application/Hooks/BeforeChecks.php +++ b/h-source/Application/Hooks/BeforeChecks.php @@ -13,4 +13,10 @@ if (!defined('EG')) die('Direct access not allowed!'); Params::$htmlentititiesCharset = "UTF-8"; -Params::$allowedSanitizeFunc .= ",sanitizeString,sanitizeAlphanum";
\ No newline at end of file +Params::$allowedSanitizeFunc .= ",sanitizeString,sanitizeAlphanum"; + + +if (Version::get() === 'mobile') +{ + Route::$allowed = Version::$mobileAllowed; +}
\ No newline at end of file diff --git a/h-source/Application/Include/version.php b/h-source/Application/Include/version.php index 49afa96..d0e3928 100644 --- a/h-source/Application/Include/version.php +++ b/h-source/Application/Include/version.php @@ -24,11 +24,40 @@ if (!defined('EG')) die('Direct access not allowed!'); class Version { - public static function is() + public static $mobileAllowed = array( + 'home,index', + ); + + //get the subfolder of the Views folder where to look for the view files + public static function getViewSubfolder() + { + $type = self::get(); + + if ($type === 'mobile') + { + return 'Mobile'; + } + return 'Desktop'; + } + + //get the type of version: desktop or mobile + public static function get() { - return false; + if (isset($_COOKIE['version'])) + { + if (strcmp($_COOKIE['version'],'mobile') === 0) + { + return 'mobile'; + } + else if (strcmp($_COOKIE['version'],'desktop') === 0) + { + return 'desktop'; + } + } + return 'desktop'; } + //set the version public static function set() { if (isset($_GET['version'])) diff --git a/h-source/Application/Views/Mobile/Home/left.php b/h-source/Application/Views/Mobile/Home/left.php new file mode 100644 index 0000000..ea43b56 --- /dev/null +++ b/h-source/Application/Views/Mobile/Home/left.php @@ -0,0 +1,36 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> + +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?> + + <div data-role="content"> + + <div class="position_tree_box"> + Home + </div> + + <?php echo $htmlNewsBox;?> + + <p>it works!!</p> + + <p>modify the file <b>Application/Views/Home/left.php</b> in order to change the english version of your homepage</p> + + <p>modify the file <b>Application/Include/languages.php</b> in order to add new languages</p> + </div> diff --git a/h-source/Application/Views/Mobile/Home/left_es.php b/h-source/Application/Views/Mobile/Home/left_es.php new file mode 100644 index 0000000..3350599 --- /dev/null +++ b/h-source/Application/Views/Mobile/Home/left_es.php @@ -0,0 +1,33 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> + +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?> + + <div id="left"> + + <div class="position_tree_box"> + Home + </div> + + <?php echo $htmlNewsBox;?> + + + + </div> diff --git a/h-source/Application/Views/Mobile/Home/left_fr.php b/h-source/Application/Views/Mobile/Home/left_fr.php new file mode 100644 index 0000000..c69674d --- /dev/null +++ b/h-source/Application/Views/Mobile/Home/left_fr.php @@ -0,0 +1,32 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> + +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?> + + <div id="left"> + + <div class="position_tree_box"> + Home + </div> + + <?php echo $htmlNewsBox;?> + + + </div> diff --git a/h-source/Application/Views/Mobile/Home/left_it.php b/h-source/Application/Views/Mobile/Home/left_it.php new file mode 100644 index 0000000..c69674d --- /dev/null +++ b/h-source/Application/Views/Mobile/Home/left_it.php @@ -0,0 +1,32 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> + +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?> + + <div id="left"> + + <div class="position_tree_box"> + Home + </div> + + <?php echo $htmlNewsBox;?> + + + </div> diff --git a/h-source/Application/Views/Mobile/footer.php b/h-source/Application/Views/Mobile/footer.php new file mode 100644 index 0000000..c49ad4b --- /dev/null +++ b/h-source/Application/Views/Mobile/footer.php @@ -0,0 +1,40 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> + +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?> + + <div data-role="footer"> + <div class="copyright_notice_box"> + The <a href="<?php echo $this->baseUrl."/project/index/$lang";?>"><?php echo Website::$projectName;?></a> Project + </div> + + <div class="footer_credits_box"> + <a href="<?php echo $this->baseUrl."/credits/index/$lang";?>">credits</a> + </div> + + <div class="footer_credits_box"> + <a href="<?php echo $this->baseUrl."/contact/index/$lang";?>">contact</a> + </div> + </div> <!--fine footer--> + +</div> <!--fine page--> + +</body> +</html> diff --git a/h-source/Application/Views/Mobile/header.php b/h-source/Application/Views/Mobile/header.php new file mode 100644 index 0000000..474ff4a --- /dev/null +++ b/h-source/Application/Views/Mobile/header.php @@ -0,0 +1,69 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> +<!DOCTYPE html> +<html> +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?> +<?php +$u = new UsersModel(); +$hw = new HardwareModel(); +$wiki = new WikiModel(); +$translations = array('insert'=>'inserted','update'=>'updated'); +$currPos = $querySanitized ? $this->controller."/".$this->action : 'home/index'; +?> +<head> + + <title><?php echo $title;?></title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <meta name="description" content="free software project with the aim of collecting information about the hardware that works with a fully free operating system" /> + <meta name="keywords" content="hardware database free software GNU Linux distribution wiki users freedom" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> + + <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl?>/Public/Css/main.css"> + <link rel="Shortcut Icon" href="<?php echo $this->baseUrl?>/Public/Img/tab_icon_2.ico" type="image/x-icon"> + + + <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl;?>/Public/Js/jquery/jquery.mobile-1.0.css"> + <script type="text/javascript" src="<?php echo $this->baseUrl;?>/Public/Js/jquery/jquery-1.7.1.min.js"></script> + <script type="text/javascript" src="<?php echo $this->baseUrl;?>/Public/Js/jquery/jquery.mobile-1.0.min.js"></script> + + <script type="text/javascript" src="<?php echo $this->baseUrl;?>/Public/Js/functions.js"></script> + + <script type="text/javascript"> + + var base_url = "<?php echo $this->baseUrl;?>"; + var curr_lang = "<?php echo $lang;?>"; + var csrf_token = "<?php echo $token;?>"; + + $(document).ready(function() { + + animateTabs(curr_lang); + + }); + + </script> + +</head> +<body> + + +<div data-role="page"> + <div data-role="header"> + <img src="<?php echo $this->baseUrl;?>/Public/Img/title.png"> + </div> diff --git a/h-source/Application/Views/Mobile/right.php b/h-source/Application/Views/Mobile/right.php new file mode 100644 index 0000000..47e9af9 --- /dev/null +++ b/h-source/Application/Views/Mobile/right.php @@ -0,0 +1,21 @@ +<?php if (!defined('EG')) die('Direct access not allowed!'); ?> + +<?php +// h-source, a web software to build a community of people that want to share their hardware information. +// Copyright (C) 2010 Antonio Gallo (h-source-copyright.txt) +// +// This file is part of h-source +// +// h-source is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// h-source is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with h-source. If not, see <http://www.gnu.org/licenses/>. +?>
\ No newline at end of file |