Permalink
Browse files

new options: 'monobook_copyright_translate' and 'monobook_sitenotice_…

…translate'

Enables the user to use language specific wiki pages as translated side wide
notice / copyright notice if the Translation plugin (cf.
http://www.dokuwiki.org/plugin:translation) is available. Works the same way
as the multilingual navigation (cf. option 'monobook_navigation_translate').
  • Loading branch information...
andreashaerter committed Oct 12, 2012
1 parent b081292 commit f3ed9f90c364407ea9f9598e5b0932c75b59a03a
Showing with 86 additions and 32 deletions.
  1. +7 −5 conf/default.php
  2. +7 −5 conf/metadata.php
  3. +7 −5 lang/de-informal/settings.php
  4. +7 −5 lang/de/settings.php
  5. +7 −5 lang/en/settings.php
  6. +51 −7 main.php
View
@@ -41,18 +41,20 @@
$conf["monobook_discuss_ns"] = ":talk:"; //namespace to use for discussion page storage
//site notice
$conf["monobook_sitenotice"] = true; //TRUE: use/show sitenotice
$conf["monobook_sitenotice_location"] = ":wiki:site_notice"; //page/article used to store the sitenotice
$conf["monobook_sitenotice"] = true; //TRUE: use/show sitenotice
$conf["monobook_sitenotice_location"] = ":wiki:site_notice"; //page/article used to store the sitenotice
$conf["monobook_sitenotice_translate"] = true; //TRUE: load translated sitenotice if translation plugin is available (see <http://www.dokuwiki.org/plugin:translation>)
//navigation
$conf["monobook_navigation"] = true; //TRUE: use/show navigation
$conf["monobook_navigation_location"] = ":wiki:navigation"; //page/article used to store the navigation
$conf["monobook_navigation_translate"] = true; //TRUE: load translated navigation if translation plugin is available (see <http://www.dokuwiki.org/plugin:translation>)
//custom copyright notice
$conf["monobook_copyright"] = true; //TRUE: use/show copyright notice
$conf["monobook_copyright_default"] = true; //TRUE: use default copyright notice (if copyright notice is enabled at all)
$conf["monobook_copyright_location"] = ":wiki:copyright"; //page/article used to store a custom copyright notice
$conf["monobook_copyright"] = true; //TRUE: use/show copyright notice
$conf["monobook_copyright_default"] = true; //TRUE: use default copyright notice (if copyright notice is enabled at all)
$conf["monobook_copyright_location"] = ":wiki:copyright"; //page/article used to store a custom copyright notice
$conf["monobook_copyright_translate"] = true; //TRUE: load translated copyright notice if translation plugin is available (see <http://www.dokuwiki.org/plugin:translation>)
//search form
$conf["monobook_search"] = true; //TRUE: use/show search form
View
@@ -41,18 +41,20 @@
$meta["monobook_discuss_ns"] = array("string", "_pattern" => "/^:.{1,}:$/");
//site notice
$meta["monobook_sitenotice"] = array("onoff");
$meta["monobook_sitenotice_location"] = array("string");
$meta["monobook_sitenotice"] = array("onoff");
$meta["monobook_sitenotice_location"] = array("string");
$meta["monobook_sitenotice_translate"] = array("onoff");
//navigation
$meta["monobook_navigation"] = array("onoff");
$meta["monobook_navigation_location"] = array("string");
$meta["monobook_navigation_translate"] = array("onoff");
//custom copyright notice
$meta["monobook_copyright"] = array("onoff");
$meta["monobook_copyright_default"] = array("onoff");
$meta["monobook_copyright_location"] = array("string");
$meta["monobook_copyright"] = array("onoff");
$meta["monobook_copyright_default"] = array("onoff");
$meta["monobook_copyright_location"] = array("string");
$meta["monobook_copyright_translate"] = array("onoff");
//search form
$meta["monobook_search"] = array("onoff");
@@ -38,18 +38,20 @@
$lang["monobook_discuss_ns"] = "Falls ja, folgenden ':namensraum:' als Wurzel für Diskussionen nutzen:";
//site notice
$lang["monobook_sitenotice"] = "Seitenübergreifenden Hinweis einblenden?";
$lang["monobook_sitenotice_location"] = "Falls ja, folgende wiki-Seite als Hinweis verwenden:";
$lang["monobook_sitenotice"] = "Seitenübergreifenden Hinweis einblenden?";
$lang["monobook_sitenotice_location"] = "Falls ja, folgende wiki-Seite als Hinweis verwenden:";
$lang["monobook_sitenotice_translate"] = "Falls ja und <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation-Plugin</a> verfügbar: sprachspezifische Seiten-Hinweis(e) laden?<br />Die wiki-Seite des/der übersetzten Seiten-Hinweis(e) lautet [Wert von 'monobook_sitenotice_location']_[iso-sprach-code] (z.B. ':wiki:site_notice_en').";
//navigation
$lang["monobook_navigation"] = "Navigation anzeigen?";
$lang["monobook_navigation_location"] = "Falls ja, folgende wiki-Seite als Navigation verwenden:";
$lang["monobook_navigation_translate"] = "Falls ja und <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation-Plugin</a> verfügbar: sprachspezifische Navigation laden?<br />Die wiki-Seite der übersetzten Navigation(en) lautet [Wert von 'monobook_navigation_location']_[iso-sprach-code] (z.B. ':wiki:navigation_en').";
//custom copyright notice
$lang["monobook_copyright"] = "Copyright-Hinweis einblenden?";
$lang["monobook_copyright_default"] = "Falls ja, Standard-Copyright-Hinweis nutzen?";
$lang["monobook_copyright_location"] = "Falls nicht den Standard-Copyright-Hinweis, folgende wiki-Seite als Copyright-Hinweis verwenden:";
$lang["monobook_copyright"] = "Copyright-Hinweis einblenden?";
$lang["monobook_copyright_default"] = "Falls ja, Standard-Copyright-Hinweis nutzen?";
$lang["monobook_copyright_location"] = "Falls nicht den Standard-Copyright-Hinweis, folgende wiki-Seite als Copyright-Hinweis verwenden:";
$lang["monobook_copyright_translate"] = "Falls ja und <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation-Plugin</a> verfügbar: sprachspezifische Copyright-Hinweis(e) laden?<br />Die wiki-Seite des/der übersetzten Copyright-Hinweis(e) lautet [Wert von 'monobook_copyright_location']_[iso-sprach-code] (z.B. ':wiki:copyright_en').";
//search form
$lang["monobook_search"] = "Suchformular anzeigen?";
View
@@ -38,18 +38,20 @@
$lang["monobook_discuss_ns"] = "Falls ja, folgenden ':namensraum:' als Wurzel für Diskussionen nutzen:";
//site notice
$lang["monobook_sitenotice"] = "Seitenübergreifenden Hinweis einblenden?";
$lang["monobook_sitenotice_location"] = "Falls ja, folgende wiki-Seite als Hinweis verwenden:";
$lang["monobook_sitenotice"] = "Seitenübergreifenden Hinweis einblenden?";
$lang["monobook_sitenotice_location"] = "Falls ja, folgende wiki-Seite als Hinweis verwenden:";
$lang["monobook_sitenotice_translate"] = "Falls ja und <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation-Plugin</a> verfügbar: sprachspezifische Seiten-Hinweis(e) laden?<br />Die wiki-Seite des/der übersetzten Seiten-Hinweis(e) lautet [Wert von 'monobook_sitenotice_location']_[iso-sprach-code] (z.B. ':wiki:site_notice_en').";
//navigation
$lang["monobook_navigation"] = "Navigation anzeigen?";
$lang["monobook_navigation_location"] = "Falls ja, folgende wiki-Seite als Navigation verwenden:";
$lang["monobook_navigation_translate"] = "Falls ja und <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation-Plugin</a> verfügbar: sprachspezifische Navigation laden?<br />Die wiki-Seite der übersetzten Navigation(en) lautet [Wert von 'monobook_navigation_location']_[iso-sprach-code] (z.B. ':wiki:navigation_en').";
//custom copyright notice
$lang["monobook_copyright"] = "Copyright-Hinweis einblenden?";
$lang["monobook_copyright_default"] = "Falls ja, Standard-Copyright-Hinweis nutzen?";
$lang["monobook_copyright_location"] = "Falls nicht den Standard-Copyright-Hinweis, folgende wiki-Seite als Copyright-Hinweis verwenden:";
$lang["monobook_copyright"] = "Copyright-Hinweis einblenden?";
$lang["monobook_copyright_default"] = "Falls ja, Standard-Copyright-Hinweis nutzen?";
$lang["monobook_copyright_location"] = "Falls nicht den Standard-Copyright-Hinweis, folgende wiki-Seite als Copyright-Hinweis verwenden:";
$lang["monobook_copyright_translate"] = "Falls ja und <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation-Plugin</a> verfügbar: sprachspezifische Copyright-Hinweis(e) laden?<br />Die wiki-Seite des/der übersetzten Copyright-Hinweis(e) lautet [Wert von 'monobook_copyright_location']_[iso-sprach-code] (z.B. ':wiki:copyright_en').";
//search form
$lang["monobook_search"] = "Suchformular anzeigen?";
View
@@ -38,18 +38,20 @@
$lang["monobook_discuss_ns"] = "If yes, use following ':namespace:' as root for discussions:";
//site notice
$lang["monobook_sitenotice"] = "Show site wide notice?";
$lang["monobook_sitenotice_location"] = "If yes, use following wiki page for the site wide notice:";
$lang["monobook_sitenotice"] = "Show site wide notice?";
$lang["monobook_sitenotice_location"] = "If yes, use following wiki page for the site wide notice:";
$lang["monobook_sitenotice_translate"] = "If yes and <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation plugin</a> available: load language specific site wide notice?<br />The wiki page of the translated site notice(s) is [value of 'monobook_sitenotice_location']_[iso lang code] (e.g. ':wiki:site_notice_de').";
//navigation
$lang["monobook_navigation"] = "Show navigation?";
$lang["monobook_navigation_location"] = "If yes, use following wiki page as navigation:";
$lang["monobook_navigation_translate"] = "If yes and <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation plugin</a> available: load language specific navigation?<br />The wiki page of the translated navigation(s) is [value of 'monobook_navigation_location']_[iso lang code] (e.g. ':wiki:navigation_de').";
//custom copyright notice
$lang["monobook_copyright"] = "Show copyright notice?";
$lang["monobook_copyright_default"] = "If yes, use default copyright notice?";
$lang["monobook_copyright_location"] = "If not default, use following wiki page as copyright notice:";
$lang["monobook_copyright"] = "Show copyright notice?";
$lang["monobook_copyright_default"] = "If yes, use default copyright notice?";
$lang["monobook_copyright_location"] = "If not default, use following wiki page as copyright notice:";
$lang["monobook_copyright_translate"] = "If yes and <a href=\"http://www.dokuwiki.org/plugin:translation\">Translation plugin</a> available: load language specific copyright notice?<br />The wiki page of the translated copyright notice(s) is [value of 'monobook_copyright_location']_[iso lang code] (e.g. ':wiki:copyright_de').";
//search form
$lang["monobook_search"] = "Show search form?";
View
@@ -577,18 +577,40 @@ function _monobook_renderButtons($arr)
html_msgarea();
//show site notice
if (tpl_getConf("monobook_sitenotice")){
//detect wiki page to load as content
if (!empty($transplugin) && //var comes from conf/boxes.php
is_object($transplugin) &&
tpl_getConf("monobook_sitenotice_translate")){
//translated site notice?
$transplugin_langcur = $transplugin->hlp->getLangPart(cleanID(getId())); //current language part
$transplugin_langs = explode(" ", trim($transplugin->getConf("translations"))); //available languages
if (empty($transplugin_langs) ||
empty($transplugin_langcur) ||
!is_array($transplugin_langs) ||
!in_array($transplugin_langcur, $transplugin_langs)) {
//current page is no translation or something is wrong, load default site notice
$sitenotice_location = tpl_getConf("monobook_sitenotice_location");
} else {
//load language specific site notice
$sitenotice_location = tpl_getConf("monobook_sitenotice_location")."_".$transplugin_langcur;
}
}else{
//default site notice, no translation
$sitenotice_location = tpl_getConf("monobook_sitenotice_location");
}
//we have to show a custom sitenotice
if (empty($conf["useacl"]) ||
auth_quickaclcheck(cleanID(tpl_getConf("monobook_sitenotice_location"))) >= AUTH_READ){ //current user got access?
auth_quickaclcheck(cleanID($sitenotice_location)) >= AUTH_READ){ //current user got access?
echo "\n <div id=\"siteNotice\" class=\"noprint\">\n";
//get the rendered content of the defined wiki article to use as
//custom sitenotice.
$interim = tpl_include_page(tpl_getConf("monobook_sitenotice_location"), false);
$interim = tpl_include_page($sitenotice_location, false);
if ($interim === "" ||
$interim === false){
//show creation/edit link if the defined page got no content
echo "[&#160;";
tpl_pagelink(tpl_getConf("monobook_sitenotice_location"), hsc($lang["monobook_fillplaceholder"]." (".tpl_getConf("monobook_sitenotice_location").")"));
tpl_pagelink($sitenotice_location, hsc($lang["monobook_fillplaceholder"]." (".hsc($sitenotice_location).")"));
echo "&#160;]<br />";
}else{
//show the rendered page content
@@ -774,18 +796,40 @@ function _monobook_renderButtons($arr)
echo "<li id=\"copyright\">\n <div class=\"dokuwiki\">";
tpl_license(false);
echo "</div>\n </li>\n";
//show custom notice.
//show custom notice
}else{
//detect wiki page to load as content
if (!empty($transplugin) && //var comes from conf/boxes.php
is_object($transplugin) &&
tpl_getConf("monobook_copyright_translate")){
//translated copyright notice?
$transplugin_langcur = $transplugin->hlp->getLangPart(cleanID(getId())); //current language part
$transplugin_langs = explode(" ", trim($transplugin->getConf("translations"))); //available languages
if (empty($transplugin_langs) ||
empty($transplugin_langcur) ||
!is_array($transplugin_langs) ||
!in_array($transplugin_langcur, $transplugin_langs)) {
//current page is no translation or something is wrong, load default copyright notice
$copyright_location = tpl_getConf("monobook_copyright_location");
} else {
//load language specific copyright notice
$copyright_location = tpl_getConf("monobook_copyright_location")."_".$transplugin_langcur;
}
}else{
//default copyright notice, no translation
$copyright_location = tpl_getConf("monobook_copyright_location");
}
if (empty($conf["useacl"]) ||
auth_quickaclcheck(cleanID(tpl_getConf("monobook_copyright_location"))) >= AUTH_READ){ //current user got access?
auth_quickaclcheck(cleanID($copyright_location)) >= AUTH_READ){ //current user got access?
echo "<li id=\"copyright\">\n ";
//get the rendered content of the defined wiki article to use as custom notice
$interim = tpl_include_page(tpl_getConf("monobook_copyright_location"), false);
$interim = tpl_include_page($copyright_location, false);
if ($interim === "" ||
$interim === false){
//show creation/edit link if the defined page got no content
echo "[&#160;";
tpl_pagelink(tpl_getConf("monobook_copyright_location"), hsc($lang["monobook_fillplaceholder"]." (".tpl_getConf("monobook_copyright_location").")"));
tpl_pagelink($copyright_location, hsc($lang["monobook_fillplaceholder"]." (".hsc($copyright_location).")"));
echo "&#160;]<br />";
}else{
//show the rendered page content

0 comments on commit f3ed9f9

Please sign in to comment.