| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: nodeprofile_workflow_ng.inc,v 1.1.2.2 2007/09/15 11:49:21 fago Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 14 |
'nodeprofile_user_has_profile_condition' => array( |
'nodeprofile_user_has_profile_condition' => array( |
| 15 |
'#label' => t('User has nodeprofile'), |
'#label' => t('User has nodeprofile'), |
| 16 |
'#arguments' => array( |
'#arguments' => array( |
| 17 |
'node' => array('#entity' => 'user', '#label' => t('User')), |
'user' => array('#entity' => 'user', '#label' => t('User')), |
| 18 |
), |
), |
| 19 |
'#module' => t('Node Profile'), |
'#module' => t('Node Profile'), |
| 20 |
), |
), |
| 48 |
return array('type' => $form_values['type']); |
return array('type' => $form_values['type']); |
| 49 |
} |
} |
| 50 |
|
|
| 51 |
|
/** |
| 52 |
|
* Implementation of hook_action_info() |
| 53 |
|
*/ |
| 54 |
|
function nodeprofile_action_info() { |
| 55 |
|
return array( |
| 56 |
|
'nodeprofile_action_load' => array( |
| 57 |
|
'#label' => t('Load node profile'), |
| 58 |
|
'#arguments' => array( |
| 59 |
|
'user' => array('#entity' => 'user', '#label' => t('User, whose profile should be loaded')), |
| 60 |
|
), |
| 61 |
|
'#new arguments' => array( |
| 62 |
|
'node_loaded' => array('#entity' => 'node', '#label' => t('Loaded node profile')), |
| 63 |
|
), |
| 64 |
|
'#module' => t('Node Profile'), |
| 65 |
|
), |
| 66 |
|
); |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
/** |
| 70 |
|
* Loads a node profile |
| 71 |
|
*/ |
| 72 |
|
function nodeprofile_action_load($user, $settings, &$arguments, &$log) { |
| 73 |
|
if ($node = nodeprofile_load($settings['type'], $user->uid)) { |
| 74 |
|
return array('#new arguments' => array('node_loaded' => $node)); |
| 75 |
|
} |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
function nodeprofile_action_load_form($settings) { |
| 79 |
|
$form['type'] = array( |
| 80 |
|
'#type' => 'select', |
| 81 |
|
'#title' => t('Node Profile Content Type'), |
| 82 |
|
'#options' => nodeprofile_get_types('names'), |
| 83 |
|
'#default_value' => isset($settings['type']) ? $settings['type'] : array(), |
| 84 |
|
'#description' => t('Select the node profile content type to load.'), |
| 85 |
|
'#required' => TRUE, |
| 86 |
|
); |
| 87 |
|
return $form; |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
function nodeprofile_action_load_submit($form_id, $form_values) { |
| 91 |
|
return array('type' => $form_values['type']); |
| 92 |
|
} |