17 require_once SQ_CORE_PACKAGE_PATH.
'/system/triggers/trigger_action/trigger_action.inc';
47 public static function execute($settings, &$state)
49 $error_level = $settings[
'error_level'];
50 if (!empty($error_level)) {
51 trigger_error($settings[
'error_message'], $error_level);
68 public static function getInterface($settings, $prefix, $write_access=FALSE)
72 $error_level = array_get_index($settings,
'error_level', 0);
73 $error_message = array_get_index($settings,
'error_message',
'');
76 $error_level_list = Array(
77 0 => translate(
'no_error'),
78 E_USER_NOTICE => translate(
'notice'),
79 E_USER_WARNING => translate(
'warning'),
80 E_USER_ERROR => translate(
'error'),
83 combo_box($prefix.
'[error_level]', $error_level_list, FALSE, $error_level);
85 echo
'<b>'.$error_level_list[$error_level].
'</b>';
88 $part_1 = ob_get_contents();
94 text_area($prefix.
'[error_message]', $error_message, 40, 5);
96 echo
'<b>'.$error_message.
'</b>';
99 $part_2 = ob_get_contents();
104 $contents = translate(
'trigger_fail_level_label').$part_1.
106 translate(
'trigger_fail_message_label').$part_2.
108 '<span class="sq-backend-warning"><b>'.translate(
'trigger_always_fails_warning').
'</b></span>';
130 $settings[
'error_level'] = $request_data[
'error_level'];
132 $settings[
'error_message'] = array_get_index($request_data,
'error_message',
'');
148 public static function getLocks($settings, &$state)