コード例 #1
1
ファイル: ecgf.php プロジェクト: brooklyntri/btc-plugins
 public static function admin_menu()
 {
     $tribe_settings = TribeSettings::instance();
     // Export entries
     if ($_REQUEST['page'] === 'tribe-events-calendar-registration-export' and !is_null($_REQUEST['id'])) {
         $post_id = $_REQUEST['id'];
         $forms = GFFormsModel::get_forms();
         foreach ($forms as $form) {
             if (strtolower($form->title) == strtolower(self::$formTitle)) {
                 $form_id = $form->id;
                 $entries = GFAPI::get_entries($form_id, array('field_filters' => array(array('key' => '7', 'value' => $post_id))), null, array('offset' => '0', 'page_size' => '1000'));
                 header("Content-type: text/csv");
                 header("Content-Disposition: attachment; filename=" . sanitize_title_with_dashes($entries[0]['6']) . ".csv");
                 header("Pragma: no-cache");
                 header("Expires: 0");
                 echo $entries[0]['6'] . "\n";
                 echo "Date Created, First Name, Last Name, Email, Phone Number, Number of Participants\n";
                 foreach ($entries as $entry) {
                     echo $entry['date_created'] . ',';
                     echo $entry['1'] . ',';
                     echo $entry['2'] . ',';
                     echo $entry['3'] . ',';
                     echo $entry['4'] . ',';
                     echo $entry['5'] . "\n";
                 }
                 die;
             }
         }
     }
 }
コード例 #2
0
 /**
  * Static Singleton Factory Method
  *
  * @return TribeSettings
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         $className = __CLASS__;
         self::$instance = new $className();
     }
     return self::$instance;
 }
 /**
  * init the settings API and add a hook to add your own setting tabs
  *
  * @since 2.0.5
  * @author jkudish
  * @return void
  */
 public function initOptions()
 {
     require_once 'tribe-settings.class.php';
     require_once 'tribe-settings-tab.class.php';
     require_once 'tribe-field.class.php';
     require_once 'tribe-validate.class.php';
     TribeSettings::instance();
 }
コード例 #4
0
 /**
  * Add the network admin options page
  *
  * @return void
  */
 public function addNetworkOptionsPage()
 {
     $tribe_settings = TribeSettings::instance();
     add_submenu_page('settings.php', $this->pluginName, $this->pluginName, 'manage_network_options', 'tribe-events-calendar', array($tribe_settings, 'generatePage'));
 }
コード例 #5
0
ファイル: tribe-amalgamator.php プロジェクト: donwea/nhap.org
 /**
  * If the migration button is clicked, start working
  *
  * @return void
  */
 public static function listen_for_migration_button()
 {
     if (empty($_REQUEST['amalgamate']) || !wp_verify_nonce($_REQUEST['_wpnonce'], 'amalgamate_duplicates')) {
         return;
     }
     $amalgamator = new self();
     $amalgamator->merge_duplicates();
     // redirect to base settings page
     $settings = TribeSettings::instance();
     $url = apply_filters('tribe_settings_url', add_query_arg(array('post_type' => TribeEvents::POSTTYPE, 'page' => $settings->adminSlug), admin_url('edit.php')));
     wp_redirect($url);
     exit;
 }
コード例 #6
0
    /**
     * If there are venues without geo data, offer the user to fix them.
     */
    public function show_offer_to_fix_notice()
    {
        $settings = TribeSettings::instance();
        $url = apply_filters('tribe_settings_url', add_query_arg(array('post_type' => TribeEvents::POSTTYPE, 'page' => $settings->adminSlug), admin_url('edit.php')));
        ?>
		<div class="updated">
			<p><?php 
        echo sprintf(__("You have venues for which we don't have Geolocation information. <a href='%s'>Click here to generate it</a>.", 'tribe-events-calendar-pro'), $url . '#geoloc_fix');
        ?>
</p>
		</div>
	<?php 
    }
コード例 #7
0
 protected function disable_default_settings_page()
 {
     remove_action('tribe_events_page_tribe-events-calendar', array(TribeSettings::instance(), 'generatePage'));
 }