$this->ss->assign('disabled_subs', $orig_vals_array[1]); $this->ss->assign('enabled_subs_string', $orig_vals_str[0]); $this->ss->assign('disabled_subs_string', $orig_vals_str[1]); // FIXME we are doing this way since this view is going to be removed later // this should be with proper buttons from smarty tpls. require_once 'include/formbase.php'; $url = buildRedirectURL(); $cancelButtonClick = "SUGAR.ajaxUI.loadContent('{$url}'); return false;"; /* * Parse the module from the URL first using regular expression. * This is faster than parse_url + parse_str in first place and most of * our redirects won't go to sidecar (at least for now). */ if (preg_match('/module=([^&]+)/', $url, $matches) && !isModuleBWC($matches[1])) { parse_str(parse_url($url, PHP_URL_QUERY), $params); $script = navigateToSidecar(buildSidecarRoute($params['module'], $params['record'], translateToSidecarAction($params['action']))); $cancelButtonClick = "{$script} return false;"; } $buttons = array('<input id="save_button" title="' . $app_strings['LBL_SAVE_BUTTON_TITLE'] . '" accessKey="' . $app_strings['LBL_SAVE_BUTTON_KEY'] . '" class="button" onclick="save();this.form.action.value=\'Subscriptions\'; " type="submit" name="button" value="' . $app_strings['LBL_SAVE_BUTTON_LABEL'] . '">', '<input id="cancel_button" title="' . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . '" accessKey="' . $app_strings['LBL_CANCEL_BUTTON_KEY'] . '" class="button" onclick="' . $cancelButtonClick . '" type="submit" name="button" value="' . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . '">'); $this->ss->assign('BUTTONS', $buttons); $this->ss->display('modules/Campaigns/Subscriptions.tpl'); /* *This function constructs Drag and Drop multiselect box of subscriptions for display in manage subscription form */ function constructDDSubscriptionList($focus, $classname = '') { require_once "include/templates/TemplateDragDropChooser.php"; global $mod_strings; $unsubs_arr = ''; $subs_arr = ''; // Lets start by creating the subscription and unsubscription arrays
/** * Redirect to another URL. * * If the module is not in BWC it will try to map to sidecar url. * If it loads only temporarily, please check if the module is pointing to * a layout/view in BWC. * * This function writes session data, ends the session and exists the app. * * @param string $url The URL to redirect to. */ public function redirect($url) { global $disable_redirects; //Dirty hack to enable the inclusion of BWC style scripts that wish to redirect without breaking REST requests. if ($disable_redirects) { return; } /* * Parse the module from the URL first using regular expression. * This is faster than parse_url + parse_str in first place and most of * our redirects won't go to sidecar (at least for now). */ if (preg_match('/module=([^&]+)/', $url, $matches) && !isModuleBWC($matches[1])) { parse_str(parse_url($url, PHP_URL_QUERY), $params); $script = navigateToSidecar(buildSidecarRoute($params['module'], $params['record'], translateToSidecarAction($params['action']))); echo "<script>{$script}</script>"; exit; } session_write_close(); header('HTTP/1.1 301 Moved Permanently'); header("Location: {$url}"); exit; }
/** * Builds an appropriate Sidecar or BWC href attribute for the additional * details buttons, using the link supplied from the additional details * module metadata. * * @private * @param string $link (optional) The link from additional details module * metadata. The function returns an empty string if none is supplied. * @return string The href attribute used for the button. */ private function buildButtonLink($link = '') { if (preg_match('/module=([^&]+)/', $link, $matches) && !isModuleBWC($matches[1])) { parse_str(parse_url($link, PHP_URL_QUERY), $params); $script = navigateToSidecar(buildSidecarRoute($params['module'], $params['record'], translateToSidecarAction($params['action']))); $link = "javascript:{$script};"; } return $link; }