Commit 5b693464 authored by Martin Gregor's avatar Martin Gregor
Browse files

pridanie paragrafu na pridavanie viet v admine

parent 11475b40
......@@ -25,6 +25,8 @@ class AdminPresenter extends BasePresenter
$form->addText('url', 'sme.sk URL:')
->setAttribute('placeholder','http://www.sme.sk/c/7054947/vydajte-ujgurov-su-to-teroristi-odkazuje-slovensku-cina.html');
$form->addTextArea('paragraph', 'Text:')
->setAttribute('placeholder', 'Sem napíšte vety, ktoré chcete importovať do systému.');
$form->addSubmit('send', 'Parsovať/Vložiť');
......@@ -42,11 +44,21 @@ class AdminPresenter extends BasePresenter
$this->insertSentence($values->sentence);
$this->flashMessage('Veta '.$values->sentence.' bola uložená.');
}
else if ($values->url)
if ($values->url)
{
$this->parseArticle($values->url);
$this->flashMessage('Článok '.$values->url.' bol spracovaný.');
}
if ($values->paragraph)
{
foreach (explode('.',$values->paragraph) as $sentence)
{
$this->insertSentence($sentence);
}
}
}
private function insertSentence($sentence)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment