You are here

function pcp_get_condition_settings in Profile Complete Percent 5

Same name and namespace in other branches
  1. 6.2 pcp.module \pcp_get_condition_settings()

Helper function to get the setting of a particular condition

Parameters

Condition name $name:

Return value

Array settings

1 call to pcp_get_condition_settings()
pcp_action_redirect_user_to_editform in ./pcp.module
Rules Action - Redirect the user to his profile edit page

File

./pcp.module, line 454
Allows users with valid permissions to tag profile fields created from the profile module as required fields for a users profile to be considered complete.

Code

function pcp_get_condition_settings($name) {
  $rules = rules_get_configured_items('rules');
  foreach ($rules as $rule) {
    if ($rule['#conditions']) {
      foreach ($rule['#conditions'] as $condition) {
        if ($condition['#name'] == $name) {
          return $condition['#settings'];
        }
      }
    }
  }
}