60 lines
2.4 KiB
PHP
60 lines
2.4 KiB
PHP
<?php
|
|
|
|
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
|
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
|
use Symfony\Component\Routing\RequestContext;
|
|
|
|
/**
|
|
* This class has been auto-generated
|
|
* by the Symfony Routing Component.
|
|
*/
|
|
class ProjectUrlMatcherHookAdminHome extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|
{
|
|
public function __construct(RequestContext $context)
|
|
{
|
|
$this->context = $context;
|
|
}
|
|
|
|
public function match($rawPathinfo)
|
|
{
|
|
$allow = array();
|
|
$pathinfo = rawurldecode($rawPathinfo);
|
|
$context = $this->context;
|
|
$request = $this->request ?: $this->createRequest($pathinfo);
|
|
|
|
if (0 === strpos($pathinfo, '/admin')) {
|
|
if (0 === strpos($pathinfo, '/admin/home')) {
|
|
// admin.home.stats
|
|
if ('/admin/home/stats' === $pathinfo) {
|
|
return array ( '_controller' => 'HookAdminHome\\Controller\\HomeController::loadStatsAjaxAction', '_route' => 'admin.home.stats',);
|
|
}
|
|
|
|
// admin.home.month.sales.block
|
|
if (0 === strpos($pathinfo, '/admin/home/month-sales-block') && preg_match('#^/admin/home/month\\-sales\\-block/(?P<month>\\d+)/(?P<year>\\d+)$#sD', $pathinfo, $matches)) {
|
|
return $this->mergeDefaults(array_replace($matches, array('_route' => 'admin.home.month.sales.block')), array ( '_controller' => 'HookAdminHome\\Controller\\HomeController::blockMonthSalesStatistics',));
|
|
}
|
|
|
|
}
|
|
|
|
// admin.news-feed
|
|
if ('/admin/ajax/thelia_news_feed' === $pathinfo) {
|
|
return array ( '_controller' => 'HookAdminHome\\Controller\\HomeController::processTemplateAction', 'template' => 'ajax/thelia_news_feed', 'not-logged' => '1', '_route' => 'admin.news-feed',);
|
|
}
|
|
|
|
// admin.home.config
|
|
if ('/admin/module/HookAdminHome/configure' === $pathinfo) {
|
|
if ($this->context->getMethod() != 'POST') {
|
|
$allow[] = 'POST';
|
|
goto not_adminhomeconfig;
|
|
}
|
|
|
|
return array ( '_controller' => 'HookAdminHome\\Controller\\ConfigurationController::editConfiguration', '_route' => 'admin.home.config',);
|
|
}
|
|
not_adminhomeconfig:
|
|
|
|
}
|
|
|
|
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
|
|
}
|
|
}
|