public static OnArticleLanguageDelete ( $p_articleNumber, $p_languageId ) : void | ||
Результат | void |
$diffSeconds -= $hours * 3600; $minutes = floor($diffSeconds / 60); $lockUser = new User($articleObj->getLockedByUser()); camp_html_add_msg($translator->trans('Could not save the article. It has been locked by $1 $2 hours and $3 minutes ago.', array('$1' => $lockUser->getRealName(), '$2' => $hours, '$3' => $minutes), 'articles')); camp_html_goto_page($BackLink); exit; } // Update the article author $blogService = Zend_Registry::get('container')->getService('blog'); $blogInfo = $blogService->getBlogInfo($g_user); if (!empty($f_article_author)) { $em = Zend_Registry::get('container')->getService('em'); $dispatcher = Zend_Registry::get('container')->getService('dispatcher'); $language = $em->getRepository('Newscoop\\Entity\\Language')->findOneById($articleObj->getLanguageId()); $authors = $em->getRepository('Newscoop\\Entity\\ArticleAuthor')->getArticleAuthors($articleObj->getArticleNumber(), $language->getCode())->getArrayResult(); ArticleAuthor::OnArticleLanguageDelete($articleObj->getArticleNumber(), $articleObj->getLanguageId()); foreach ($authors as $author) { $dispatcher->dispatch("user.set_points", new \Newscoop\EventDispatcher\Events\GenericEvent($this, array('authorId' => $author['fk_author_id']))); } $i = 0; foreach ($f_article_author as $author) { $authorObj = new Author($author); $author = trim($author); if (!$authorObj->exists() && isset($author[0])) { if ($blogService->isBlogger($g_user)) { // blogger can't create authors continue; } $authorData = Author::ReadName($author); $authorObj->create($authorData); } elseif ($blogService->isBlogger($g_user)) {