Browse Source

changed login icon by studio, started to craft the studio ui

Bachir Soussi Chiadmi 7 years ago
parent
commit
294d660d5f

+ 31 - 0
sites/all/modules/figli/edlp_studio/edlp_studio.module

@@ -33,6 +33,37 @@ function edlp_studio_page_attachments(array &$attachments) {
 }
 
 
+/**
+ * Implements hook_theme().
+ */
+function edlp_studio_theme($existing, $type, $theme, $path) {
+  // @see https://www.drupal.org/docs/8/theming/twig/create-custom-twig-templates-from-custom-module
+
+  return array(
+    'edlp_chutier_ui' => array(
+      'file' => 'includes/edlp_chutier_ui.inc',
+      'variables' => array(
+        'documents' => array(),
+      ),
+    ),
+    'edlp_composition_ui' => array(
+      'file' => 'includes/edlp_composition_ui.inc',
+      'variables' => array(
+        'compositions' => array(),
+      ),
+    ),
+    'edlp_studio_ui' => array(
+      'file' => 'includes/edlp_studio_ui.inc',
+      'variables' => array(
+        'chutier' => null,
+        'compositions' => null,
+      ),
+    ),
+  );
+}
+
+
+
 /**
 * hook_entity_extra_field_info()
 *

+ 8 - 0
sites/all/modules/figli/edlp_studio/edlp_studio.routing.yml

@@ -14,3 +14,11 @@ edlp_studio.chutier_controller_ajax_add_content:
     cid: null
   requirements:
     _permission: 'use chutier'
+
+edlp_studio.studio_ui:
+  path: '/edlp/studio-ui'
+  defaults:
+    _controller: '\Drupal\edlp_studio\Controller\StudioUIController::StudioUI'
+    _title: 'Studio User Interface'
+  requirements:
+    _permission: 'use chutier'

+ 12 - 0
sites/all/modules/figli/edlp_studio/includes/edlp_chutier_ui.inc

@@ -0,0 +1,12 @@
+<?php
+
+// use Drupal\Core\Url;
+
+function template_preprocess_edlp_chutier_ui(&$vars){
+  // dpm($vars);
+/*
+  @see https://www.drupal8.ovh/index.php/en/tutoriels/339/render-a-node-or-an-entity
+  */
+  // $view_builder = \Drupal::entityTypeManager()->getViewBuilder($vars['entity_type']);
+  // $vars['content'] = $view_builder->view($vars['entity'], $vars['view_mode']);
+}

+ 12 - 0
sites/all/modules/figli/edlp_studio/includes/edlp_composition_ui.inc

@@ -0,0 +1,12 @@
+<?php
+
+// use Drupal\Core\Url;
+
+function template_preprocess_edlp_compositions_ui(&$vars){
+  // dpm($vars);
+/*
+  @see https://www.drupal8.ovh/index.php/en/tutoriels/339/render-a-node-or-an-entity
+  */
+  // $view_builder = \Drupal::entityTypeManager()->getViewBuilder($vars['entity_type']);
+  // $vars['content'] = $view_builder->view($vars['entity'], $vars['view_mode']);
+}

+ 12 - 0
sites/all/modules/figli/edlp_studio/includes/edlp_studio_ui.inc

@@ -0,0 +1,12 @@
+<?php
+
+// use Drupal\Core\Url;
+
+function template_preprocess_edlp_studio_ui(&$vars){
+  // dpm($vars);
+/*
+  @see https://www.drupal8.ovh/index.php/en/tutoriels/339/render-a-node-or-an-entity
+  */
+  // $view_builder = \Drupal::entityTypeManager()->getViewBuilder($vars['entity_type']);
+  // $vars['content'] = $view_builder->view($vars['entity'], $vars['view_mode']);
+}

+ 1 - 1
sites/all/modules/figli/edlp_studio/src/Controller/ChutierController.php

@@ -3,9 +3,9 @@
 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 Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 
 use Drupal\edlp_studio\Entity\Chutier;

+ 73 - 0
sites/all/modules/figli/edlp_studio/src/Controller/StudioUIController.php

@@ -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')
+    ];
+  }
+
+}

+ 0 - 0
sites/all/modules/figli/edlp_studio/templates/edlp_chutier_ui.html.twig


+ 0 - 0
sites/all/modules/figli/edlp_studio/templates/edlp_composition_ui.html.twig


+ 0 - 0
sites/all/modules/figli/edlp_studio/templates/edlp_studio_ui.html.twig


File diff suppressed because it is too large
+ 0 - 0
sites/all/themes/custom/edlptheme/assets/dist/img/random.svg


File diff suppressed because it is too large
+ 0 - 0
sites/all/themes/custom/edlptheme/assets/dist/img/search.svg


File diff suppressed because it is too large
+ 0 - 0
sites/all/themes/custom/edlptheme/assets/dist/img/studio.svg


+ 1 - 1
sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css

@@ -1822,7 +1822,7 @@ footer {
       position: relative;
       width: 20px;
       height: 20px;
-      background-image: url(../img/user.svg);
+      background-image: url(../img/studio.svg);
       background-size: contain;
       text-indent: 40px;
       margin: 0;

File diff suppressed because it is too large
+ 57 - 0
sites/all/themes/custom/edlptheme/assets/img/random.svg


File diff suppressed because it is too large
+ 31 - 11
sites/all/themes/custom/edlptheme/assets/img/search.svg


File diff suppressed because it is too large
+ 57 - 0
sites/all/themes/custom/edlptheme/assets/img/studio.svg


+ 1 - 1
sites/all/themes/custom/edlptheme/assets/styles/app.scss

@@ -844,7 +844,7 @@ footer{
     h2{
       position: relative;
       width:$wh; height:$wh;
-      background-image: url(../img/user.svg);
+      background-image: url(../img/studio.svg);
       // background-color: red;
       background-size: contain;
       text-indent: $wh*2;

Some files were not shown because too many files changed in this diff