function display()
        {
            ccf_utils::load_module('export/custom-contact-forms-user-data.php');
            $user_data_array = parent::selectAllUserData();
            ?>
			<table id="ccf-dashboard" cellpadding="0" cellspacing="0">
			  <thead>
				<tr>
				  <th>Date</th>
				  <th>Form</th>
				  <th>Form Location</th>
				  <th></th>
				</tr>
			  </thead>
			  <tbody>
			<?php 
            if (empty($user_data_array)) {
                ?>
               <tr>
               	 <td colspan="4"><?php 
                _e('No submissions to display.', 'custom-contact-forms');
                ?>
</td> 
               </tr>
                <?php 
            }
            $i = 0;
            foreach ($user_data_array as $data_object) {
                if ($i > 3) {
                    break;
                }
                $data = new CustomContactFormsUserData(array('form_id' => $data_object->data_formid, 'data_time' => $data_object->data_time, 'form_page' => $data_object->data_formpage, 'encoded_data' => $data_object->data_value));
                ?>
				<tr class="<?php 
                if ($i % 2 == 1) {
                    echo 'even';
                }
                ?>
">
					<td class="date"><?php 
                echo date('m/d/y', $data->getDataTime());
                ?>
</td>
					<td class="slug">
					<?php 
                if ($data->getFormID() > 0) {
                    $data_form = parent::selectForm($data->getFormID());
                    $this_form = !empty($data_form->form_slug) ? $data_form->form_slug : '-';
                } else {
                    $this_form = __('Custom HTML Form', 'custom-contact-forms');
                }
                if (strlen($this_form) > 13) {
                    echo substr($this_form, 0, 13) . '...';
                } else {
                    echo $this_form;
                }
                ?>
					</td>
					<td class="form-page">
					<?php 
                if (strlen($data->getFormPage()) > 30) {
                    echo substr($data->getFormPage(), 0, 30) . '...';
                } else {
                    echo $data->getFormPage();
                }
                ?>
					</td>
					<td>
						<input class="ccf-view-submission" type="button" value="<?php 
                _e('View', 'custom-contact-forms');
                ?>
" />
						<div class="ccf-view-submission-popover" title="<?php 
                _e('CCF Saved Form Submission', 'custom-contact-forms');
                ?>
">
							<div class="top">
								<div class="left">
								<p><?php 
                _e('Form Submitted:', 'custom-contact-forms');
                ?>
 <span><?php 
                echo $this_form == '-' ? __('Not Found', 'custom-contact-forms') : $this_form;
                ?>
</span></p>
								<p><?php 
                _e('Form Location:', 'custom-contact-forms');
                ?>
 <span>
								<?php 
                if (strlen($data->getFormPage()) > 70) {
                    echo substr($data->getFormPage(), 0, 70) . '...';
                } else {
                    echo $data->getFormPage();
                }
                ?>
</span></p></div>
								<div class="right"><span><?php 
                echo date('F j, Y, g:i a', $data->getDataTime());
                ?>
</span></div>
							</div>
							<div class="separate"></div>
							<ul>
								<?php 
                $data_array = $data->getDataArray();
                foreach ($data_array as $item_key => $item_value) {
                    ?>
								<li>
								  <div><?php 
                    echo $item_key;
                    ?>
</div>
								  <p><?php 
                    echo $data->parseUserData($item_value);
                    ?>
</p>
								</li>
								<?php 
                }
                ?>
							</ul>
							<div class="separate"></div>
                            <a class="button" href="admin.php?page=ccf-saved-form-submissions"><?php 
                _e('View All Submissions', 'custom-contact-forms');
                ?>
</a>
						</div>
					</td>
				</tr>
				<?php 
                $i++;
            }
            ?>
			  </tbody>
			</table>
			<a href="admin.php?page=ccf-saved-form-submissions"><?php 
            _e('View All Submissions', 'custom-contact-forms');
            ?>
</a>
			<?php 
        }
Ejemplo n.º 2
0
        {
            global $custom_contact_front;
            echo $custom_contact_front->getFormCode($custom_contact_front->selectForm($fid));
        }
    }
    add_action('init', array(&$custom_contact_front, 'frontInit'), 1);
    add_action('template_redirect', array(&$custom_contact_front, 'includeDependencies'), 1);
    //add_action('wp_enqueue_scripts', array(&$custom_contact_front, 'insertFrontEndScripts'), 1);
    //add_action('wp_print_styles', array(&$custom_contact_front, 'insertFrontEndStyles'), 1);
    add_shortcode('customcontact', array(&$custom_contact_front, 'shortCodeToForm'));
    add_filter('the_content', array(&$custom_contact_front, 'contentFilter'));
} else {
    /* is admin */
    $GLOBALS['ccf_current_page'] = isset($_GET['page']) ? $_GET['page'] : '';
    require_once 'custom-contact-forms-admin.php';
    $custom_contact_admin = new CustomContactFormsAdmin();
    if (!function_exists('CustomContactForms_ap')) {
        function CustomContactForms_ap()
        {
            global $custom_contact_admin;
            if (!isset($custom_contact_admin)) {
                return;
            }
            if (function_exists('add_menu_page')) {
                add_menu_page(__('Custom Contact Forms', 'custom-contact-forms'), __('Custom Contact Forms', 'custom-contact-forms'), 'manage_options', 'custom-contact-forms', array(&$custom_contact_admin, 'printAdminPage'));
                add_submenu_page('custom-contact-forms', __('Custom Contact Forms', 'custom-contact-forms'), __('Custom Contact Forms', 'custom-contact-forms'), 'manage_options', 'custom-contact-forms', array(&$custom_contact_admin, 'printAdminPage'));
                add_submenu_page('custom-contact-forms', __('Saved Form Submissions', 'custom-contact-forms'), __('Saved Form Submissions', 'custom-contact-forms'), 'manage_options', 'ccf-saved-form-submissions', array(&$custom_contact_admin, 'printFormSubmissionsPage'));
                add_submenu_page('custom-contact-forms', __('General Settings', 'custom-contact-forms'), __('General Settings', 'custom-contact-forms'), 'manage_options', 'ccf-settings', array(&$custom_contact_admin, 'printSettingsPage'));
            }
        }
    }