|
@@ -0,0 +1,73 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace Drupal\edlp_studio\Controller;
|
|
|
+
|
|
|
+use Drupal\Core\Controller\ControllerBase;
|
|
|
+use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
|
+use Drupal\Core\Session\AccountInterface;
|
|
|
+use Drupal\User\UserDataInterface;
|
|
|
+
|
|
|
+use Drupal\edlp_studio\Entity\Chutier;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * Class StudioUIController.
|
|
|
+ */
|
|
|
+class StudioUIController extends ControllerBase {
|
|
|
+
|
|
|
+ protected $user;
|
|
|
+ protected $userdata;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Class constructor.
|
|
|
+ */
|
|
|
+ public function __construct(AccountInterface $account, UserDataInterface $userdata) {
|
|
|
+ $this->user = $account;
|
|
|
+ $this->userdata = $userdata;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {@inheritdoc}
|
|
|
+ */
|
|
|
+ public static function create(ContainerInterface $container) {
|
|
|
+ // Instantiates this form class.
|
|
|
+ return new static(
|
|
|
+ // Load the service required to construct this class.
|
|
|
+ $container->get('current_user'),
|
|
|
+ $container->get('user.data')
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Studioui.
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ * Return Hello string.
|
|
|
+ */
|
|
|
+ public function StudioUI() {
|
|
|
+ // get current user
|
|
|
+ // done by DependencyInjection of AccountInterface
|
|
|
+ dpm($this->user->id());
|
|
|
+
|
|
|
+ // get his docs in chutier
|
|
|
+ $docs = Chutier::getUserChutiersContents($this->user->id());
|
|
|
+ dpm($docs);
|
|
|
+
|
|
|
+ // TODO: add chutier theme, preprocess, twig template to studio module
|
|
|
+ // TODO: build content renderable array
|
|
|
+
|
|
|
+ // TODO: get compositions
|
|
|
+ // TODO: add compositions theme, preprocess, twig template to studio module
|
|
|
+ // TODO: build content renderable array
|
|
|
+
|
|
|
+ // TODO: add studio theme, preprocess, twig template to studio module
|
|
|
+ // TODO: build global studio renderable array
|
|
|
+
|
|
|
+ return [
|
|
|
+ '#type' => 'markup',
|
|
|
+ '#markup' => $this->t('Implement method: StudioUI')
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+}
|