| 103 |
- |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************
|
|
|
4 |
* Copyright (C) 2009-2011 by Geo Varghese(www.seopanel.in) *
|
|
|
5 |
* sendtogeo@gmail.com *
|
|
|
6 |
* *
|
|
|
7 |
* This program is free software; you can redistribute it and/or modify *
|
|
|
8 |
* it under the terms of the GNU General Public License as published by *
|
|
|
9 |
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
10 |
* (at your option) any later version. *
|
|
|
11 |
* *
|
|
|
12 |
* This program is distributed in the hope that it will be useful, *
|
|
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
15 |
* GNU General Public License for more details. *
|
|
|
16 |
* *
|
|
|
17 |
* You should have received a copy of the GNU General Public License *
|
|
|
18 |
* along with this program; if not, write to the *
|
|
|
19 |
* Free Software Foundation, Inc., *
|
|
|
20 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
21 |
***************************************************************************/
|
|
|
22 |
|
|
|
23 |
# class defines all language controller functions
|
|
|
24 |
class LanguageController extends Controller{
|
|
|
25 |
|
|
|
26 |
# func to get all Languages
|
|
|
27 |
function __getAllLanguages($where=''){
|
|
|
28 |
$sql = "select * from languages";
|
|
|
29 |
if (!empty($where)) $sql .= $where;
|
|
|
30 |
$sql .= " order by lang_name";
|
|
|
31 |
$langList = $this->db->select($sql);
|
|
|
32 |
return $langList;
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
# fun to create resdirect url
|
|
|
36 |
function getRedirectUrl() {
|
|
|
37 |
$currUrl = getCurrentUrl();
|
|
|
38 |
if (!stristr($currUrl, '?')) {
|
|
|
39 |
$currUrl .= "?";
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
$currUrl = preg_replace('/&lang_code=\w{2}$|&lang_code=\w{2}&/i', '', $currUrl, 1, $count);
|
|
|
43 |
return $currUrl;
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
# func to get language info
|
|
|
47 |
function __getLanguageInfo($langCode) {
|
|
|
48 |
$sql = "select * from languages where lang_code='$langCode'";
|
|
|
49 |
$langInfo = $this->db->select($sql, true);
|
|
|
50 |
return $langInfo;
|
|
|
51 |
}
|
|
|
52 |
}
|
|
|
53 |
?>
|