From e0a40a467d45df032d86da0e12a031b427451797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Muszy=C5=84ski?= Date: Tue, 2 Dec 2014 11:58:50 +0100 Subject: [PATCH] change topics implementation in AES --- newscoop/admin-files/articles/edit.php | 17 +- .../admin-files/articles/edit_topics_box.php | 38 +-- .../admin-files/libs/ArticleList/filters.php | 276 +++++++++--------- newscoop/admin-files/menu.php | 24 +- .../controllers/TopicController.php | 11 +- .../library/Newscoop/Entity/ArticleTopic.php | 7 +- .../Repository/ArticleTopicRepository.php | 25 ++ .../Entity/Repository/LanguageRepository.php | 29 +- .../Entity/Repository/UserTopicRepository.php | 16 +- .../library/Newscoop/Entity/UserTopic.php | 13 +- .../Newscoop/Services/UserTopicService.php | 36 ++- .../Controller/TopicsController.php | 14 +- .../Entity/Repository/TopicRepository.php | 55 +++- .../Newscoop/NewscoopBundle/Entity/Topic.php | 48 +++ .../Resources/translations/topics.en.yml | 1 + .../Resources/views/Topics/index.html.twig | 5 +- 16 files changed, 372 insertions(+), 243 deletions(-) create mode 100644 newscoop/library/Newscoop/Entity/Repository/ArticleTopicRepository.php diff --git a/newscoop/admin-files/articles/edit.php b/newscoop/admin-files/articles/edit.php index d7b16b9e62..c0a2e4f193 100644 --- a/newscoop/admin-files/articles/edit.php +++ b/newscoop/admin-files/articles/edit.php @@ -31,7 +31,7 @@ // Whether to show comments at the bottom of the article // (you may not want to show them to speed up your loading time) // Selected language of the article -$f_language_selected = (int)camp_session_get('f_language_selected', 0); +$f_language_selected = (int) camp_session_get('f_language_selected', 0); if (!Input::IsValid()) { camp_html_display_error($translator->trans('Invalid input: $1', array('$1' => Input::GetErrorString())), $_SERVER['REQUEST_URI']); @@ -67,7 +67,11 @@ $lockUserObj = new User($articleObj->getLockedByUser()); $articleCreator = new User($articleObj->getCreatorId()); $articleEvents = ArticlePublish::GetArticleEvents($f_article_number, $f_language_selected, TRUE); -$articleTopics = ArticleTopic::GetArticleTopics($f_article_number); +$em = \Zend_Registry::get('container')->getService('em'); +$articleTopics = $em->getRepository("Newscoop\Entity\ArticleTopic") + ->getArticleTopicsQuery($f_article_number) + ->getResult(); +//ArticleTopic::GetArticleTopics($f_article_number); $articleFiles = ArticleAttachment::GetAttachmentsByArticleNumber($f_article_number, $f_language_selected); $articleLanguages = $articleObj->getLanguages(); @@ -220,7 +224,7 @@ function parseTextBody($text, $articleNumber) if (isset($imageMatches[1][0])) { if (isset($titles) && sizeof($titles) > 0) { - for($x = 0; $x < sizeof($titles[0]); $x++) { + for ($x = 0; $x < sizeof($titles[0]); $x++) { $text = preg_replace("/\s*".preg_replace('~\/~', '\/', preg_quote($titles[0][$x]))."/", ' title="'.$titles[1][$x].'"', $text); } @@ -255,12 +259,13 @@ function parseTextBody($text, $articleNumber) print (''); } } + return $text; } $hasMultiDates = false; $multiDatesFields = array(); -include_once('edit_html.php'); +include_once 'edit_html.php'; // Display tinymce loading code if required $hasArticleBodyField = FALSE; @@ -307,6 +312,4 @@ function parseTextBody($text, $articleNumber) } } -include ("edit_javascript.php"); - -?> +include 'edit_javascript.php'; diff --git a/newscoop/admin-files/articles/edit_topics_box.php b/newscoop/admin-files/articles/edit_topics_box.php index 0d50e11205..5918e14c84 100644 --- a/newscoop/admin-files/articles/edit_topics_box.php +++ b/newscoop/admin-files/articles/edit_topics_box.php @@ -16,8 +16,8 @@ class="input_text" value="getKeywords(); ?>" onkeyup="" - + diff --git a/newscoop/admin-files/menu.php b/newscoop/admin-files/menu.php index f85c10077a..e966d04c5d 100644 --- a/newscoop/admin-files/menu.php +++ b/newscoop/admin-files/menu.php @@ -27,7 +27,7 @@ //--> - + @@ -39,11 +39,11 @@ + +