예제 #1
0
 function dwci_footer_hook()
 {
     $path = Bootstrap::getPluginPath();
     $viewPath = $path . 'templates/footer-back-to-top.php';
     ob_start();
     require $viewPath;
     $output = ob_get_contents();
     ob_end_clean();
     echo $output;
 }
예제 #2
0
 function dwci_user_account_menu()
 {
     @session_start();
     $path = Bootstrap::getPluginPath();
     //Check the user state first and render logged or not template.
     if (!empty($_SESSION) && !empty($_SESSION['dwci-logged'])) {
         global $wpdb;
         $userId = $_SESSION['dwci-logged'];
         $__table = "wp__dwci_ptf_users";
         $query = "SELECT * FROM " . $__table . " ";
         $query .= "WHERE id = '" . $userId . "'";
         // var_dump($query);
         $results = $wpdb->get_results($query);
         $user = $results[0];
         $viewPath = $path . 'templates/account/user-menu-logged.php';
     } else {
         $viewPath = $path . 'templates/account/user-menu.php';
     }
     ob_start();
     require $viewPath;
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
예제 #3
0
 /**
  * TODO ADD DOCS
  */
 function dwci_navtab_content_callback($attrs, $content)
 {
     $attrs = shortcode_atts(array('id' => md5(time() . uniqid() . 'dwcinavtab'), 'active' => false, 'class' => "", 'innerClass' => ""), $attrs);
     //var_dump($attrs);
     $content = trim($content);
     $content = str_replace("<br />", "", $content);
     $content = do_shortcode($content);
     $path = Bootstrap::getPluginPath();
     $viewPath = $path . 'templates/navtabs/navtab-content.php';
     ob_start();
     require $viewPath;
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
예제 #4
0
 /**
  * Allow registration to a given event id
  */
 function register_callback($atts)
 {
     wp_enqueue_style('dwci_form_css', Bootstrap::getPluginUrl() . '/assets/css/admin-events-form.css');
     wp_enqueue_script('dwci_form_js', Bootstrap::getPluginUrl() . '/assets/js/admin-events-form.js', array('jquery', 'jquery-ui-datepicker'), '20151228', true);
     wp_enqueue_script('dwci_form_validator_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.2.8/jquery.form-validator.min.js', array('jquery'), '20151230', true);
     $atts = shortcode_atts(array('id' => 'no foo', 'title' => 'Default title'), $atts, 'bartag');
     //Check post by id.
     $myquery = new WP_Query("post_type=event&meta_key=event_id&meta_value={$atts['id']}&order=ASC");
     //var_dump($myquery);
     if (!$myquery->posts[0]) {
         return '<p class="dwci-error-msg">Undefined event for this contact form.</p>';
     }
     $post = $myquery->posts[0];
     $path = Bootstrap::getPluginPath();
     $viewPath = $path . 'templates/form.php';
     ob_start();
     require $viewPath;
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }