/** * If output page is set to true calling handle_request will output directly to the response, otherwise it will return only the form portion of the page as a string * @param bool $output_page * @param bool $redirect_expected (overrides output_page behavior completely, returns redirect url) */ function __construct($output_page = true, $redirect_expected = false) { $this->output_page = $output_page; $this->expect_redirect = $redirect_expected; $this->contacts_classes = ContactsHelper::$ContactsClasses; $query_parms = array_diff_key($_GET, array(self::$contacts_option => "")); $this->base_url = SPUtils::update_url(null, $query_parms, true); if ($query_parms) { $this->base_url .= "&"; } else { $this->base_url .= "?"; } if (!$this->contacts_classes) { return; } $this->session_start(); }
/** * If output page is set to true calling handle_request will output directly to the response, otherwise it will return only the form portion of the page as a string * @param bool $output_page * @param bool $redirect_expected (overrides output_page behavior completely, returns redirect url) */ function __construct($output_page = true, $redirect_expected = false) { //! General initializations $this->output_page = $output_page; $this->expect_redirect = $redirect_expected; //! ContactsHelper contains a list of all available classes (generated based on file names, we don't really want to include all the files at once since we really need only one to instantiate later) $this->contacts_classes = ContactsHelper::$ContactsClasses; //! remove contacts option from the query - not making any assumptions that the query will contain only this option $query_parms = array_diff_key($_GET, array(self::$contacts_option => "")); //! used for generating the menu links (update url with null url would give us the current url by default, so the result is current url + whatever other query parms except for contacts_option) $this->base_url = SPUtils::update_url(null, $query_parms, true); //! for menu links the url needs to be ready to append the contacts_option=ZZZ if ($query_parms) { $this->base_url .= "&"; } else { $this->base_url .= "?"; } if (!$this->contacts_classes) { return; } //! note we are starting a session here, we'll be storing state information that is needed for the contacts importer classes $this->session_start(); }