17 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
18 require_once SQ_CORE_PACKAGE_PATH.
'/system/triggers/trigger_action/trigger_action.inc';
51 public static function execute($settings, &$state)
54 if (!isset($settings[
'url_string']) || empty($settings[
'url_string'])) {
58 if (empty($state[
'asset'])) {
60 if (empty($state[
'assetid'])) {
63 $state[
'asset'] = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($state[
'assetid']);
66 if (is_null($state[
'asset']))
return FALSE;
68 require_once SQ_FUDGE_PATH.
'/general/text.inc';
69 $url = $settings[
'url_string'];
70 $keywords = retrieve_keywords_replacements($url);
71 if (!empty($keywords)) {
72 $replacements = Array();
73 foreach ($keywords as $keyword) {
74 $replacements[$keyword] = $state[
'asset']->getKeywordReplacement($keyword);
76 replace_keywords($url, $replacements);
80 header(
'Location: '.$url);
83 'assetid' => $state[
'asset']->
id,
103 public static function getInterface($settings, $prefix, $write_access=FALSE)
107 $url_string = array_get_index($settings,
'url_string',
'');
108 echo translate(
'trigger_action_redirect_redirect_url').
' ';
110 text_box($prefix.
'[url_string]', $url_string, 75);
112 echo
'<b>'.$url_string.
'</b>';
114 echo
'<br />'.translate(
'trigger_action_redirect_url_instructions');
116 return ob_get_clean();
134 $settings[
'url_string'] = trim(array_get_index($request_data,
'url_string',
''));
150 public static function getLocks($settings, &$state)