Skip to content

Commit

Permalink
improve editorial comments inicialization
Browse files Browse the repository at this point in the history
  • Loading branch information
takeit committed Apr 7, 2015
1 parent 4d5d823 commit 8f4b878
Show file tree
Hide file tree
Showing 11 changed files with 10,714 additions and 439 deletions.
13 changes: 6 additions & 7 deletions newscoop/library/Newscoop/Services/EditorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @copyright 2015 Sourcefabric z.ú.
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*/

namespace Newscoop\Services;

use Newscoop\EditorInterface;
Expand Down Expand Up @@ -37,14 +36,14 @@ public function getLink($article)
$language = $this->em->getReference('Newscoop\Entity\Language', $articleInfo['languageId']);
$arguments = $this->dispatcher->dispatch('newscoop_admin.editor', new GenericEvent(null, array(
'articleNumber' => $articleInfo['number'],
'articleLanguage' => $language->getCode()
'articleLanguage' => $language->getCode(),
)));

if ($arguments->hasArgument('link') && $arguments->getArgument('link')) {
return $arguments->getArgument('link');
}

return self::DEFAULT_EDITOR_LINK . $this->getLinkParameters($article);
return self::DEFAULT_EDITOR_LINK.$this->getLinkParameters($article);
}

/**
Expand All @@ -54,10 +53,10 @@ public function getLinkParameters($article)
{
$article = $this->getArticleDetails($article);

return '?f_publication_id=' . $article['publicationId']
. '&f_issue_number=' . $article['issueId'] . '&f_section_number=' . $article['sectionId']
. '&f_article_number=' . $article['number'] . '&f_language_id=' . $article['languageId']
. '&f_language_selected=' . $article['languageId'];
return '?f_publication_id='.$article['publicationId']
.'&f_issue_number='.$article['issueId'].'&f_section_number='.$article['sectionId']
.'&f_article_number='.$article['number'].'&f_language_id='.$article['languageId']
.'&f_language_selected='.$article['languageId'];
}

private function getArticleDetails($article)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @copyright 2014 Sourcefabric z.ú.
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*/

namespace Newscoop\ArticlesBundle\EventListener;

use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
Expand Down Expand Up @@ -50,6 +49,8 @@ public function renderEditorialCommentsTemplate(PluginHooksEvent $event)

$response = $this->templating->renderResponse('NewscoopArticlesBundle:Hook:editorialComments.html.twig', array(
'article' => $article,
'articleNumber' => $article->getArticleNumber(),
'articleLanguage' => $article->getLanguageId(),
'clientId' => $client->getPublicId(),
'pluginName' => 'Editorial Comments',
));
Expand Down
Loading

0 comments on commit 8f4b878

Please sign in to comment.