Revision 1970
Added by Luisehahne about 12 years ago
| branches/2.8.x/CHANGELOG | ||
|---|---|---|
| 11 | 11 |
! = Update/Change |
| 12 | 12 |
=============================================================================== |
| 13 | 13 |
|
| 14 |
01 Oct-2013 Build 1970 Dietmar Woellbrink (Luisehahne) |
|
| 15 |
! MultiLingual set svn properties to all files |
|
| 16 |
# MultiLingual typofix in methode updateDefaultPagesCode |
|
| 17 |
! Pages settings fix output page_code treelist (not ready yet) |
|
| 14 | 18 |
30 Sep-2013 Build 1969 Dietmar Woellbrink (Luisehahne) |
| 15 | 19 |
# fixed wrong [REFERRER_ID] replacement for search |
| 16 | 20 |
# security Application error message fix in search/search.php |
| branches/2.8.x/wb/admin/pages/settings.php | ||
|---|---|---|
| 428 | 428 |
$aTplBlockData['PAGE_CODE_LABEL_TEXT'] = $mLang->TEXT_PAGE_CODE; |
| 429 | 429 |
$aTplBlockData['PAGE_CODE_UPDATE_URL'] = WB_REL.'/modules/MultiLingual/update_keys.php?page_id='.$page_id; |
| 430 | 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'].' '; |
|
| 436 |
} |
|
| 437 |
$sql .= 'ORDER BY `position` ASC'; |
|
| 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'].' '; |
|
| 436 |
// } |
|
| 437 |
// $sql .= 'ORDER BY `position` ASC'; |
|
| 438 |
$sLangKey = DEFAULT_LANGUAGE; |
|
| 439 |
$sql = 'SELECT DISTINCT `page_id` ' |
|
| 440 |
. 'FROM `'.$oDb->TablePrefix.'pages` ' |
|
| 441 |
. 'WHERE `level`= \'0\' ' |
|
| 442 |
. 'AND `root_parent`=`page_id` ' |
|
| 443 |
. 'AND `visibility`!=\'none\' ' |
|
| 444 |
. 'AND `visibility`!=\'hidden\' ' |
|
| 445 |
. ( ($sLangKey!='') ? ' AND `language` = \''.$sLangKey.'\'' : '') |
|
| 446 |
. 'GROUP BY `language` ' |
|
| 447 |
. 'ORDER BY `position`'; |
|
| 438 | 448 |
$iLangStartPageId = $oDb->get_one($sql); |
| 439 | 449 |
// read the tree of the found root element |
| 440 | 450 |
$oPageList = new a_pages_SmallRawPageTree(); |
| 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', '1969');
|
|
| 54 |
if(!defined('REVISION')) define('REVISION', '1970');
|
|
| 55 | 55 |
if(!defined('SP')) define('SP', '');
|
| branches/2.8.x/wb/modules/MultiLingual/tpl/lang.tpl | ||
|---|---|---|
| 1 |
{#
|
|
| 2 |
/**
|
|
| 3 |
*
|
|
| 4 |
* @category modules
|
|
| 5 |
* @package MultiLingial
|
|
| 6 |
* @author WebsiteBaker Project, Luisehahne
|
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
|
| 8 |
* @link http://www.websitebaker2.org/
|
|
| 9 |
* @license http://www.gnu.org/licenses/gpl.html
|
|
| 10 |
* @platform WebsiteBaker 2.8.x
|
|
| 11 |
* @requirements PHP 5.2.2 and higher
|
|
| 12 |
* @version $Id: $
|
|
| 13 |
* @filesource $HeadURL: $
|
|
| 14 |
* @lastmodified $Date: $
|
|
| 15 |
*
|
|
| 16 |
*/
|
|
| 17 |
#}
|
|
| 18 |
|
|
| 19 |
<div id="langmenu">
|
|
| 20 |
{% for file in lang.FILES %}
|
|
| 21 |
<span style="width:{{ file.LANG_ICON_WIDTH }};vertical-align:middle;">
|
|
| 22 |
<a class="{{ file.LANG_ICON_CLASS }}" href="{{ file.LANG_PAGE_URL }}" title="{{ file.TEXT_PAGE_TITLE }}">
|
|
| 23 |
<span>
|
|
| 24 |
<img style="border: none;" src="{{ file.URL_ICON_FOLDER }}/{{ file.LANG_ICON }}.{{ file.LANG_ICON_EXT }}" title="{{ file.TEXT_PAGE_TITLE }}" alt="{{ file.TEXT_PAGE_TITLE }}" />
|
|
| 25 |
</span>
|
|
| 26 |
</a>
|
|
| 27 |
</span>
|
|
| 28 |
{% endfor %}
|
|
| 29 |
</div>
|
|
| 1 |
{#
|
|
| 2 |
/** |
|
| 3 |
* |
|
| 4 |
* @category modules |
|
| 5 |
* @package MultiLingial |
|
| 6 |
* @author WebsiteBaker Project, Luisehahne |
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
| 8 |
* @link http://www.websitebaker2.org/ |
|
| 9 |
* @license http://www.gnu.org/licenses/gpl.html |
|
| 10 |
* @platform WebsiteBaker 2.8.x |
|
| 11 |
* @requirements PHP 5.2.2 and higher |
|
| 12 |
* @version $Id$
|
|
| 13 |
* @filesource $HeadURL$
|
|
| 14 |
* @lastmodified $Date$
|
|
| 15 |
* |
|
| 16 |
*/ |
|
| 17 |
#} |
|
| 18 |
|
|
| 19 |
<div id="langmenu"> |
|
| 20 |
{% for file in lang.FILES %}
|
|
| 21 |
<span style="width:{{ file.LANG_ICON_WIDTH }};vertical-align:middle;">
|
|
| 22 |
<a class="{{ file.LANG_ICON_CLASS }}" href="{{ file.LANG_PAGE_URL }}" title="{{ file.TEXT_PAGE_TITLE }}">
|
|
| 23 |
<span> |
|
| 24 |
<img style="border: none;" src="{{ file.URL_ICON_FOLDER }}/{{ file.LANG_ICON }}.{{ file.LANG_ICON_EXT }}" title="{{ file.TEXT_PAGE_TITLE }}" alt="{{ file.TEXT_PAGE_TITLE }}" />
|
|
| 25 |
</span> |
|
| 26 |
</a> |
|
| 27 |
</span> |
|
| 28 |
{% endfor %}
|
|
| 29 |
</div> |
|
| 30 | 30 | |
| branches/2.8.x/wb/modules/MultiLingual/tpl/lang.twig | ||
|---|---|---|
| 26 | 26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 1.6.8 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
* @description xyz |
| 34 | 34 |
*/ |
| 35 | 35 | |
| branches/2.8.x/wb/modules/MultiLingual/tpl/lang.html.twig | ||
|---|---|---|
| 26 | 26 |
* @copyright M.v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 1.6.8 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
*/ |
| 34 | 34 |
#} |
| 35 | 35 | |
| branches/2.8.x/wb/modules/MultiLingual/uninstall.php | ||
|---|---|---|
| 26 | 26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 1.6.8 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
* @description xyz |
| 34 | 34 |
*/ |
| 35 | 35 | |
| branches/2.8.x/wb/modules/MultiLingual/info.php | ||
|---|---|---|
| 26 | 26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 1.6.8 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
* @description provides a flexible posibility for changeing to a translated page |
| 34 | 34 |
*/ |
| 35 | 35 | |
| branches/2.8.x/wb/modules/MultiLingual/update_keys.php | ||
|---|---|---|
| 26 | 26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 1.6.8 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
* @description xyz |
| 34 | 34 |
*/ |
| ... | ... | |
| 55 | 55 |
$temp_page_id = intval( htmlentities($page_id ) ); |
| 56 | 56 |
|
| 57 | 57 |
$oTrans = Translate::getInstance(); |
| 58 |
$oTrans->enableAddon( 'modules/'.basename(dirname(__FILE__)) ); |
|
| 59 |
|
|
| 58 | 60 |
// check for page languages |
| 59 | 61 |
$oPageLang = new m_MultiLingual_Lib(); |
| 60 | 62 |
$Result = $oPageLang->updateDefaultPagesCode(); |
| 61 | 63 | |
| branches/2.8.x/wb/modules/MultiLingual/languages/NL.php | ||
|---|---|---|
| 9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 10 | 10 |
* @platform WebsiteBaker 2.8.x |
| 11 | 11 |
* @requirements PHP 5.2.2 and higher |
| 12 |
* @version $Id: $
|
|
| 13 |
* @filesource $HeadURL: $
|
|
| 14 |
* @lastmodified $Date: $
|
|
| 12 |
* @version $Id$ |
|
| 13 |
* @filesource $HeadURL$ |
|
| 14 |
* @lastmodified $Date$ |
|
| 15 | 15 |
* |
| 16 | 16 |
*/ |
| 17 | 17 |
|
| 18 | 18 | |
| branches/2.8.x/wb/modules/MultiLingual/languages/EN.php | ||
|---|---|---|
| 9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 10 | 10 |
* @platform WebsiteBaker 2.8.x |
| 11 | 11 |
* @requirements PHP 5.2.2 and higher |
| 12 |
* @version $Id: $
|
|
| 13 |
* @filesource $HeadURL: $
|
|
| 14 |
* @lastmodified $Date: $
|
|
| 12 |
* @version $Id$ |
|
| 13 |
* @filesource $HeadURL$ |
|
| 14 |
* @lastmodified $Date$ |
|
| 15 | 15 |
* |
| 16 | 16 |
*/ |
| 17 | 17 |
|
| 18 | 18 | |
| branches/2.8.x/wb/modules/MultiLingual/languages/FR.php | ||
|---|---|---|
| 9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 10 | 10 |
* @platform WebsiteBaker 2.8.x |
| 11 | 11 |
* @requirements PHP 5.2.2 and higher |
| 12 |
* @version $Id: $
|
|
| 13 |
* @filesource $HeadURL: $
|
|
| 14 |
* @lastmodified $Date: $
|
|
| 12 |
* @version $Id$ |
|
| 13 |
* @filesource $HeadURL$ |
|
| 14 |
* @lastmodified $Date$ |
|
| 15 | 15 |
* |
| 16 | 16 |
*/ |
| 17 | 17 |
|
| 18 | 18 | |
| branches/2.8.x/wb/modules/MultiLingual/languages/DE.php | ||
|---|---|---|
| 9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 10 | 10 |
* @platform WebsiteBaker 2.8.x |
| 11 | 11 |
* @requirements PHP 5.2.2 and higher |
| 12 |
* @version $Id: $
|
|
| 13 |
* @filesource $HeadURL: $
|
|
| 14 |
* @lastmodified $Date: $
|
|
| 12 |
* @version $Id$ |
|
| 13 |
* @filesource $HeadURL$ |
|
| 14 |
* @lastmodified $Date$ |
|
| 15 | 15 |
* |
| 16 | 16 |
*/ |
| 17 | 17 |
|
| 18 | 18 | |
| branches/2.8.x/wb/modules/MultiLingual/include.php | ||
|---|---|---|
| 26 | 26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 0.0.1 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
* @description provides a flexible posibility for changeing to a translated page |
| 34 | 34 |
*/ |
| 35 | 35 | |
| branches/2.8.x/wb/modules/MultiLingual/readme.txt | ||
|---|---|---|
| 1 |
#
|
|
| 2 |
#
|
|
| 3 |
How to use MultiLingual
|
|
| 4 |
##########################################################################
|
|
| 5 |
The easiest way is the combination with Droplet [[iMultiLingual]]
|
|
| 6 |
|
|
| 7 |
##########################################################################
|
|
| 8 |
but you also can handle it in the old manner:
|
|
| 9 |
|
|
| 10 |
insert the following PHP-code in your templates index.php in the place you want
|
|
| 11 |
show the languages link bar.
|
|
| 12 |
|
|
| 13 |
<?php if(function_exists('language_menu')){ echo language_menu(); } ?>
|
|
| 14 |
|
|
| 15 |
##########################################################################
|
|
| 16 |
If you wish to modify the template, just open the file
|
|
| 17 |
/modules/MultiLingual/tpl/lang.html.twig
|
|
| 18 |
and make your modifications.
|
|
| 19 |
|
|
| 1 |
# |
|
| 2 |
# |
|
| 3 |
How to use MultiLingual |
|
| 4 |
########################################################################## |
|
| 5 |
The easiest way is the combination with Droplet [[iMultiLingual]] |
|
| 6 |
|
|
| 7 |
########################################################################## |
|
| 8 |
but you also can handle it in the old manner: |
|
| 9 |
|
|
| 10 |
insert the following PHP-code in your templates index.php in the place you want |
|
| 11 |
show the languages link bar. |
|
| 12 |
|
|
| 13 |
<?php if(function_exists('language_menu')){ echo language_menu(); } ?>
|
|
| 14 |
|
|
| 15 |
########################################################################## |
|
| 16 |
If you wish to modify the template, just open the file |
|
| 17 |
/modules/MultiLingual/tpl/lang.html.twig |
|
| 18 |
and make your modifications. |
|
| 19 |
|
|
| 20 | 20 | |
| branches/2.8.x/wb/modules/MultiLingual/Lib.php | ||
|---|---|---|
| 26 | 26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 1.6.8 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
* @description provides a flexible posibility for changeing to a translated page |
| 34 | 34 |
*/ |
| ... | ... | |
| 62 | 62 |
$this->_oApp = (isset($GLOBALS['admin']) ? $GLOBALS['admin'] : $GLOBALS['wb']); |
| 63 | 63 |
$this->_oDb = WbDatabase::getInstance(); |
| 64 | 64 |
$this->_oReg = WbAdaptor::getInstance(); |
| 65 |
$this->_config = parse_ini_file(dirname(__FILE__).'/default.ini',true);
|
|
| 65 |
$this->_config = $this->_aConfig = $this->getConfig((dirname(__FILE__)).'/default.ini');
|
|
| 66 | 66 |
$this->_aTwigEnv = $this->_config['twig-environment']; |
| 67 | 67 |
$this->_aTwigLoader = $this->_config['twig-loader-file']; |
| 68 | 68 |
} |
| ... | ... | |
| 185 | 185 |
} |
| 186 | 186 |
|
| 187 | 187 |
|
| 188 |
protected function getConfig($sFilename) |
|
| 189 |
{
|
|
| 190 |
if(is_readable($sFilename)){
|
|
| 191 |
return parse_ini_file($sFilename, true); |
|
| 192 |
}else {
|
|
| 193 |
return null; |
|
| 194 |
} |
|
| 195 |
} |
|
| 188 | 196 |
|
| 197 |
|
|
| 189 | 198 |
private function _getAllowedLanguagesFromAddons($sLangKey='') |
| 190 | 199 |
{
|
| 191 | 200 |
$aLangAddons = array(); |
| ... | ... | |
| 300 | 309 |
// fill page_code with page_id for default_language |
| 301 | 310 |
while( list( $page_id, $val ) = each ( $entries ) ) |
| 302 | 311 |
{
|
| 303 |
if( $val['language'] == $this->_oReg->DefaultLangauage ) {
|
|
| 312 |
if( $val['language'] == $this->_oReg->DefaultLanguage ) {
|
|
| 304 | 313 |
if( ($retVal = $this->_updatePageCode((int)$page_id, 'pages', (int)$page_id ))==false ){ break; }
|
| 305 | 314 |
} |
| 306 | 315 |
} |
| 307 | 316 | |
| branches/2.8.x/wb/modules/MultiLingual/install.php | ||
|---|---|---|
| 26 | 26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 1.6.8 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
* @description xyz |
| 34 | 34 |
*/ |
| 35 | 35 | |
| branches/2.8.x/wb/modules/MultiLingual/upgrade.php | ||
|---|---|---|
| 26 | 26 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
| 27 | 27 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
| 28 | 28 |
* @version 1.6.8 |
| 29 |
* @revision $Revision: $
|
|
| 30 |
* @link $HeadURL: $
|
|
| 31 |
* @lastmodified $Date: $
|
|
| 29 |
* @revision $Revision$ |
|
| 30 |
* @link $HeadURL$ |
|
| 31 |
* @lastmodified $Date$ |
|
| 32 | 32 |
* @since File available since 09.01.2013 |
| 33 | 33 |
* @description provides a flexible posibility for changeing to a translated page |
| 34 | 34 |
*/ |
| 35 | 35 | |
Also available in: Unified diff
! Pages settings fix output page_code treelist (not ready yet)