This commit is contained in:
Jeremy
2015-01-31 19:09:34 +01:00
parent 1990517b22
commit 7df80cb32c
47 changed files with 153 additions and 183 deletions

View File

@ -8,14 +8,12 @@ use Symfony\Component\HttpFoundation\Request;
use Wallabag\CoreBundle\Repository;
use Wallabag\CoreBundle\Entity\Entries;
use Wallabag\CoreBundle\Service\Extractor;
use Wallabag\CoreBundle\Helper\Tools;
use Wallabag\CoreBundle\Helper\Url;
class EntryController extends Controller
{
/**
* @param Request $request
* @param Request $request
* @Route("/new", name="new_entry")
* @return \Symfony\Component\HttpFoundation\Response
*/
@ -32,7 +30,6 @@ class EntryController extends Controller
$form->handleRequest($request);
if ($form->isValid()) {
$content = Extractor::extract($entry->getUrl());
$entry->setTitle($content->getTitle());
@ -115,7 +112,7 @@ class EntryController extends Controller
/**
* Shows entry content
*
* @param Entries $entry
* @param Entries $entry
* @Route("/view/{id}", requirements={"id" = "\d+"}, name="view")
* @return \Symfony\Component\HttpFoundation\Response
*/
@ -130,8 +127,8 @@ class EntryController extends Controller
/**
* Changes read status for an entry
*
* @param Request $request
* @param Entries $entry
* @param Request $request
* @param Entries $entry
* @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry")
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
@ -151,8 +148,8 @@ class EntryController extends Controller
/**
* Changes favorite status for an entry
*
* @param Request $request
* @param Entries $entry
* @param Request $request
* @param Entries $entry
* @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry")
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/
@ -172,8 +169,8 @@ class EntryController extends Controller
/**
* Deletes entry
*
* @param Request $request
* @param Entries $entry
* @param Request $request
* @param Entries $entry
* @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry")
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/

View File

@ -18,10 +18,11 @@ class SecurityController extends Controller
$error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
$session->remove(SecurityContext::AUTHENTICATION_ERROR);
}
return $this->render('WallabagCoreBundle:Security:login.html.twig', array(
// last username entered by the user
'last_username' => $session->get(SecurityContext::LAST_USERNAME),
'error' => $error,
));
}
}
}

View File

@ -3,7 +3,6 @@
namespace Wallabag\CoreBundle\Controller;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use FOS\RestBundle\Controller\Annotations\View;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Wallabag\CoreBundle\Entity\Entries;
@ -12,7 +11,6 @@ use Wallabag\CoreBundle\Service\Extractor;
class WallabagRestController extends Controller
{
/**
* Retrieve all entries. It could be filtered by many options.
*
@ -44,14 +42,13 @@ class WallabagRestController extends Controller
$entries = $this
->getDoctrine()
->getRepository('WallabagCoreBundle:Entries')
->findEntries(1, (int)$isArchived, (int)$isStarred, (int)$isDeleted, $sort, $order);
->findEntries(1, (int) $isArchived, (int) $isStarred, (int) $isDeleted, $sort, $order);
if(!is_array($entries)) {
if (!is_array($entries)) {
throw $this->createNotFoundException();
}
return $entries;
}
/**
@ -119,7 +116,6 @@ class WallabagRestController extends Controller
*/
public function patchEntriesAction(Entries $entry)
{
}
/**
@ -133,10 +129,8 @@ class WallabagRestController extends Controller
*/
public function deleteEntriesAction(Entries $entry)
{
}
/**
* Retrieve all tags for an entry
*
@ -146,8 +140,8 @@ class WallabagRestController extends Controller
* }
* )
*/
public function getEntriesTagsAction(Entries $entry) {
public function getEntriesTagsAction(Entries $entry)
{
}
/**
@ -162,8 +156,8 @@ class WallabagRestController extends Controller
* }
* )
*/
public function postEntriesTagsAction(Entries $entry) {
public function postEntriesTagsAction(Entries $entry)
{
}
/**
@ -178,7 +172,6 @@ class WallabagRestController extends Controller
*/
public function deleteEntriesTagsAction(Entries $entry, Tags $tag)
{
}
/**
@ -187,8 +180,8 @@ class WallabagRestController extends Controller
* @ApiDoc(
* )
*/
public function getTagsAction() {
public function getTagsAction()
{
}
/**
@ -200,8 +193,8 @@ class WallabagRestController extends Controller
* }
* )
*/
public function getTagAction(Tags $tag) {
public function getTagAction(Tags $tag)
{
}
/**
@ -215,6 +208,5 @@ class WallabagRestController extends Controller
*/
public function deleteTagAction(Tags $tag)
{
}
}
}