Revision 1796
Added by Dietmar about 12 years ago
class.wb.php | ||
---|---|---|
45 | 45 |
*/ |
46 | 46 |
public function GetLanguagesDetailsInUsed ( ) { |
47 | 47 |
global $database; |
48 |
$retVal = array();
|
|
48 |
$aRetval = array();
|
|
49 | 49 |
$sql = |
50 | 50 |
'SELECT DISTINCT `language`'. |
51 | 51 |
', `page_id`,`level`,`parent`,`root_parent`,`page_code`,`link`,`language`'. |
... | ... | |
63 | 63 |
while($page = $oRes->fetchRow(MYSQL_ASSOC)) |
64 | 64 |
{ |
65 | 65 |
if(!$this->page_is_visible($page)) {continue;} |
66 |
$retVal[$page['language']] = $page;
|
|
66 |
$aRetval[$page['language']] = $page;
|
|
67 | 67 |
} |
68 | 68 |
} |
69 |
return $retVal;
|
|
69 |
return $aRetval;
|
|
70 | 70 |
} |
71 | 71 |
|
72 | 72 |
/** |
... | ... | |
76 | 76 |
* |
77 | 77 |
*/ |
78 | 78 |
public function GetLanguagesInUsed ( ) { |
79 |
global $database; |
|
80 |
$retVal = ''; |
|
81 |
$page = array(); |
|
82 |
$sql = |
|
83 |
'SELECT DISTINCT `language`'. |
|
84 |
', `page_id`,`level`,`parent`,`root_parent`,`page_code`,`link`,`language`'. |
|
85 |
', `visibility`,`viewing_groups`,`viewing_users`,`position` '. |
|
86 |
'FROM `'.TABLE_PREFIX.'pages` '. |
|
87 |
'WHERE `level`= \'0\' '. |
|
88 |
'AND `root_parent`=`page_id` '. |
|
89 |
'AND `visibility`!=\'none\' '. |
|
90 |
'AND `visibility`!=\'hidden\' '. |
|
91 |
'GROUP BY `language` '. |
|
92 |
'ORDER BY `position`'; |
|
79 |
return implode(',', array_keys($this->GetLanguagesDetailsInUsed())); |
|
80 |
} |
|
93 | 81 |
|
94 |
if($oRes = $database->query($sql)) |
|
95 |
{ |
|
96 |
while($page = $oRes->fetchRow(MYSQL_ASSOC)) |
|
97 |
{ |
|
98 |
if(!$this->page_is_visible($page)) {continue;} |
|
99 |
$retVal .= $page['language'].','; |
|
100 |
} |
|
101 |
} |
|
102 |
return trim($retVal,','); |
|
103 |
} |
|
104 | 82 |
|
105 |
|
|
106 | 83 |
/* **************** |
107 | 84 |
* check if one or more group_ids are in both group_lists |
108 | 85 |
* |
Also available in: Unified diff
! supress frontend preferences, if user have no permission for it