/**
  * sets the detail page property
  * 
  * it is assumed the [pdb_single] shortcode is on that page
  * 
  * @param string|int $page the page slug, path or ID
  * 
  */
 public function set_detail_page($page = '')
 {
     if (empty($page)) {
         $page = !empty($this->shortcode_object->shortcode_atts['single_record_link']) ? $this->shortcode_object->shortcode_atts['single_record_link'] : Participants_Db::$plugin_options['single_record_page'];
     }
     $this->detail_page = Participants_Db::find_permalink($page);
 }
예제 #2
0
 /**
  * sets the form submission page
  * 
  * if the "action" attribute is not set in the shortcode, use the "thanks page" 
  * setting if set
  */
 protected function _set_submission_page()
 {
     if (!empty($this->shortcode_atts['action'])) {
         $this->submission_page = Participants_Db::find_permalink($this->shortcode_atts['action']);
     }
     if (!$this->submission_page) {
         if (isset($this->options['signup_thanks_page']) && $this->options['signup_thanks_page'] != 'none') {
             $this->submission_page = get_permalink($this->options['signup_thanks_page']);
         }
     }
     if (!$this->submission_page) {
         // the signup thanks page is not set up, so we submit to the page the form is on
         $this->submission_page = $_SERVER['REQUEST_URI'];
     }
 }
예제 #3
0
 /**
  * gets a permalink for a page or post for displaying a record
  * 
  * it is assumed the [pdb_single] shortcode is on that page
  * 
  * @var string|int $page the page slug, path or ID
  */
 public function set_detail_page($page)
 {
     $this->detail_page = Participants_Db::find_permalink($page);
 }
 /**
  * prints the top of the search/sort form
  *
  * @param string $target set the action attribute of the search form to another 
  *                       page, giving the ability to have the search on a 
  *                       different page than the list, defaults to the same page
  * @global object $post
  */
 public function search_sort_form_top($target = false, $class = false, $print = true)
 {
     $this->shortcode_atts['target_page'] = trim($this->shortcode_atts['target_page']);
     if (!empty($this->shortcode_atts['action']) && empty($this->shorcode_atts['target_page'])) {
         $this->shorcode_atts['target_page'] = $this->shortcode_atts['action'];
     }
     global $post;
     $output = array();
     $ref = 'update';
     if ($target === false && !empty($this->shortcode_atts['target_page']) && $this->module == 'search') {
         $target = Participants_Db::find_permalink($this->shortcode_atts['target_page']);
     }
     if ($target) {
         $ref = 'remote';
     }
     $action = $target !== false ? $target : get_permalink($post->ID) . '#' . $this->list_anchor;
     $class_att = $class ? 'class="' . $class . '"' : '';
     $output[] = '<form method="post" class="sort_filter_form" action="' . $action . '"' . $class_att . ' data-ref="' . $ref . '" >';
     $hidden_fields = array('action' => 'pdb_list_filter', 'target_instance' => $this->shortcode_atts['target_instance'], 'instance_index' => $this->instance_index, 'pagelink' => $this->prepare_page_link($_SERVER['REQUEST_URI']), 'sortstring' => $this->filter['sortstring'], 'orderstring' => $this->filter['orderstring'], 'filterNonce' => Participants_Db::nonce(self::$list_filter_nonce_key));
     if ($ref === 'remote') {
         $hidden_fields['submit_button'] = 'search';
     }
     $output[] = PDb_FormElement::print_hidden_fields($hidden_fields, false);
     if ($print) {
         echo $this->output_HTML($output);
     } else {
         return $this->output_HTML($output);
     }
 }
예제 #5
0
 /**
  * sets the form submission page
  */
 protected function _set_submission_page()
 {
     if (!empty($this->shortcode_atts['action'])) {
         $this->submission_page = Participants_Db::find_permalink($this->shortcode_atts['action']);
     }
     if (!$this->submission_page) {
         $this->submission_page = $_SERVER['REQUEST_URI'];
     }
 }
 /**
  * sets the form submission page
  */
 protected function _set_submission_page()
 {
     $form_status = 'normal';
     if (!empty($this->shortcode_atts['action'])) {
         $this->submission_page = Participants_Db::find_permalink($this->shortcode_atts['action']);
         if ($this->submission_page !== false) {
             $form_status = 'multipage';
         }
     }
     if (!$this->submission_page) {
         $this->submission_page = $_SERVER['REQUEST_URI'];
     }
     $this->set_form_status($form_status);
 }
 /**
  * sets the form submission page
  * 
  * if the "action" attribute is not set in the shortcode, use the "thanks page" 
  * setting if set
  */
 protected function _set_submission_page()
 {
     $form_status = 'normal';
     if (!empty($this->shortcode_atts['action'])) {
         $this->submission_page = Participants_Db::find_permalink($this->shortcode_atts['action']);
         if ($this->submission_page !== false) {
             $form_status = 'multipage';
         }
     }
     if (!$this->submission_page) {
         if (Participants_Db::plugin_setting('signup_thanks_page', 'none') != 'none') {
             $this->submission_page = get_permalink(Participants_Db::plugin_setting('signup_thanks_page'));
         }
     }
     if (!$this->submission_page) {
         // the signup thanks page is not set up, so we submit to the page the form is on
         $this->submission_page = $_SERVER['REQUEST_URI'];
     }
     $this->set_form_status($form_status);
 }