function get_form() { $form = $this->content; //email fields $form = preg_replace('/\\[email( "([^"]+)")?\\]/i', '<input id="sailthru-email-' . $this->id . '" type="text" class="required $2" />', $form); //first name $form = preg_replace('/\\[fname(\\*?)( "([^"]+)")?\\]/i', '<input id="sailthru-fname-' . $this->id . '" type="text" class="$1$3" />', $form); //last name $form = preg_replace('/\\[lname(\\*?)( "([^"]+)")?\\]/i', '<input id="sailthru-lname-' . $this->id . '" type="text" class="$1$3" />', $form); //submit $form = preg_replace('/\\[submit "([^"]+)"( "([^"]+)")?\\]/i', '<input id="sailthru-submit-' . $this->id . '" onclick="return false;" type="submit" class="$3" value="$1" /> <img id="sailthru_loader-' . $this->id . '" src="' . Sailthru::get_plugin_url() . '/loading.gif" style="display: none;"/>', $form); //each list $lists = sailthru_form::get_all_lists(); foreach ($lists as $id => $list) { $form = preg_replace("/\\[optin-{$id}( \"([^\"]+)\")?\\]/i", "<label class=\"\$2\"><input checked=\"checked\" type=\"checkbox\" value=\"true\" id=\"sailthru-optin-{$this->id}-{$id}\" /> {$list}</label>", $form); } //replace the asterisks with "required" //remove empty class="" $form = str_replace(array('class="*', ' class=""'), array('class="required ', ''), $form); $form .= '<input type="hidden" id="sailthru_plugin_url" value="' . Sailthru::get_plugin_path() . '" />'; $form = "<form id=\"sailthru-{$this->id}\" class=\"sailthru-form\">{$form}</form>"; return $form; }
</tr> <tr valign="top"> <th scope="row">Name:</th> <td> <input type="text" name="name" id="name" value="" style="width: 350px;" /> </td> </tr> <tr valign="top"> <th scope="row">URL:</th> <td> <input type="text" name="url" id="url" value="" style="width: 350px;" /> </td> </tr> </table> <p> <input id="save_datafeeds" type="submit" class="button-primary" value="<?php _e('Save'); ?> " /> <input id="delete_datafeed" type="submit" class="button-primary" value="<?php _e('Delete'); ?> " /> <img src="<?php echo Sailthru::get_plugin_url(); ?> /loading.gif" id="spinner" style="display:none;" /> </p> <?php } ?> </div>