mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
Fixed codestyle
This commit is contained in:
@@ -37,7 +37,6 @@ class Publications implements ControllerProviderInterface
|
|||||||
});
|
});
|
||||||
|
|
||||||
$controllers->get('/list/', function(PhraseaApplication $app) {
|
$controllers->get('/list/', function(PhraseaApplication $app) {
|
||||||
|
|
||||||
$feeds = $app['EM']->getRepository('Entities\Feed')->getAllForUser(
|
$feeds = $app['EM']->getRepository('Entities\Feed')->getAllForUser(
|
||||||
$app['authentication']->getUser()
|
$app['authentication']->getUser()
|
||||||
);
|
);
|
||||||
@@ -47,7 +46,6 @@ class Publications implements ControllerProviderInterface
|
|||||||
})->bind('admin_feeds_list');
|
})->bind('admin_feeds_list');
|
||||||
|
|
||||||
$controllers->post('/create/', function(PhraseaApplication $app, Request $request) {
|
$controllers->post('/create/', function(PhraseaApplication $app, Request $request) {
|
||||||
|
|
||||||
if ('' === $title = trim($request->request->get('title', ''))) {
|
if ('' === $title = trim($request->request->get('title', ''))) {
|
||||||
$app->abort(400, "Bad request");
|
$app->abort(400, "Bad request");
|
||||||
}
|
}
|
||||||
|
@@ -134,7 +134,7 @@ class Feed implements ControllerProviderInterface
|
|||||||
$app->abort(403, 'Unathorized action');
|
$app->abort(403, 'Unathorized action');
|
||||||
}
|
}
|
||||||
if ('' === $title = trim($request->request->get('title', ''))) {
|
if ('' === $title = trim($request->request->get('title', ''))) {
|
||||||
$app->abort(400, "Bad request");
|
$app->abort(400, "Bad request");
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry->setAuthorEmail($request->request->get('author_mail'))
|
$entry->setAuthorEmail($request->request->get('author_mail'))
|
||||||
@@ -215,13 +215,11 @@ class Feed implements ControllerProviderInterface
|
|||||||
|
|
||||||
$feeds = $app['EM']->getRepository('Entities\Feed')->getAllForUser($app['authentication']->getUser());
|
$feeds = $app['EM']->getRepository('Entities\Feed')->getAllForUser($app['authentication']->getUser());
|
||||||
|
|
||||||
$datas = $app['twig']->render('prod/feeds/feeds.html.twig'
|
$datas = $app['twig']->render('prod/feeds/feeds.html.twig', array(
|
||||||
, array(
|
'feeds' => $feeds,
|
||||||
'feeds' => $feeds
|
'feed' => new Aggregate($app['EM'], $feeds),
|
||||||
, 'feed' => new Aggregate($app['EM'], $feeds)
|
'page' => $page
|
||||||
, 'page' => $page
|
));
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return new Response($datas);
|
return new Response($datas);
|
||||||
})->bind('prod_feeds');
|
})->bind('prod_feeds');
|
||||||
@@ -247,7 +245,11 @@ class Feed implements ControllerProviderInterface
|
|||||||
|
|
||||||
$aggregate = new Aggregate($app['EM'], $feeds);
|
$aggregate = new Aggregate($app['EM'], $feeds);
|
||||||
|
|
||||||
$link = $app['feed.aggregate-link-generator']->generate($aggregate, $app['authentication']->getUser(), AggregateLinkGenerator::FORMAT_RSS, null, $renew);
|
$link = $app['feed.aggregate-link-generator']->generate($aggregate,
|
||||||
|
$app['authentication']->getUser(),
|
||||||
|
AggregateLinkGenerator::FORMAT_RSS,
|
||||||
|
null, $renew
|
||||||
|
);
|
||||||
|
|
||||||
$output = array(
|
$output = array(
|
||||||
'texte' => '<p>' . _('publication::Voici votre fil RSS personnel. Il vous permettra d\'etre tenu au courrant des publications.')
|
'texte' => '<p>' . _('publication::Voici votre fil RSS personnel. Il vous permettra d\'etre tenu au courrant des publications.')
|
||||||
|
@@ -204,14 +204,14 @@ class Aggregate implements FeedInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function hasPage($page, $pageSize)
|
public function hasPage($pageNumber, $nbEntriesByPage)
|
||||||
{
|
{
|
||||||
if (0 >= $pageSize) {
|
if (0 >= $nbEntriesByPage) {
|
||||||
throw new LogicException;
|
throw new LogicException;
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = $this->getCountTotalEntries();
|
$count = $this->getCountTotalEntries();
|
||||||
if (0 > $page && $page <= $count / $pageSize) {
|
if (0 > $pageNumber && $pageNumber <= $count / $nbEntriesByPage) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,10 +68,10 @@ interface FeedInterface
|
|||||||
/**
|
/**
|
||||||
* Returns a boolean indicating whether the feed has a given page.
|
* Returns a boolean indicating whether the feed has a given page.
|
||||||
*
|
*
|
||||||
* @param integer $page
|
* @param integer $pageNumber
|
||||||
* @param integer $pageSize
|
* @param integer $nbEntriesByPage
|
||||||
*
|
*
|
||||||
* @return \DateTime
|
* @return \DateTime
|
||||||
*/
|
*/
|
||||||
public function hasPage($page, $pageSize);
|
public function hasPage($pageNumber, $nbEntriesByPage);
|
||||||
}
|
}
|
||||||
|
@@ -531,14 +531,13 @@ class Feed implements FeedInterface
|
|||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function hasPage($page, $pageSize)
|
public function hasPage($pageNumber, $nbEntriesByPage)
|
||||||
{
|
{
|
||||||
if (0 >= $pageSize) {
|
if (0 >= $nbEntriesByPage) {
|
||||||
throw new LogicException;
|
throw new LogicException;
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = $this->getCountTotalEntries();
|
$count = $this->getCountTotalEntries();
|
||||||
if (0 > $page && $page <= $count / $pageSize) {
|
if (0 > $pageNumber && $pageNumber <= $count / $nbEntriesByPage) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Repositories;
|
namespace Repositories;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
@@ -1,5 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Repositories;
|
namespace Repositories;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
@@ -1,5 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Repositories;
|
namespace Repositories;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
@@ -1,5 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Repositories;
|
namespace Repositories;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
@@ -1,5 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Repositories;
|
namespace Repositories;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
@@ -1,5 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Repositories;
|
namespace Repositories;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
@@ -121,7 +121,6 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->broker->notify($user_to_notif->get_id(), __CLASS__, $datas, $mailed);
|
$this->broker->notify($user_to_notif->get_id(), __CLASS__, $datas, $mailed);
|
||||||
|
|
||||||
}
|
}
|
||||||
$start += $perLoop;
|
$start += $perLoop;
|
||||||
} while (count($results) > 0);
|
} while (count($results) > 0);
|
||||||
|
Reference in New Issue
Block a user