Пример #1
0
 /**
  * Automatically generated run method
  *
  * @param Request $request
  * @param PayloadInterface $payload
  * @return JsonResponse
  */
 public function run(Request $request, PayloadInterface $payload = null)
 {
     $info = $payload->get('info');
     $playerUrl = null;
     $twittercards = $info->getProvider('twittercards');
     if ($twittercards) {
         $playerUrl = $twittercards->bag->get('player');
     }
     if (empty($playerUrl)) {
         $matches = [];
         preg_match('/src="([^"]+)"/', $info->code, $matches);
         $playerUrl = $matches[1];
     }
     return new JsonResponse(['title' => $info->title, 'description' => $info->description, 'url' => $info->url, 'type' => $info->type, 'tags' => $info->tags, 'images' => $info->images, 'image' => $info->image, 'image-width' => $info->imageWidth, 'image-height' => $info->imageHeight, 'code' => $info->code, 'player-url' => $playerUrl, 'width' => $info->width, 'height' => $info->height, 'aspect-ratio' => $info->aspectRatio, 'author-name' => $info->authorName, 'author-url' => $info->authorUrl, 'provider-name' => $info->providerName, 'provider-url' => $info->providerUrl, 'provider-icons' => $info->providerIcons, 'provider-icon' => $info->providerIcon, 'published-date' => $info->publishedTime, 'license' => $info->license]);
 }
 /**
  * Automatically generated run method
  *
  * @param Request $request
  * @param PayloadInterface $payload
  * @return Response
  */
 protected function form(Request $request, PayloadInterface $payload = null)
 {
     return new Response($this->render('/gossi/trixionary-client/templates/manage-add.twig', $payload->get()));
 }
 protected function updated(Request $request, PayloadInterface $payload = null)
 {
     $sport = $payload->getModel()->getSport();
     $baseUrl = $this->getServiceContainer()->getKernel()->getApplication()->getBaseUrl();
     return new RedirectResponse($baseUrl . '/manage/' . $sport->getId() . '/objects');
 }
Пример #4
0
 /**
  * Automatically generated run method
  *
  * @param Request $request
  * @param PayloadInterface $payload
  * @return Response
  */
 public function run(Request $request, PayloadInterface $payload = null)
 {
     return new Response($this->render('/keeko/account/templates/account.twig', $payload->get()));
 }
 /**
  * Automatically generated run method
  *
  * @param Request $request
  * @param PayloadInterface $payload
  * @return Response
  */
 public function run(Request $request, PayloadInterface $payload = null)
 {
     return new Response($this->render('/gossi/trixionary-client/templates/index.twig', $payload->get()));
 }
Пример #6
0
 protected function form(Request $request, PayloadInterface $payload)
 {
     $prefs = $this->getServiceContainer()->getPreferenceLoader()->getSystemPreferences();
     $data = array_merge($payload->get(), ['prefs' => ['login' => $prefs->getUserLogin(), 'names' => $prefs->getUserNames(), 'email' => $prefs->getUserEmail(), 'sex' => $prefs->getUserSex(), 'birth' => $prefs->getUserBirth(), 'nick_name' => $prefs->getUserNickname(), 'display_name' => $prefs->getUserDisplayName(), 'display_option_given_family' => $prefs->getUserDisplayOptionGivenFamilyName(), 'display_option_family_given' => $prefs->getUserDisplayOptionFamilyGivenName(), 'display_option_username' => $prefs->getUserDisplayOptionUsername(), 'display_option_nickname' => $prefs->getUserDisplayOptionNickname(), 'display_given_family' => SystemPreferences::DISPLAY_GIVENFAMILYNAME, 'display_family_given' => SystemPreferences::DISPLAY_FAMILYGIVENNAME, 'display_nickname' => SystemPreferences::DISPLAY_NICKNAME, 'display_username' => SystemPreferences::DISPLAY_USERNAME], 'target' => $request->getUri()]);
     return new Response($this->render('/keeko/account/templates/register.twig', $data));
 }
 /**
  * Automatically generated run method
  *
  * @param Request $request
  * @param PayloadInterface $payload
  * @return Response
  */
 protected function question(Request $request, PayloadInterface $payload = null)
 {
     return new Response($this->render('/gossi/trixionary-client/templates/objects-delete.twig', $payload->get()));
 }