changed login icon by studio, started to craft the studio ui
This commit is contained in:
@@ -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()
|
||||
*
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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']);
|
||||
}
|
||||
@@ -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']);
|
||||
}
|
||||
@@ -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']);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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')
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user