Revision 1953
Added by darkviper over 12 years ago
| branches/2.8.x/CHANGELOG | ||
|---|---|---|
| 11 | 11 |
! = Update/Change |
| 12 | 12 |
=============================================================================== |
| 13 | 13 |
|
| 14 |
14 Aug-2013 Build 1953 M.v.d.Decken(DarkViper) |
|
| 15 |
# solved some problems with MultiLingual module |
|
| 14 | 16 |
12 Aug-2013 Build 1952 M.v.d.Decken(DarkViper) |
| 15 | 17 |
# solved an autoloading problem on upgrade in /framework/Password.php |
| 16 | 18 |
09 Aug-2013 Build 1951 M.v.d.Decken(DarkViper) |
| branches/2.8.x/wb/admin/skel/themes/htt/pages_settings.htt | ||
|---|---|---|
| 2 | 2 |
<script src="{WB_URL}/include/jquery/overlib_mini.js" type="text/javascript"></script>
|
| 3 | 3 |
<script src="{ADMIN_URL}/pages/page_settings.js" type="text/javascript"></script>
|
| 4 | 4 |
<div class="page-info"> |
| 5 |
<table> |
|
| 6 |
<thead> |
|
| 7 |
<tr>
|
|
| 8 |
<th class="description"></th>
|
|
| 9 |
<th class="id"></th>
|
|
| 10 |
<th></th>
|
|
| 11 |
</tr>
|
|
| 12 |
</thead> |
|
| 13 |
<tbody> |
|
| 14 |
<tr>
|
|
| 15 |
<td class="left nowrap"><h2>{HEADING_MODIFY_PAGE_SETTINGS}</h2></td>
|
|
| 16 |
<td class="left">PID: {PAGE_ID}</td>
|
|
| 17 |
<td class="right nowrap"> |
|
| 18 |
{TEXT_CURRENT_PAGE}:<strong>{PAGE_TITLE}</strong><br />
|
|
| 19 |
{MODIFY_LINK_BEFORE}{TEXT_MODIFY_PAGE}{MODIFY_LINK_AFTER}
|
|
| 20 |
<span class="{DISPLAY_MANAGE_SECTIONS}">
|
|
| 21 |
- {SECTIONS_LINK_BEFORE}{TEXT_MANAGE_SECTIONS}{SECTIONS_LINK_AFTER}
|
|
| 22 |
</span> |
|
| 23 |
<br /> |
|
| 24 |
<span class="right {DISPLAY_MODIFIED}">
|
|
| 25 |
{TEXT_LAST_MODIFIED} {MODIFIED_BY}, {MODIFIED_WHEN}
|
|
| 26 |
</span> |
|
| 27 |
</td> |
|
| 28 |
</tr>
|
|
| 29 |
</tbody> |
|
| 30 |
</table> |
|
| 5 |
<table>
|
|
| 6 |
<thead>
|
|
| 7 |
<tr>
|
|
| 8 |
<th class="description"></th>
|
|
| 9 |
<th class="id"></th>
|
|
| 10 |
<th></th>
|
|
| 11 |
</tr>
|
|
| 12 |
</thead>
|
|
| 13 |
<tbody>
|
|
| 14 |
<tr>
|
|
| 15 |
<td class="left nowrap"><h2>{HEADING_MODIFY_PAGE_SETTINGS}</h2></td>
|
|
| 16 |
<td class="left">PID: {PAGE_ID}</td>
|
|
| 17 |
<td class="right nowrap">
|
|
| 18 |
{TEXT_CURRENT_PAGE}:<strong>{PAGE_TITLE}</strong><br />
|
|
| 19 |
{MODIFY_LINK_BEFORE}{TEXT_MODIFY_PAGE}{MODIFY_LINK_AFTER}
|
|
| 20 |
<span class="{DISPLAY_MANAGE_SECTIONS}">
|
|
| 21 |
- {SECTIONS_LINK_BEFORE}{TEXT_MANAGE_SECTIONS}{SECTIONS_LINK_AFTER}
|
|
| 22 |
</span>
|
|
| 23 |
<br />
|
|
| 24 |
<span class="right {DISPLAY_MODIFIED}">
|
|
| 25 |
{TEXT_LAST_MODIFIED} {MODIFIED_BY}, {MODIFIED_WHEN}
|
|
| 26 |
</span>
|
|
| 27 |
</td>
|
|
| 28 |
</tr>
|
|
| 29 |
</tbody>
|
|
| 30 |
</table>
|
|
| 31 | 31 |
</div> |
| 32 | 32 |
|
| 33 | 33 |
<form name="settings" action="settings_save.php" method="post"> |
| ... | ... | |
| 149 | 149 |
<!-- BEGIN show_page_code_block --> |
| 150 | 150 |
<div> |
| 151 | 151 |
<label for="page_code" class="overlib" |
| 152 |
style="background-image: url({THEME_URL}/icons/help_16.png);"
|
|
| 153 |
{p_menu_page_code}>{TEXT_PAGE_CODE}:
|
|
| 152 |
style="background-image: url({THEME_URL}/icons/help_16.png);" {p_menu_page_code}>
|
|
| 153 |
<a href="{PAGE_CODE_UPDATE_URL}">{PAGE_CODE_LABEL_TEXT}: </a>
|
|
| 154 | 154 |
</label> |
| 155 | 155 |
<select id="page_code" name="page_code" class="value_page_code"> |
| 156 | 156 |
<!-- BEGIN page_code_list_block --> |
| 157 |
<option value="{VALUE}"{SELECTED} style="background: {FLAG_CODE_ICON} no-repeat center left; padding-left: 20px;"> {PAGE_VALUE}</option>
|
|
| 157 |
<option value="{PAGE_CODE_VALUE}"{PAGE_CODE_SELECTED} style="background: {PAGE_CODE_ICON_URL} no-repeat center left; padding-left: 20px;">
|
|
| 158 |
{PAGE_CODE_PAGE_TITLE}
|
|
| 159 |
</option> |
|
| 158 | 160 |
<!-- END page_code_list_block --> |
| 159 | 161 |
</select> |
| 160 | 162 |
</div> |
| branches/2.8.x/wb/admin/pages/PageTree.php | ||
|---|---|---|
| 34 | 34 |
class a_pages_PageTree |
| 35 | 35 |
{
|
| 36 | 36 |
/** @var array language definitions */ |
| 37 |
private $_TEXT = null;
|
|
| 37 |
protected $_TEXT = null;
|
|
| 38 | 38 |
/** @var array language definitions */ |
| 39 |
private $_MESSAGE = null;
|
|
| 39 |
protected $_MESSAGE = null;
|
|
| 40 | 40 |
/** @var array language definitions */ |
| 41 |
private $_HEADING = null;
|
|
| 41 |
protected $_HEADING = null;
|
|
| 42 | 42 |
/** @var object instance of the application object */ |
| 43 |
private $_oApp = null;
|
|
| 43 |
protected $_oApp = null;
|
|
| 44 | 44 |
/** @var object instance of the database object */ |
| 45 |
private $_oDb = null;
|
|
| 45 |
protected $_oDb = null;
|
|
| 46 | 46 |
/** @var array holds several values from the application global scope */ |
| 47 |
private $_aReg = array();
|
|
| 47 |
protected $_aReg = array();
|
|
| 48 | 48 |
/** @var string full HTML formattet list of pages */ |
| 49 |
private $_sOutput = '';
|
|
| 49 |
protected $_sOutput = '';
|
|
| 50 | 50 |
/** @var integer number of all reachable pages */ |
| 51 |
private $_iPagesTotal = 0;
|
|
| 51 |
protected $_iPagesTotal = 0;
|
|
| 52 | 52 |
/** @var integer number of all writeable pages */ |
| 53 |
private $_iPagesWriteable = 0;
|
|
| 53 |
protected $_iPagesWriteable = 0;
|
|
| 54 | 54 |
/** @var integer index for toggle background color of the list */ |
| 55 |
private $_iLineColor = 0;
|
|
| 55 |
protected $_iLineColor = 0;
|
|
| 56 | 56 |
/** @var array entries to build a select list for parents */ |
| 57 |
private $_aParentList = array();
|
|
| 57 |
protected $_aParentList = array();
|
|
| 58 | 58 |
/** @var integer count all executed database requests passing all iterations. */ |
| 59 |
private $_queries = 0;
|
|
| 59 |
protected $_queries = 0;
|
|
| 60 | 60 |
/** |
| 61 | 61 |
* constructor used to import some application constants and objects |
| 62 | 62 |
*/ |
| ... | ... | |
| 98 | 98 |
* a list with all possible parent pages |
| 99 | 99 |
* @return array |
| 100 | 100 |
*/ |
| 101 |
public function getParentList() {
|
|
| 101 |
public function getParentList($iTreeRoot = 0) {
|
|
| 102 | 102 |
if(!$this->_sOutput) {
|
| 103 |
$this->parseTree(); |
|
| 103 |
$this->parseTree($iTreeRoot);
|
|
| 104 | 104 |
} |
| 105 | 105 |
return $this->_aParentList; |
| 106 | 106 |
} |
| 107 | 107 |
/** |
| 108 | 108 |
* used to import some WB-constants and objects |
| 109 | 109 |
*/ |
| 110 |
private function _wbAdaptor()
|
|
| 110 |
protected function _wbAdaptor()
|
|
| 111 | 111 |
{
|
| 112 | 112 |
$this->_TEXT = $GLOBALS['TEXT']; |
| 113 | 113 |
$this->_MESSAGE = $GLOBALS['MESSAGE']; |
| ... | ... | |
| 129 | 129 |
* @param int use page-ID as root of the generated page tree. (default: 0) |
| 130 | 130 |
* @return string the whoole list |
| 131 | 131 |
*/ |
| 132 |
private function _createTree($iTreeRoot = 0)
|
|
| 132 |
protected function _createTree($iTreeRoot = 0)
|
|
| 133 | 133 |
{
|
| 134 | 134 |
// compose the complete list |
| 135 | 135 |
$sOutput = '' |
| ... | ... | |
| 167 | 167 |
* @param bool $bRelative false if should be set to absolute value |
| 168 | 168 |
* @return string |
| 169 | 169 |
*/ |
| 170 |
private function _Tabs($iTabsDiv = 0, $bRelative = true)
|
|
| 170 |
protected function _Tabs($iTabsDiv = 0, $bRelative = true)
|
|
| 171 | 171 |
{
|
| 172 | 172 |
static $iTabLevel = 0; |
| 173 | 173 |
$iTabLevel = ($bRelative ? $iTabLevel + $iTabsDiv : $iTabsDiv); |
| ... | ... | |
| 179 | 179 |
* @param integer $iParentKey |
| 180 | 180 |
* @return string SQL statement |
| 181 | 181 |
*/ |
| 182 |
private function _makeSql($iParentKey = 0)
|
|
| 182 |
protected function _makeSql($iParentKey = 0)
|
|
| 183 | 183 |
{
|
| 184 |
$sql = 'SELECT ( SELECT COUNT(*) ' |
|
| 185 |
. 'FROM `'.$this->_aReg['TABLE_PREFIX'].'pages` `x` ' |
|
| 186 |
. 'WHERE x.`parent`=p.`page_id`' |
|
| 187 |
. ') `children`, ' |
|
| 188 |
. 's.`module`, MAX(s.`publ_start` + s.`publ_end`) published, p.`link`, ' |
|
| 189 |
. '(SELECT MAX(`position`) FROM `'.$this->_aReg['TABLE_PREFIX'].'pages` ' |
|
| 190 |
. 'WHERE `parent`='.$iParentKey.') max_position, ' |
|
| 191 |
. '0 min_position, ' |
|
| 192 |
. 'p.`position`, ' |
|
| 193 |
. 'p.`page_id`, p.`parent`, p.`level`, p.`language`, p.`admin_groups`, ' |
|
| 194 |
. 'p.`admin_users`, p.`viewing_groups`, p.`viewing_users`, p.`visibility`, ' |
|
| 195 |
. 'p.`menu_title`, p.`page_title`, p.`page_trail` ' |
|
| 196 |
. 'FROM `'.$this->_aReg['TABLE_PREFIX'].'pages` p ' |
|
| 197 |
. 'INNER JOIN `'.$this->_aReg['TABLE_PREFIX'].'sections` s ' |
|
| 198 |
. 'ON p.`page_id`=s.`page_id` '; |
|
| 199 |
// if($iParentKey) {
|
|
| 200 |
// |
|
| 201 |
// $sql .= 'WHERE `root_parent`='.$iParentKey.' '; |
|
| 202 |
// } else {
|
|
| 203 |
// // if tree based on root is requested (parent=0) |
|
| 204 |
$sql .= 'WHERE `parent`='.$iParentKey.' '; |
|
| 205 |
// } |
|
| 206 |
// do not get pages with 'deleted' flag set on activated trashcan |
|
| 184 | 207 |
if($this->_aReg['PAGE_TRASH'] != 'inline') {
|
| 185 |
$sUseTrash = ' AND `visibility`!=\'deleted\''; |
|
| 186 |
}else { $sUseTrash = ''; }
|
|
| 187 |
$sql = 'SELECT ( SELECT COUNT(*) ' |
|
| 188 |
. 'FROM `'.$this->_aReg['TABLE_PREFIX'].'pages` `x` ' |
|
| 189 |
. 'WHERE x.`parent`=p.`page_id`' |
|
| 190 |
. ') `children`, ' |
|
| 191 |
. 's.`module`, MAX(s.`publ_start` + s.`publ_end`) published, p.`link`, ' |
|
| 192 |
. '(SELECT MAX(`position`) FROM `'.$this->_aReg['TABLE_PREFIX'].'pages` ' |
|
| 193 |
. 'WHERE `parent`='.$iParentKey.') max_position, ' |
|
| 194 |
. '0 min_position, ' |
|
| 195 |
. 'p.`position`, ' |
|
| 196 |
. 'p.`page_id`, p.`parent`, p.`level`, p.`language`, p.`admin_groups`, ' |
|
| 197 |
. 'p.`admin_users`, p.`viewing_groups`, p.`viewing_users`, p.`visibility`, ' |
|
| 198 |
. 'p.`menu_title`, p.`page_title`, p.`page_trail` ' |
|
| 199 |
. 'FROM `'.$this->_aReg['TABLE_PREFIX'].'pages` p ' |
|
| 200 |
. 'INNER JOIN `'.$this->_aReg['TABLE_PREFIX'].'sections` s ' |
|
| 201 |
. 'ON p.`page_id`=s.`page_id` ' |
|
| 202 |
. 'WHERE `parent`='.$iParentKey.$sUseTrash.' ' |
|
| 203 |
. 'GROUP BY p.`page_id` ' |
|
| 204 |
. 'ORDER BY p.`position` ASC'; |
|
| 208 |
$sql .= 'AND `visibility`!=\'deleted\' '; |
|
| 209 |
} |
|
| 210 |
$sql .= 'GROUP BY p.`page_id` ' |
|
| 211 |
. 'ORDER BY p.`position` ASC'; |
|
| 205 | 212 |
return $sql; |
| 206 | 213 |
} |
| 207 | 214 |
/** |
| ... | ... | |
| 209 | 216 |
* @param integer start iteration from this parent page ( 0 = root) |
| 210 | 217 |
* @return string all of the item lines |
| 211 | 218 |
*/ |
| 212 |
private function _IterateTree($iParent = 0)
|
|
| 219 |
protected function _IterateTree($iParent = 0)
|
|
| 213 | 220 |
{
|
| 214 | 221 |
$sOutput = ''; |
| 215 | 222 |
// Get page list from database |
| ... | ... | |
| 261 | 268 |
* @param type $aPage |
| 262 | 269 |
* @return string |
| 263 | 270 |
*/ |
| 264 |
private function _createListItem($aPage)
|
|
| 271 |
protected function _createListItem($aPage)
|
|
| 265 | 272 |
{
|
| 266 | 273 |
// output the current item |
| 267 | 274 |
// --- HEADER ------------------------------------------------------------------------ |
| ... | ... | |
| 428 | 435 |
* build a list of possible parent pages |
| 429 | 436 |
* @param array $aPage |
| 430 | 437 |
*/ |
| 431 |
private function _addToParentList(array $aPage)
|
|
| 438 |
protected function _addToParentList(array $aPage)
|
|
| 432 | 439 |
{
|
| 433 | 440 |
if( ($aPage['level'] < ($this->_aReg['PAGE_LEVEL_LIMIT'] - 1)) |
| 434 | 441 |
&& $aPage['iswriteable'] |
| 435 | 442 |
&& ($aPage['visibility'] != 'deleted') |
| 436 | 443 |
&& $this->_oApp->get_permission('pages_add') )
|
| 437 | 444 |
{
|
| 438 |
$aNewEntry = array(); |
|
| 439 |
$aNewEntry['ID'] = $aPage['page_id']; |
|
| 440 |
$aNewEntry['TITLE'] = $aPage['menu_title']; |
|
| 441 |
$aNewEntry['DISABLED'] = ($aPage['iswriteable'] ? 0 : 1); |
|
| 442 |
$aNewEntry['PARENT'] = $aPage['parent']; |
|
| 443 |
$aNewEntry['FLAG_ROOT_ICON'] = ''; |
|
| 444 |
$aNewEntry['LEVEL'] = $aPage['level']; |
|
| 445 |
$aNewEntry['LANGUAGE'] = $aPage['language']; |
|
| 446 |
$this->_aParentList[] = $aNewEntry; |
|
| 445 |
$aPage['disabled'] = ($aPage['iswriteable'] ? 0 : 1); |
|
| 446 |
$this->_aParentList[] = $aPage; |
|
| 447 | 447 |
} |
| 448 | 448 |
} |
| 449 | 449 |
|
| branches/2.8.x/wb/admin/pages/SmallRawPageTree.php | ||
|---|---|---|
| 1 |
<?php |
|
| 2 |
|
|
| 3 |
/** |
|
| 4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
|
| 5 |
* |
|
| 6 |
* This program is free software: you can redistribute it and/or modify |
|
| 7 |
* it under the terms of the GNU General Public License as published by |
|
| 8 |
* the Free Software Foundation, either version 3 of the License, or |
|
| 9 |
* (at your option) any later version. |
|
| 10 |
* |
|
| 11 |
* This program is distributed in the hope that it will be useful, |
|
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 14 |
* GNU General Public License for more details. |
|
| 15 |
* |
|
| 16 |
* You should have received a copy of the GNU General Public License |
|
| 17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 18 |
*/ |
|
| 19 |
|
|
| 20 |
/** |
|
| 21 |
* ParentPageTree.php |
|
| 22 |
* |
|
| 23 |
* @category WbACP |
|
| 24 |
* @package WbACP_Pages |
|
| 25 |
* @copyright Manuela v.d.Decken <manuela@isteam.de> |
|
| 26 |
* @author Manuela v.d.Decken <manuela@isteam.de> |
|
| 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
|
| 28 |
* @version 0.0.1 |
|
| 29 |
* @revision $Revision: $ |
|
| 30 |
* @link $HeadURL: $ |
|
| 31 |
* @lastmodified $Date: $ |
|
| 32 |
* @since File available since 05.08.2013 |
|
| 33 |
* @description xyz |
|
| 34 |
*/ |
|
| 35 |
|
|
| 36 |
class a_pages_SmallRawPageTree extends a_pages_PageTree{
|
|
| 37 |
|
|
| 38 |
/** |
|
| 39 |
* create a page tree as a well formatted, unordered list |
|
| 40 |
* @param int use page-ID as root of the generated page tree. (default: 0) |
|
| 41 |
* @return string the whoole list |
|
| 42 |
*/ |
|
| 43 |
protected function _createTree($iTreeRoot = 0) |
|
| 44 |
{
|
|
| 45 |
// generate the page lines |
|
| 46 |
$this->_IterateTree($iTreeRoot); |
|
| 47 |
return ''; |
|
| 48 |
} |
|
| 49 |
/** |
|
| 50 |
* iterate through all nodes which having subnodes |
|
| 51 |
* @param integer start iteration from this parent page ( 0 = root) |
|
| 52 |
* @return string all of the item lines |
|
| 53 |
*/ |
|
| 54 |
protected function _IterateTree($iParent = 0) |
|
| 55 |
{
|
|
| 56 |
$sOutput = ''; |
|
| 57 |
// Get page list from database |
|
| 58 |
if(($oPages = $this->_oDb->query($this->_makeSql($iParent)))) |
|
| 59 |
{
|
|
| 60 |
$this->_queries++; |
|
| 61 |
$iMinPosition = 1; |
|
| 62 |
while($aPage = $oPages->fetchRow(MYSQL_ASSOC)) |
|
| 63 |
{ // iterate through the current branch
|
|
| 64 |
if($this->_aReg['PAGE_LEVEL_LIMIT'] && ($aPage['level'] > $this->_aReg['PAGE_LEVEL_LIMIT'])) {
|
|
| 65 |
return ''; |
|
| 66 |
} |
|
| 67 |
$aPage['min_position'] = ($aPage['position'] < $iMinPosition ? $aPage['position'] : $iMinPosition); |
|
| 68 |
$this->_iLineColor = $this->_iPagesTotal++ % 2; |
|
| 69 |
$aPage['iswriteable'] = false; |
|
| 70 |
if( $this->_oApp->ami_group_member($aPage['admin_users']) || |
|
| 71 |
$this->_oApp->is_group_match($this->_oApp->get_groups_id(), $aPage['admin_groups'])) |
|
| 72 |
{
|
|
| 73 |
if(($aPage['visibility'] == 'deleted' && $this->_aReg['PAGE_TRASH'] == 'inline') || |
|
| 74 |
($aPage['visibility'] != 'deleted')) |
|
| 75 |
{
|
|
| 76 |
$aPage['iswriteable'] = true; |
|
| 77 |
$this->_iPagesWriteable++; |
|
| 78 |
} |
|
| 79 |
} else {
|
|
| 80 |
if($aPage['visibility'] == 'private') { continue; }
|
|
| 81 |
} |
|
| 82 |
// add this item to the secondary list of parents |
|
| 83 |
$this->_addToParentList($aPage); |
|
| 84 |
// if there are children, iterate through this children now |
|
| 85 |
if((bool)$aPage['children']) {
|
|
| 86 |
$this->_IterateTree($aPage['page_id']); |
|
| 87 |
} |
|
| 88 |
} |
|
| 89 |
} |
|
| 90 |
return $sOutput; |
|
| 91 |
} |
|
| 92 |
|
|
| 93 |
|
|
| 94 |
} // end of class LanguagePageTree |
|
| branches/2.8.x/wb/admin/pages/settings.php | ||
|---|---|---|
| 90 | 90 |
// $mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
| 91 | 91 |
$mLang = Translate::getinstance(); |
| 92 | 92 |
$mLang->enableAddon('admin\pages');
|
| 93 |
$oDb = WbDatabase::getInstance(); |
|
| 93 | 94 |
$sDisabled = ' disabled="disabled"'; |
| 94 | 95 |
$sSelected = ' selected="selected"'; |
| 95 | 96 |
$sChecked = ' checked="checked"'; |
| ... | ... | |
| 417 | 418 |
} else {
|
| 418 | 419 |
$oTpl->set_var('DISPLAY_VIEWERS', 'display:none;');
|
| 419 | 420 |
} |
| 420 |
/*-- start multilanguage page_code 20090904 --------------------------------------------*/ |
|
| 421 |
// Work-out if page languages feature is enabled |
|
| 421 |
/*-- start multilanguage page_code -----------------------------------------------------*/ |
|
| 422 | 422 |
$oTpl->set_block('main_block', 'show_page_code_block', 'show_page_code');
|
| 423 | 423 |
if( (defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) &&
|
| 424 | 424 |
isset($aCurrentPage['page_code']) && class_exists('m_MultiLingual_Lib'))
|
| 425 | 425 |
{
|
| 426 |
// workout field is set but module missing |
|
| 427 |
$oTpl->set_var('TEXT_PAGE_CODE',
|
|
| 428 |
'<a href="'.WB_URL.'/modules/MultiLingual/update_keys.php?page_id='.$page_id.'">'.$mLang->TEXT_PAGE_CODE.'</a>' |
|
| 429 |
); |
|
| 430 |
/*-- begin recursive function page_code list ---------------------------------------*/ |
|
| 431 |
function page_code_list($parent) |
|
| 432 |
{
|
|
| 433 |
global $admin, $database, $oTpl, $aCurrentPage, $pageCode; |
|
| 434 |
$default_language = DEFAULT_LANGUAGE; |
|
| 435 |
|
|
| 436 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'pages` ' |
|
| 437 |
. 'WHERE `parent`='.$parent.' AND `language`=\''.$default_language.'\' ' |
|
| 438 |
. 'ORDER BY `position` ASC'; |
|
| 439 |
$get_pages = $database->query($sql); |
|
| 440 |
|
|
| 441 |
while($page = $get_pages->fetchRow(MYSQL_ASSOC)) |
|
| 442 |
{
|
|
| 443 |
if(($admin->page_is_visible($page)==false) && ($page['visibility'] <> 'none') ) { continue; }
|
|
| 444 |
|
|
| 445 |
$oTpl->set_var('FLAG_CODE_ICON',' none ');
|
|
| 446 |
if( $page['parent'] == 0 ) |
|
| 447 |
{
|
|
| 448 |
$oTpl->set_var('FLAG_CODE_ICON','url('.THEME_URL.'/images/flags/'.strtolower($page['language']).'.png)');
|
|
| 449 |
} |
|
| 450 |
|
|
| 451 |
// If the current page cannot be parent, then its children neither |
|
| 452 |
$list_next_level = true; |
|
| 453 |
// Stop users from adding pages with a level of more than the set page level limit |
|
| 454 |
if($page['level']+1 < PAGE_LEVEL_LIMIT) |
|
| 455 |
{
|
|
| 456 |
$can_modify = ($admin->ami_group_member($page['admin_groups']) || |
|
| 457 |
$admin->is_group_match($admin->get_user_id(), $page['admin_users'])); |
|
| 458 |
$title_prefix = ''; |
|
| 459 |
for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - - '; }
|
|
| 460 |
// $space = str_repeat(' ', 3); $space.'<'..'>'
|
|
| 461 |
$oTpl->set_var(array( |
|
| 462 |
'VALUE' => intval($page['page_code']), |
|
| 463 |
'PAGE_VALUE' => $title_prefix.$page['menu_title'], |
|
| 464 |
'PAGE_CODE' => $title_prefix.$page['page_id'] |
|
| 465 |
) |
|
| 466 |
); |
|
| 467 |
if($aCurrentPage['page_code'] == $page['page_code']) |
|
| 468 |
{
|
|
| 469 |
$oTpl->set_var('SELECTED', ' selected="selected"');
|
|
| 470 |
} elseif($aCurrentPage['page_code'] == $page['page_code']) |
|
| 471 |
{
|
|
| 472 |
$oTpl->set_var('SELECTED', ' disabled="disabled" class="disabled"');
|
|
| 473 |
$list_next_level=false; |
|
| 474 |
} elseif($can_modify != true) |
|
| 475 |
{
|
|
| 476 |
$oTpl->set_var('SELECTED', ' disabled="disabled" class="disabled"');
|
|
| 477 |
} else {
|
|
| 478 |
$oTpl->set_var('SELECTED', '');
|
|
| 479 |
} |
|
| 480 |
$oTpl->parse('page_code_list', 'page_code_list_block', true);
|
|
| 481 |
} |
|
| 482 |
if ($list_next_level) |
|
| 483 |
page_code_list($page['page_id']); |
|
| 484 |
} |
|
| 426 |
$aTplBlockData = array(); |
|
| 427 |
// workout field is set but module missing |
|
| 428 |
$aTplBlockData['PAGE_CODE_LABEL_TEXT'] = $mLang->TEXT_PAGE_CODE; |
|
| 429 |
$aTplBlockData['PAGE_CODE_UPDATE_URL'] = WB_REL.'/modules/MultiLingual/update_keys.php?page_id='.$page_id; |
|
| 430 |
// get the root element(level 0) of current page with same language in same menu |
|
| 431 |
$sql = 'SELECT `page_id` FROM `'.$oDb->TablePrefix.'pages` ' |
|
| 432 |
. 'WHERE `language`=\''.DEFAULT_LANGUAGE.'\' ' |
|
| 433 |
. 'AND `level`=0 '; |
|
| 434 |
if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == 'true') {
|
|
| 435 |
$sql .= 'AND `menu`='.$aCurrentPage['menu'].' '; |
|
| 485 | 436 |
} |
| 486 |
/*-- end recursive function page_code list -----------------------------------------*/ |
|
| 487 |
// Insert code_page values from page to modify |
|
| 437 |
$sql .= 'ORDER BY `position` ASC'; |
|
| 438 |
$iLangStartPageId = $oDb->get_one($sql); |
|
| 439 |
// read the tree of the found root element |
|
| 440 |
$oPageList = new a_pages_SmallRawPageTree(); |
|
| 441 |
$aLangCodePagesList = $oPageList->getParentList($iLangStartPageId); |
|
| 442 |
// create option list for the select box |
|
| 488 | 443 |
$oTpl->set_block('show_page_code_block', 'page_code_list_block', 'page_code_list');
|
| 489 |
if($admin->get_permission('pages_add_l0') == true OR $aCurrentPage['level'] == 0) {
|
|
| 490 |
$selected = ($aCurrentPage['parent'] == 0 ? $sSelected : ''); |
|
| 491 |
$oTpl->set_var(array( |
|
| 492 |
'VALUE' => 0, |
|
| 493 |
'PAGE_CODE' => $mLang->TEXT_NONE, |
|
| 494 |
'PAGE_VALUE' => '', |
|
| 495 |
'SELECTED' => $selected |
|
| 496 |
) |
|
| 497 |
); |
|
| 444 |
$aTplItemData = array(); |
|
| 445 |
$bPageCodeIsSelected = false; |
|
| 446 |
// add 'no selection' option at top |
|
| 447 |
if($admin->get_permission('pages_add_l0') OR !$aCurrentPage['level'])
|
|
| 448 |
{
|
|
| 449 |
$aTplItemData['PAGE_CODE_VALUE'] = 0; |
|
| 450 |
$aTplItemData['PAGE_CODE_PAGE_TITLE'] = $mLang->TEXT_NONE; |
|
| 451 |
$bPageCodeIsSelected = ($aCurrentPage['page_code'] == 0); |
|
| 452 |
$aTplItemData['PAGE_CODE_SELECTED'] = ($bPageCodeIsSelected ? $sSelected : ''); |
|
| 453 |
$oTpl->set_var($aTplItemData); |
|
| 498 | 454 |
$oTpl->parse('page_code_list', 'page_code_list_block', true);
|
| 455 |
$aTplItemData = array(); |
|
| 499 | 456 |
} |
| 500 |
// get pagecode form this page_id |
|
| 501 |
page_code_list(0); |
|
| 457 |
$iLastEntryLevel = 0; |
|
| 458 |
$bSkipChildren = false; |
|
| 459 |
// loop through all items |
|
| 460 |
while (list(, $aPage) = each($aLangCodePagesList)) |
|
| 461 |
{
|
|
| 462 |
// skip child pages where current user has no rights for |
|
| 463 |
if($bSkipChildren && ($aPage['level'] > $iLastEntryLevel)) { continue; }
|
|
| 464 |
$bSkipChildren = false; |
|
| 465 |
$iLastEntryLevel = $aPage['level']; |
|
| 466 |
//skip entry if it's not visible |
|
| 467 |
if(($admin->page_is_visible($aPage)==false) && ($aPage['visibility'] <> 'none') ) { continue; }
|
|
| 468 |
// insert language flag on level 0 |
|
| 469 |
$sThemeRel = WB_REL.'/'.str_replace(WB_URL, '', THEME_URL).'/images/flags/'.strtolower($aPage['language']).'.png)'; |
|
| 470 |
$aTplItemData['PAGE_CODE_ICON_URL'] = ($aPage['level'] ? 'url('.$sThemeRel.')' : 'none');
|
|
| 471 |
// create indent chars |
|
| 472 |
$sTitlePrefix = str_repeat('-- ', $aPage['level']).' ';
|
|
| 473 |
$aTplItemData['PAGE_CODE_PAGE_TITLE'] = $sTitlePrefix . $aPage['menu_title']; |
|
| 474 |
$aTplItemData['PAGE_CODE_VALUE'] = intval($aPage['page_code']); |
|
| 475 |
// set SELECTED status of this entry |
|
| 476 |
if( $aPage['page_id'] == $aCurrentPage['page_code'] |
|
| 477 |
&& $aCurrentPage['page_code'] != 0 |
|
| 478 |
&& !$bPageCodeIsSelected |
|
| 479 |
) |
|
| 480 |
{ //
|
|
| 481 |
$aTplItemData['PAGE_CODE_SELECTED'] = $sSelected; |
|
| 482 |
$bPageCodeIsSelected = true; |
|
| 483 |
} elseif(!$aPage['iswriteable']) |
|
| 484 |
{ //
|
|
| 485 |
$aTplItemData['PAGE_CODE_SELECTED'] = $sDisabled.' class="disabled"'; |
|
| 486 |
$bSkipChildren = true; |
|
| 487 |
} else {
|
|
| 488 |
$aTplItemData['PAGE_CODE_SELECTED'] = ''; |
|
| 489 |
} |
|
| 490 |
// output item data |
|
| 491 |
$oTpl->set_var($aTplItemData); |
|
| 492 |
$oTpl->parse('page_code_list', 'page_code_list_block', true);
|
|
| 493 |
$aTplItemData = array(); |
|
| 494 |
} |
|
| 495 |
// output block data |
|
| 496 |
$oTpl->set_var($aTplBlockData); |
|
| 502 | 497 |
$oTpl->parse('show_page_code', 'show_page_code_block', true);
|
| 503 | 498 |
}else {
|
| 504 | 499 |
$oTpl->set_block('show_page_code', '');
|
| 505 | 500 |
} |
| 506 |
/*-- end multilanguage page_code 20090904 ----------------------------------------------*/
|
|
| 501 |
/*-- end multilanguage page_code -------------------------------------------------------*/
|
|
| 507 | 502 |
|
| 508 | 503 |
/*-- show list of parent pages ---------------------------------------------------------*/ |
| 509 | 504 |
$oTpl->set_block('main_block', 'parent_page_list_block', 'parent_page_list');
|
| ... | ... | |
| 515 | 510 |
) ); |
| 516 | 511 |
$oTpl->parse('parent_page_list', 'parent_page_list_block', true);
|
| 517 | 512 |
} |
| 513 |
|
|
| 518 | 514 |
parent_list(0); |
| 519 | 515 |
$oTpl->set_var('DISPLAY_MODIFIED', ($modified_ts == 'Unknown' ? 'hide' : ''));
|
| 520 | 516 |
|
| branches/2.8.x/wb/admin/pages/index.php | ||
|---|---|---|
| 135 | 135 |
|
| 136 | 136 |
// --- build parent pages list ----------------------------------------------------------- |
| 137 | 137 |
$aParents = $oPageTree->getParentList(); |
| 138 |
$aFirstEntry = array();
|
|
| 139 |
$aFirstEntry['ID'] = 0;
|
|
| 140 |
$aFirstEntry['TITLE'] = $TEXT['NONE'];
|
|
| 141 |
$aFirstEntry['DISABLED'] = 0;
|
|
| 142 |
$aFirstEntry['PARENT'] = 99;
|
|
| 143 |
$aFirstEntry['FLAG_ROOT_ICON'] = '';
|
|
| 144 |
$aFirstEntry['LEVEL'] = 0;
|
|
| 145 |
$aFirstEntry['LANGUAGE'] = '';
|
|
| 146 |
array_unshift($aParents, $aFirstEntry);
|
|
| 138 |
$aNewEntry = array();
|
|
| 139 |
$aNewEntry['page_id'] = 0;
|
|
| 140 |
$aNewEntry['menu_title'] = $TEXT['NONE'];
|
|
| 141 |
$aNewEntry['disabled'] = 0;
|
|
| 142 |
$aNewEntry['parent'] = 99;
|
|
| 143 |
$aNewEntry['flag_root_icon'] = '';
|
|
| 144 |
$aNewEntry['level'] = 0;
|
|
| 145 |
$aNewEntry['language'] = '';
|
|
| 146 |
array_unshift($aParents, $aNewEntry);
|
|
| 147 | 147 |
reset($aParents); |
| 148 | 148 |
$oTpl->set_block('main_block', 'parents_list_block', 'parents_list');
|
| 149 | 149 |
// walk through all items |
| 150 | 150 |
while (list(, $aItem) = each($aParents)) {
|
| 151 | 151 |
if($admin->get_permission('pages_add')) {
|
| 152 |
$aNewEntry = array(); |
|
| 153 |
$aNewEntry['ID'] = $aItem['page_id']; |
|
| 154 |
$aNewEntry['PARENT'] = $aItem['parent']; |
|
| 155 |
$aNewEntry['LEVEL'] = $aItem['level']; |
|
| 156 |
$aNewEntry['LANGUAGE'] = $aItem['language']; |
|
| 157 |
$aNewEntry['FLAG_ROOT_ICON'] = ''; |
|
| 152 | 158 |
// modify item |
| 153 |
$aItem['DISABLED'] = ($aItem['DISABLED'] ? ' disabled="disabled" class="disabled"' : '');
|
|
| 154 |
if(!$aItem['PARENT']) {
|
|
| 155 |
$aItem['FLAG_ROOT_ICON'] = ' style="background-image: url('.THEME_REL.'/images/flags/'
|
|
| 159 |
$aNewEntry['DISABLED'] = ($aItem['disabled'] ? ' disabled="disabled" class="disabled"' : '');
|
|
| 160 |
if(!$aItem['parent']) {
|
|
| 161 |
$aNewEntry['FLAG_ROOT_ICON'] = ' style="background-image: url('.THEME_REL.'/images/flags/'
|
|
| 156 | 162 |
. strtolower($aItem['LANGUAGE']).'.png);"'; |
| 157 | 163 |
} |
| 158 |
$aItem['TITLE'] = str_repeat('- ', $aItem['LEVEL']).$aItem['TITLE'];
|
|
| 164 |
$aNewEntry['TITLE'] = str_repeat('- ', $aItem['level']).$aItem['menu_title'];
|
|
| 159 | 165 |
// write block into template |
| 160 |
$oTpl->set_var($aItem);
|
|
| 166 |
$oTpl->set_var($aNewEntry);
|
|
| 161 | 167 |
$oTpl->parse('parents_list', 'parents_list_block', true);
|
| 162 | 168 |
} |
| 163 | 169 |
} |
| 164 | 170 |
unset($aParents); |
| 165 |
|
|
| 166 | 171 |
// --- build modules list ---------------------------------------------------------------- |
| 167 | 172 |
$bMatch = false; |
| 168 | 173 |
$aModulePermissions = '\''.implode(',', $_SESSION['MODULE_PERMISSIONS']).'\'';
|
| branches/2.8.x/wb/admin/interface/version.php | ||
|---|---|---|
| 51 | 51 |
|
| 52 | 52 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
| 53 | 53 |
if(!defined('VERSION')) define('VERSION', '2.8.3');
|
| 54 |
if(!defined('REVISION')) define('REVISION', '1952');
|
|
| 54 |
if(!defined('REVISION')) define('REVISION', '1953');
|
|
| 55 | 55 |
if(!defined('SP')) define('SP', '');
|
| branches/2.8.x/wb/modules/MultiLingual/update_keys.php | ||
|---|---|---|
| 54 | 54 |
require(WB_PATH.'/modules/admin.php'); |
| 55 | 55 |
$temp_page_id = intval( htmlentities($page_id ) ); |
| 56 | 56 |
|
| 57 |
$mLang = ModLanguage::getInstance(); |
|
| 58 |
$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
| 59 |
|
|
| 57 |
$oTrans = Translate::getInstance(); |
|
| 60 | 58 |
// check for page languages |
| 61 | 59 |
$oPageLang = new m_MultiLingual_Lib(); |
| 62 | 60 |
$Result = $oPageLang->updateDefaultPagesCode(); |
| ... | ... | |
| 64 | 62 |
{
|
| 65 | 63 |
$admin->print_error($database->get_error(), ADMIN_URL.'/pages/settings.php?page_id='.$temp_page_id ); |
| 66 | 64 |
} else {
|
| 67 |
$admin->print_success($mLang->MESSAGE_PAGES_UPDATE_SETTINGS, ADMIN_URL.'/pages/settings.php?page_id='.$temp_page_id );
|
|
| 65 |
$admin->print_success($oTrans->MESSAGE_PAGES_UPDATE_SETTINGS, ADMIN_URL.'/pages/settings.php?page_id='.$temp_page_id );
|
|
| 68 | 66 |
} |
Also available in: Unified diff
solved some problems with MultiLingual module