ソースを参照

Do not show 'subscribe' button to anonymous users

Yves Chedemois 14 年 前
コミット
ea1585f73e
1 ファイル変更8 行追加4 行削除
  1. 8 4
      fgcf.module

+ 8 - 4
fgcf.module

@@ -334,14 +334,18 @@ function theme_fgcf_thematiques($terms) {
  * Subscribe form displayed on 'formations' nodes.
  */
 function fgcf_subscribe_form($form_state, $node) {
+  global $user;
+
   $form['node'] = array(
     '#type' => 'value',
     '#value' => $node,
   );
-  $form['subscribe'] = array(
-    '#type' => 'submit',
-    '#value' => t('Inscrivez-moi'),
-  );
+  if ($user->uid) {
+    $form['subscribe'] = array(
+      '#type' => 'submit',
+      '#value' => t('Inscrivez-moi'),
+    );
+  }
 
   return $form;
 }