diff --git a/code/widgets/BlogManagementWidget.php b/code/widgets/BlogManagementWidget.php index ec8a383..99dd1df 100644 --- a/code/widgets/BlogManagementWidget.php +++ b/code/widgets/BlogManagementWidget.php @@ -19,15 +19,17 @@ class BlogManagementWidget extends Widget implements PermissionProvider { static $title = "Blog Management"; static $cmsTitle = "Blog Management"; static $description = "Provide a number of links useful for administering a blog. Only shown if the user is an admin."; - + function CommentText() { - if(!class_exists('Comment')) return false; - $unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"PageComment\" WHERE \"NeedsModeration\"=1")->value(); + if(!class_exists('Comment')) + return false; + + $unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"Comment\" WHERE \"Moderated\"=0")->value(); if($unmoderatedcount == 1) { return _t("BlogManagementWidget.UNM1", "You have 1 unmoderated comment"); } else if($unmoderatedcount > 1) { - return sprintf(_t("BlogManagementWidget.UNMM", "You have %i unmoderated comments"), $unmoderatedcount); + return sprintf(_t("BlogManagementWidget.UNMM", "You have %d unmoderated comments"), $unmoderatedcount); } else { return _t("BlogManagementWidget.COMADM", "Comment administration"); } @@ -35,14 +37,10 @@ class BlogManagementWidget extends Widget implements PermissionProvider { function CommentLink() { - if(!Permission::check('BLOGMANAGEMENT') || !class_exists('Comment')) return false; - $unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"PageComment\" WHERE \"NeedsModeration\"=1")->value(); - - if($unmoderatedcount > 0) { - return "admin/comments/unmoderated"; - } else { - return "admin/comments"; - } + if(!Permission::check('BLOGMANAGEMENT') || !class_exists('Comment')) + return false; + + return "admin/comments"; } function providePermissions() { diff --git a/lang/ar_SA.php b/lang/ar_SA.php index 0f5d23c..5184a9c 100644 --- a/lang/ar_SA.php +++ b/lang/ar_SA.php @@ -54,7 +54,7 @@ $lang['ar_SA']['BlogManagementWidget']['SINGULARNAME'] = 'مربع إدارة ا $lang['ar_SA']['BlogManagementWidget.ss']['LOGOUT'] = 'خروج'; $lang['ar_SA']['BlogManagementWidget.ss']['POSTNEW'] = 'نشر تدوينة جديدة'; $lang['ar_SA']['BlogManagementWidget']['UNM1'] = 'يوجد تعليق واحد لا يحتاج إلى موافقة'; -$lang['ar_SA']['BlogManagementWidget']['UNMM'] = 'يوجد %i تعليقات لا تحتاج إلى موافقة'; +$lang['ar_SA']['BlogManagementWidget']['UNMM'] = 'يوجد %d تعليقات لا تحتاج إلى موافقة'; $lang['ar_SA']['BlogSummary.ss']['COMMENTS'] = 'التعليقات'; $lang['ar_SA']['BlogSummary.ss']['POSTEDBY'] = 'بواسطة'; $lang['ar_SA']['BlogSummary.ss']['POSTEDON'] = 'في'; diff --git a/lang/bg_BG.php b/lang/bg_BG.php index 0b903e6..36bb55f 100644 --- a/lang/bg_BG.php +++ b/lang/bg_BG.php @@ -46,7 +46,7 @@ $lang['bg_BG']['BlogManagementWidget']['COMADM'] = 'Администрация $lang['bg_BG']['BlogManagementWidget.ss']['LOGOUT'] = 'Излез'; $lang['bg_BG']['BlogManagementWidget.ss']['POSTNEW'] = 'Публикувайте нова блог статия'; $lang['bg_BG']['BlogManagementWidget']['UNM1'] = 'Вие имате 1 непрегледан коментар'; -$lang['bg_BG']['BlogManagementWidget']['UNMM'] = 'Вие имате %i непрегледани коментара'; +$lang['bg_BG']['BlogManagementWidget']['UNMM'] = 'Вие имате %d непрегледани коментара'; $lang['bg_BG']['BlogSummary.ss']['COMMENTS'] = 'Коментари'; $lang['bg_BG']['BlogSummary.ss']['POSTEDBY'] = 'Публикувано от'; $lang['bg_BG']['BlogSummary.ss']['POSTEDON'] = 'на'; diff --git a/lang/da_DK.php b/lang/da_DK.php index 99a4318..3575536 100644 --- a/lang/da_DK.php +++ b/lang/da_DK.php @@ -46,7 +46,7 @@ $lang['da_DK']['BlogManagementWidget']['COMADM'] = 'Kommentaradministration'; $lang['da_DK']['BlogManagementWidget.ss']['LOGOUT'] = 'Log ud'; $lang['da_DK']['BlogManagementWidget.ss']['POSTNEW'] = 'Send et nyt blog indlæg'; $lang['da_DK']['BlogManagementWidget']['UNM1'] = 'Du har 1 uvurderet kommentar'; -$lang['da_DK']['BlogManagementWidget']['UNMM'] = 'Du har %i uvurderet kommentarer'; +$lang['da_DK']['BlogManagementWidget']['UNMM'] = 'Du har %d uvurderet kommentarer'; $lang['da_DK']['BlogSummary.ss']['COMMENTS'] = 'Kommentarer'; $lang['da_DK']['BlogSummary.ss']['POSTEDON'] = 'd. '; $lang['da_DK']['RSSWidget']['CT'] = 'Brugerdefineret title for dette feed'; diff --git a/lang/de_DE.php b/lang/de_DE.php index 3e4ff0b..2cc4586 100644 --- a/lang/de_DE.php +++ b/lang/de_DE.php @@ -54,7 +54,7 @@ $lang['de_DE']['BlogManagementWidget']['SINGULARNAME'] = 'Blog-Verwaltungs-Widge $lang['de_DE']['BlogManagementWidget.ss']['LOGOUT'] = 'Logout'; $lang['de_DE']['BlogManagementWidget.ss']['POSTNEW'] = 'Neuen Eintrag schreiben'; $lang['de_DE']['BlogManagementWidget']['UNM1'] = 'Sie haben 1 noch nicht moderierten Kommentar'; -$lang['de_DE']['BlogManagementWidget']['UNMM'] = 'Sie haben %i noch nicht moderierte Kommentare'; +$lang['de_DE']['BlogManagementWidget']['UNMM'] = 'Sie haben %d noch nicht moderierte Kommentare'; $lang['de_DE']['BlogSummary.ss']['COMMENTS'] = 'Kommentare'; $lang['de_DE']['BlogSummary.ss']['POSTEDBY'] = 'Verfasst von'; $lang['de_DE']['BlogSummary.ss']['POSTEDON'] = 'am'; diff --git a/lang/en_GB.php b/lang/en_GB.php index 486f993..fb888bf 100644 --- a/lang/en_GB.php +++ b/lang/en_GB.php @@ -54,7 +54,7 @@ $lang['en_GB']['BlogManagementWidget']['SINGULARNAME'] = 'Blog Management Widget $lang['en_GB']['BlogManagementWidget.ss']['LOGOUT'] = 'Logout'; $lang['en_GB']['BlogManagementWidget.ss']['POSTNEW'] = 'Post a new blog entry'; $lang['en_GB']['BlogManagementWidget']['UNM1'] = 'You have 1 unmoderated comment'; -$lang['en_GB']['BlogManagementWidget']['UNMM'] = 'You have %i unmoderated comments'; +$lang['en_GB']['BlogManagementWidget']['UNMM'] = 'You have %d unmoderated comments'; $lang['en_GB']['BlogSummary.ss']['COMMENTS'] = 'Comments'; $lang['en_GB']['BlogSummary.ss']['POSTEDBY'] = 'Posted by'; $lang['en_GB']['BlogSummary.ss']['POSTEDON'] = 'on'; diff --git a/lang/en_US.php b/lang/en_US.php index 1496f5b..2ecd2f7 100644 --- a/lang/en_US.php +++ b/lang/en_US.php @@ -69,7 +69,7 @@ $lang['en_US']['BlogManagementWidget']['SINGULARNAME'] = array( 'Singular name of the object, used in dropdowns and to generally identify a single object in the interface' ); $lang['en_US']['BlogManagementWidget']['UNM1'] = 'You have 1 unmoderated comment'; -$lang['en_US']['BlogManagementWidget']['UNMM'] = 'You have %i unmoderated comments'; +$lang['en_US']['BlogManagementWidget']['UNMM'] = 'You have %d unmoderated comments'; $lang['en_US']['BlogManagementWidget.ss']['LOGOUT'] = 'Logout'; $lang['en_US']['BlogManagementWidget.ss']['POSTNEW'] = 'Post a new blog entry'; $lang['en_US']['BlogSummary.ss']['COMMENTS'] = 'Comments'; diff --git a/lang/es_ES.php b/lang/es_ES.php index adac8b6..753ad35 100644 --- a/lang/es_ES.php +++ b/lang/es_ES.php @@ -54,7 +54,7 @@ $lang['es_ES']['BlogManagementWidget']['SINGULARNAME'] = 'Widget de gestión del $lang['es_ES']['BlogManagementWidget.ss']['LOGOUT'] = 'Salir'; $lang['es_ES']['BlogManagementWidget.ss']['POSTNEW'] = 'Escribir una nueva entrada del blog'; $lang['es_ES']['BlogManagementWidget']['UNM1'] = 'Tienes 1 comentario sin moderar'; -$lang['es_ES']['BlogManagementWidget']['UNMM'] = 'Tienes %i comentarios sin moderar'; +$lang['es_ES']['BlogManagementWidget']['UNMM'] = 'Tienes %d comentarios sin moderar'; $lang['es_ES']['BlogSummary.ss']['COMMENTS'] = 'Comentarios'; $lang['es_ES']['BlogSummary.ss']['POSTEDBY'] = 'Publicado por'; $lang['es_ES']['BlogSummary.ss']['POSTEDON'] = 'en'; diff --git a/lang/es_MX.php b/lang/es_MX.php index 2bb2f6a..f90f407 100644 --- a/lang/es_MX.php +++ b/lang/es_MX.php @@ -54,7 +54,7 @@ $lang['es_MX']['BlogManagementWidget']['SINGULARNAME'] = 'Wisdget para la Gestio $lang['es_MX']['BlogManagementWidget.ss']['LOGOUT'] = 'Salir'; $lang['es_MX']['BlogManagementWidget.ss']['POSTNEW'] = 'Enviar nueva entrada a la bitácora'; $lang['es_MX']['BlogManagementWidget']['UNM1'] = 'Tienes 1 comentario pendiente de moderación'; -$lang['es_MX']['BlogManagementWidget']['UNMM'] = 'Tienes %i comentarios pendientes de moderación'; +$lang['es_MX']['BlogManagementWidget']['UNMM'] = 'Tienes %d comentarios pendientes de moderación'; $lang['es_MX']['BlogSummary.ss']['COMMENTS'] = 'Comentarios'; $lang['es_MX']['BlogSummary.ss']['POSTEDBY'] = 'Enviado por'; $lang['es_MX']['BlogSummary.ss']['POSTEDON'] = 'en'; diff --git a/lang/et_EE.php b/lang/et_EE.php index 5870825..623edcc 100644 --- a/lang/et_EE.php +++ b/lang/et_EE.php @@ -54,7 +54,7 @@ $lang['et_EE']['BlogManagementWidget']['SINGULARNAME'] = 'Blogi muudatuste vidin $lang['et_EE']['BlogManagementWidget.ss']['LOGOUT'] = 'Logi välja'; $lang['et_EE']['BlogManagementWidget.ss']['POSTNEW'] = 'Postita uus blogi sissekanne'; $lang['et_EE']['BlogManagementWidget']['UNM1'] = 'Sul on 1 üle vaatamata kommentaar'; -$lang['et_EE']['BlogManagementWidget']['UNMM'] = 'Sul on %i üle vaatamata kommentaari'; +$lang['et_EE']['BlogManagementWidget']['UNMM'] = 'Sul on %d üle vaatamata kommentaari'; $lang['et_EE']['BlogSummary.ss']['COMMENTS'] = 'Kommentaarid'; $lang['et_EE']['BlogSummary.ss']['POSTEDBY'] = 'Postitas'; $lang['et_EE']['BlogSummary.ss']['POSTEDON'] = '-'; diff --git a/lang/fr_FR.php b/lang/fr_FR.php index 3b94edd..84b70c5 100644 --- a/lang/fr_FR.php +++ b/lang/fr_FR.php @@ -54,7 +54,7 @@ $lang['fr_FR']['BlogManagementWidget']['SINGULARNAME'] = 'Widget de Management B $lang['fr_FR']['BlogManagementWidget.ss']['LOGOUT'] = 'Déconnexion'; $lang['fr_FR']['BlogManagementWidget.ss']['POSTNEW'] = 'Publier une nouvelle entrée dans le blog'; $lang['fr_FR']['BlogManagementWidget']['UNM1'] = 'Vous avez 1 commentaire non modéré'; -$lang['fr_FR']['BlogManagementWidget']['UNMM'] = 'Vous avez %i commentaires non modérés'; +$lang['fr_FR']['BlogManagementWidget']['UNMM'] = 'Vous avez %d commentaires non modérés'; $lang['fr_FR']['BlogSummary.ss']['COMMENTS'] = 'Commentaires'; $lang['fr_FR']['BlogSummary.ss']['POSTEDBY'] = 'Posté par'; $lang['fr_FR']['BlogSummary.ss']['POSTEDON'] = 'sur'; diff --git a/lang/is_IS.php b/lang/is_IS.php index 1da4b68..149a0cc 100644 --- a/lang/is_IS.php +++ b/lang/is_IS.php @@ -53,7 +53,7 @@ $lang['is_IS']['BlogManagementWidget']['SINGULARNAME'] = 'Blogg stjórnunar auka $lang['is_IS']['BlogManagementWidget.ss']['LOGOUT'] = 'Útskrá'; $lang['is_IS']['BlogManagementWidget.ss']['POSTNEW'] = 'Skrifa nýja færslu'; $lang['is_IS']['BlogManagementWidget']['UNM1'] = 'Þú átt 1 óskoðaða athugasemd'; -$lang['is_IS']['BlogManagementWidget']['UNMM'] = 'Þú átt %i óskoðaða athugasemd'; +$lang['is_IS']['BlogManagementWidget']['UNMM'] = 'Þú átt %d óskoðaða athugasemd'; $lang['is_IS']['BlogSummary.ss']['COMMENTS'] = 'Athugasemdir'; $lang['is_IS']['BlogSummary.ss']['POSTEDBY'] = 'Skráð af'; $lang['is_IS']['BlogSummary.ss']['POSTEDON'] = 'á'; diff --git a/lang/it_IT.php b/lang/it_IT.php index 3591dd8..93fe283 100644 --- a/lang/it_IT.php +++ b/lang/it_IT.php @@ -54,7 +54,7 @@ $lang['it_IT']['BlogManagementWidget']['SINGULARNAME'] = 'Widget di amministrazi $lang['it_IT']['BlogManagementWidget.ss']['LOGOUT'] = 'Esci'; $lang['it_IT']['BlogManagementWidget.ss']['POSTNEW'] = 'Inserisci un nuovo post'; $lang['it_IT']['BlogManagementWidget']['UNM1'] = 'Hai 1 commento da moderare'; -$lang['it_IT']['BlogManagementWidget']['UNMM'] = 'Hai %i commenti non approvati'; +$lang['it_IT']['BlogManagementWidget']['UNMM'] = 'Hai %d commenti non approvati'; $lang['it_IT']['BlogSummary.ss']['COMMENTS'] = 'Commenti'; $lang['it_IT']['BlogSummary.ss']['POSTEDBY'] = 'Inserito da'; $lang['it_IT']['BlogSummary.ss']['POSTEDON'] = 'su'; diff --git a/lang/nl_NL.php b/lang/nl_NL.php index 294fe4a..347f45d 100644 --- a/lang/nl_NL.php +++ b/lang/nl_NL.php @@ -54,7 +54,7 @@ $lang['nl_NL']['BlogManagementWidget']['SINGULARNAME'] = 'Blog Management Widget $lang['nl_NL']['BlogManagementWidget.ss']['LOGOUT'] = 'Afmelden'; $lang['nl_NL']['BlogManagementWidget.ss']['POSTNEW'] = 'Publiceer een nieuw blog entree'; $lang['nl_NL']['BlogManagementWidget']['UNM1'] = 'U heeft 1 niet gecontroleerde opmerking'; -$lang['nl_NL']['BlogManagementWidget']['UNMM'] = 'U heeft %i niet gecontroleerde opmerkingen'; +$lang['nl_NL']['BlogManagementWidget']['UNMM'] = 'U heeft %d niet gecontroleerde opmerkingen'; $lang['nl_NL']['BlogSummary.ss']['COMMENTS'] = 'Reacties'; $lang['nl_NL']['BlogSummary.ss']['POSTEDBY'] = 'Geplaatst door'; $lang['nl_NL']['BlogSummary.ss']['POSTEDON'] = 'Aan'; diff --git a/lang/pl_PL.php b/lang/pl_PL.php index b1c9e2e..a805efc 100644 --- a/lang/pl_PL.php +++ b/lang/pl_PL.php @@ -50,7 +50,7 @@ $lang['pl_PL']['BlogManagementWidget']['COMADM'] = 'Administracja komentarzami'; $lang['pl_PL']['BlogManagementWidget.ss']['LOGOUT'] = 'Wyloguj'; $lang['pl_PL']['BlogManagementWidget.ss']['POSTNEW'] = 'Dodaj nowy wpis'; $lang['pl_PL']['BlogManagementWidget']['UNM1'] = 'Masz 1 niesprawdzony komentarz'; -$lang['pl_PL']['BlogManagementWidget']['UNMM'] = 'Masz %i niesprawdzonych komentarzy'; +$lang['pl_PL']['BlogManagementWidget']['UNMM'] = 'Masz %d niesprawdzonych komentarzy'; $lang['pl_PL']['BlogSummary.ss']['COMMENTS'] = 'Komentarze'; $lang['pl_PL']['BlogSummary.ss']['POSTEDBY'] = 'Napisane przez'; $lang['pl_PL']['BlogSummary.ss']['POSTEDON'] = 'Opublikowano'; diff --git a/lang/pt_PT.php b/lang/pt_PT.php index 2cd2943..9b4bd16 100644 --- a/lang/pt_PT.php +++ b/lang/pt_PT.php @@ -29,7 +29,7 @@ $lang['pt_PT']['BlogHolder']['SUCTITLE'] = 'O módulo do blog do SilverStripe fo $lang['pt_PT']['BlogManagementWidget']['COMADM'] = 'Administração de comentários'; $lang['pt_PT']['BlogManagementWidget.ss']['LOGOUT'] = 'Sair'; $lang['pt_PT']['BlogManagementWidget']['UNM1'] = 'Existe 1 comentário por moderar'; -$lang['pt_PT']['BlogManagementWidget']['UNMM'] = 'Existem %i comentários por moderar'; +$lang['pt_PT']['BlogManagementWidget']['UNMM'] = 'Existem %d comentários por moderar'; $lang['pt_PT']['BlogSummary.ss']['COMMENTS'] = 'Comentários'; $lang['pt_PT']['BlogSummary.ss']['POSTEDON'] = 'em'; $lang['pt_PT']['RSSWidget']['NTS'] = 'Número de items para mostrar'; diff --git a/lang/ru_RU.php b/lang/ru_RU.php index e6215c5..4d0b205 100644 --- a/lang/ru_RU.php +++ b/lang/ru_RU.php @@ -46,7 +46,7 @@ $lang['ru_RU']['BlogManagementWidget']['COMADM'] = 'Управление ком $lang['ru_RU']['BlogManagementWidget.ss']['LOGOUT'] = 'Выход'; $lang['ru_RU']['BlogManagementWidget.ss']['POSTNEW'] = 'Опубликовать новую запись'; $lang['ru_RU']['BlogManagementWidget']['UNM1'] = 'У вас 1 непроверенный комментарий'; -$lang['ru_RU']['BlogManagementWidget']['UNMM'] = 'У вас %i непроверенных комментариев'; +$lang['ru_RU']['BlogManagementWidget']['UNMM'] = 'У вас %d непроверенных комментариев'; $lang['ru_RU']['BlogSummary.ss']['COMMENTS'] = 'Комментарии'; $lang['ru_RU']['BlogSummary.ss']['POSTEDBY'] = 'Автор:'; $lang['ru_RU']['BlogSummary.ss']['POSTEDON'] = ':'; diff --git a/lang/tr_TR.php b/lang/tr_TR.php index 23d9564..0707f6b 100644 --- a/lang/tr_TR.php +++ b/lang/tr_TR.php @@ -54,7 +54,7 @@ $lang['tr_TR']['BlogManagementWidget']['SINGULARNAME'] = 'Blog Yönetim Zımbır $lang['tr_TR']['BlogManagementWidget.ss']['LOGOUT'] = 'Oturumu kapat'; $lang['tr_TR']['BlogManagementWidget.ss']['POSTNEW'] = 'Yeni bir blog girdisi oluştur'; $lang['tr_TR']['BlogManagementWidget']['UNM1'] = '1 adet onay bekleyen yorumunuz var'; -$lang['tr_TR']['BlogManagementWidget']['UNMM'] = '%i adet onay bekleyen yorumunuz var'; +$lang['tr_TR']['BlogManagementWidget']['UNMM'] = '%d adet onay bekleyen yorumunuz var'; $lang['tr_TR']['BlogSummary.ss']['COMMENTS'] = 'Yorumlar'; $lang['tr_TR']['BlogSummary.ss']['POSTEDBY'] = 'Gönderen: '; $lang['tr_TR']['BlogSummary.ss']['POSTEDON'] = 'üzerinde';