| 1 |
<?php |
<?php |
| 2 |
// $Id: flag.rules.inc,v 1.1.2.2 2009/05/06 23:37:47 quicksketch Exp $ |
// $Id: flag.rules.inc,v 1.1.2.2.2.1 2009/09/13 22:37:37 quicksketch Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file flag.rules.inc |
* @file flag.rules.inc |
| 45 |
} |
} |
| 46 |
|
|
| 47 |
/** |
/** |
| 48 |
* Returns radios for selecting a flag of the type given in |
* Returns radios for selecting a flag of the type given in |
| 49 |
* $info['flag_type']. |
* $info['flag_type']. |
| 50 |
*/ |
*/ |
| 51 |
function get_default_input_form($info, $value) { |
function get_default_input_form($info, $value) { |
| 82 |
|
|
| 83 |
$flags = flag_get_flags(); |
$flags = flag_get_flags(); |
| 84 |
foreach ($flags as $flag) { |
foreach ($flags as $flag) { |
| 85 |
|
|
| 86 |
$arguments = array( |
$arguments = array( |
| 87 |
// First, define ubiquitous arguments. |
// First, define ubiquitous arguments. |
| 88 |
'flag' => array( |
'flag' => array( |
| 165 |
$flag = flag_create_handler($type); |
$flag = flag_create_handler($type); |
| 166 |
if ($flag->rules_get_element_argument_definition()) { |
if ($flag->rules_get_element_argument_definition()) { |
| 167 |
$args += array('object' => $flag->rules_get_element_argument_definition()); |
$args += array('object' => $flag->rules_get_element_argument_definition()); |
| 168 |
|
|
| 169 |
$items += array( |
$items += array( |
| 170 |
'flag_rules_action_flag_'. $type => array( |
'flag_rules_action_flag_'. $type => array( |
| 171 |
'label' => t('Flag a @type', array('@type' => $type)), |
'label' => t('Flag a @type', array('@type' => $type)), |
| 217 |
* Base action implementation: Trim flag. |
* Base action implementation: Trim flag. |
| 218 |
*/ |
*/ |
| 219 |
function flag_rules_action_trim($flag, $flagging_user, $cutoff_size, $settings) { |
function flag_rules_action_trim($flag, $flagging_user, $cutoff_size, $settings) { |
| 220 |
flag_trim_flag($flag, $flagging_user->uid, $cutoff_size); |
flag_trim_flag($flag, $flagging_user, $cutoff_size); |
| 221 |
} |
} |
| 222 |
|
|
| 223 |
/** |
/** |
| 236 |
$flag = flag_create_handler($type); |
$flag = flag_create_handler($type); |
| 237 |
if ($flag->rules_get_element_argument_definition()) { |
if ($flag->rules_get_element_argument_definition()) { |
| 238 |
$args += array('object' => $flag->rules_get_element_argument_definition()); |
$args += array('object' => $flag->rules_get_element_argument_definition()); |
| 239 |
|
|
| 240 |
$items += array( |
$items += array( |
| 241 |
'flag_rules_condition_threshold_'. $type => array( |
'flag_rules_condition_threshold_'. $type => array( |
| 242 |
'label' => drupal_ucfirst(t('@type has flagging count', array('@type' => $type))), |
'label' => drupal_ucfirst(t('@type has flagging count', array('@type' => $type))), |