It would be better if we can also use PHP in reaction.

CommentFileSizeAuthor
#1 contextphp_reaction.patch2.46 KBnquocbao

Comments

nquocbao’s picture

StatusFileSize
new2.46 KB

And here is the patch

Jackinloadup’s picture

Status: Active » Reviewed & tested by the community

Tested on 6.x-1.0-beta2 works great. Thank you very much.

dixon_’s picture

Status: Reviewed & tested by the community » Needs work

Looks good to me. Only have some minor issues:

+++ b/plugins/contextphp_reaction_php.inc
@@ -0,0 +1,45 @@
+  function options_form($context) {
+    $defaults = $this->fetch_from_context($context, 'options');
+    return array(
+      'phpcode' => array(
+        '#type' => 'textarea',
+        '#title' => t('PHP code'),
+        '#description' => t('Enter PHP code that returns TRUE if the condition shall be met. Do not use <?php ?>.'),
+        '#default_value' => $defaults['phpcode'],
+       ),
+    );
+  }

The description is wrong here.

+++ b/plugins/contextphp_reaction_php.inc
@@ -0,0 +1,45 @@
+}
\ No newline at end of file

There should also be a blank line at end of code, to conform to Drupal coding standards.

Powered by Dreditor.

dixon_’s picture

Status: Needs work » Fixed

Committed to DRUPAL-6--1. Will test it some more before I roll a new beta. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.