|
@@ -138,6 +138,8 @@ function edlp_studio_node_view(array &$build, \Drupal\Core\Entity\EntityInterfac
|
|
|
$user = \Drupal::currentUser();
|
|
|
// dpm($user);
|
|
|
// check if user loged in ? no -> popup message : yes -> links
|
|
|
+ $register_url = Url::fromRoute('user.register');
|
|
|
+
|
|
|
if($user->id() == 0){
|
|
|
$build['chutier_actions'] = array(
|
|
|
'#type' => 'container',
|
|
@@ -156,14 +158,29 @@ function edlp_studio_node_view(array &$build, \Drupal\Core\Entity\EntityInterfac
|
|
|
),
|
|
|
'text'=>array(
|
|
|
'#prefix'=>'<p>',
|
|
|
- '#markup'=>t('Le Studio rassemble vos documents favoris.Il permet de les sauvgarder et de les agencer en compositions.'),
|
|
|
+ '#markup'=>t('Le Studio rassemble vos documents favoris. Il permet de les sauvegarder et de les agencer en compositions.'),
|
|
|
'#suffix'=>'</p>'
|
|
|
),
|
|
|
+ // TODO: ajouter le login form
|
|
|
'links'=>array(
|
|
|
'#prefix'=>'<p>',
|
|
|
- '#markup'=>'todo: login link',
|
|
|
+ 'register'=> array(
|
|
|
+ '#type' => 'link',
|
|
|
+ '#title' => t('Create new account'),
|
|
|
+ '#url' => $register_url,
|
|
|
+ '#options'=>array(
|
|
|
+ 'attributes' => array(
|
|
|
+ 'data-drupal-link-system-path' => $register_url->getInternalPath()
|
|
|
+ )
|
|
|
+ )
|
|
|
+ ),
|
|
|
+ '#suffix'=>'</p>'
|
|
|
+ ),
|
|
|
+ 'text'=>array(
|
|
|
+ '#prefix'=>'<p>',
|
|
|
+ '#markup'=>t("Ou connectez vous en survolant l'icone du studio en bas a droite de la page"),
|
|
|
'#suffix'=>'</p>'
|
|
|
- )
|
|
|
+ ),
|
|
|
)
|
|
|
)
|
|
|
);
|