コード例 #1
0
ファイル: ical.php プロジェクト: sriram911/pls
 function espresso_ical()
 {
     do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, '');
     $name = $_REQUEST['event_summary'] . ".ics";
     $output = "BEGIN:VCALENDAR\n" . "VERSION:2.0\n" . "PRODID:-//" . $_REQUEST['organization'] . " - Event Espresso Version " . espresso_version() . "//NONSGML v1.0//EN\n" . "METHOD:PUBLISH\n" . "X-WR-CALNAME:" . $_REQUEST['organization'] . "\n" . "X-ORIGINAL-URL:" . $_REQUEST['eereg_url'] . "\n" . "X-WR-CALDESC:" . $_REQUEST['organization'] . "\n" . "X-WR-TIMEZONE:" . get_option('timezone_string') . "\n" . "BEGIN:VEVENT\n" . "DTSTAMP:" . $_REQUEST['currentyear'] . $_REQUEST['currentmonth'] . $_REQUEST['currentday'] . "T" . $_REQUEST['currenttime'] . "\n" . "UID:" . $_REQUEST['registration_id'] . "@" . $_REQUEST['eereg_url'] . "\n" . "ORGANIZER:MAILTO:" . $_REQUEST['contact_email'] . "\n" . "DTSTART:" . $_REQUEST['startyear'] . $_REQUEST['startmonth'] . $_REQUEST['startday'] . "T" . $_REQUEST['starttime'] . "\n" . "DTEND:" . $_REQUEST['endyear'] . $_REQUEST['endmonth'] . $_REQUEST['endday'] . "T" . $_REQUEST['endtime'] . "\n" . "STATUS:CONFIRMED\n" . "URL:" . $_REQUEST['eereg_url'] . "\n" . "SUMMARY:" . $_REQUEST['event_summary'] . "\n" . "LOCATION:" . $_REQUEST['location'] . "\n" . "END:VEVENT\n" . "END:VCALENDAR";
     if (ob_get_length()) {
         echo 'Some data has already been output, can\'t send iCal file';
     }
     header('Content-Type: application/x-download');
     if (headers_sent()) {
         echo 'Some data has already been output, can\'t send iCal file';
     }
     header('Content-Length: ' . strlen($output));
     header('Content-Disposition: attachment; filename="' . $name . '"');
     header('Cache-Control: private, max-age=0, must-revalidate');
     header('Pragma: public');
     header('Content-Type: application/octet-stream');
     header('Content-Type: application/force-download');
     header('Content-type: application/pdf');
     header("Cache-Control: no-cache, must-revalidate");
     // HTTP/1.1
     header("Content-Transfer-Encoding: binary");
     header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
     // Date in the past
     ini_set('zlib.output_compression', '0');
     echo $output;
     die;
 }
コード例 #2
0
/**
 * load admin file
 * @author Sidney Harrell
 * @since 1.1.4
 * conditionally loads the admin screen based on the current version of Event Espresso
 * this will be obsolete after we drop support for 3.1.x
 */
function espresso_social_load_admin_file()
{
    if (function_exists('espresso_version') && espresso_version() >= '3.2') {
        require_once 'social_admin.php';
    } else {
        require_once 'social_admin_classic.php';
    }
}
 public function test_ensure_current_database_state_is_set()
 {
     $this->_pretend_current_code_state_is_at(espresso_version());
     $this->_pretend_current_db_state_is_at();
     $db_state = EE_Data_Migration_Manager::instance()->ensure_current_database_state_is_set();
     $this->assertArrayHasKey('Core', $db_state);
     $this->assertEquals(espresso_version(), $db_state['Core']);
 }
コード例 #4
0
 /**
  *    Method for registering new EE_Addons.
  * Should be called AFTER AHEE__EE_System__load_espresso_addons but BEFORE AHEE__EE_System___detect_if_activation_or_upgrade__begin in order to register all its components.
  * However, it may also be called after the 'activate_plugin' action (when an addon is activated),
  * because an activating addon won't be loaded by WP until after AHEE__EE_System__load_espresso_addons has fired.
  * If its called after 'activate_plugin', it registers the addon still, but its components are not registered
  * (they shouldn't be needed anyways, because it's just an activation request and they won't have a chance to do anything anyways). Instead, it just sets the newly-activated addon's activation indicator wp option and returns
  * (so that we can detect that the addon has activated on the subsequent request)
  *
  * @since    4.3.0
  * @param string $addon_name 		the EE_Addon's name. Required.
  * @param  array $setup_args { 			An array of arguments provided for registering the message type.
  * @type  string $class_name the addon's main file name. If left blank, generated from the addon name, changes something like "calendar" to "EE_Calendar"
  *			@type string $min_core_version  the minimum version of EE Core that the addon will work with. eg "4.8.1.rc.084"
  *			@type string $version the "software" version for the addon. eg "1.0.0.p" for a first stable release, or "1.0.0.rc.043" for a version in progress
  *			@type string $main_file_path the full server path to the main file loaded directly by WP
  *          @type string $admin_path 	full server path to the folder where the addon\'s admin files reside
  *			@type string $admin_callback a method to be called when the EE Admin is first invoked, can be used for hooking into any admin page
  *			@type string $config_section the section name for this addon's configuration settings section (defaults to "addons")
  *			@type string $config_class the class name for this addon's configuration settings object
  *			@type string $config_name the class name for this addon's configuration settings object
  * 			@type string $autoloader_paths an array of class names and the full server paths to those files. Required.
  *			@type string $autoloader_folders  an array of  "full server paths" for any folders containing classes that might be invoked by the addon
  * 			@type string $dms_paths 				an array of full server paths to folders that contain data migration scripts. Required.
  * 			@type string $module_paths 	an array of full server paths to any EED_Modules used by the addon
  * 			@type string $shortcode_paths 	an array of full server paths to folders that contain EES_Shortcodes
  * 			@type string $widget_paths 					an array of full server paths to folders that contain WP_Widgets
  *			@type string $pue_options
  * 			@type array $capabilities  {
  * 			      	an array indexed by role name (i.e. administrator,author ) and the values are an array of caps to add to the role.
  * 			      	'administrator' => array('read_addon', 'edit_addon' etc.).
  * 	         		}
  * 	        @type EE_Meta_Capability_Map[] $capability_maps an array of EE_Meta_Capability_Map object for any addons that need to register any special meta mapped capabilities.  Should be indexed where the key is the EE_Meta_Capability_Map class name and the values are the arguments sent to the class.
  *			@type array $model_paths array of folders containing DB models @see EE_Register_Model
  *			@type array $class_paths array of folders containing DB classes @see EE_Register_Model
  *			@type array $model_extension_paths array of folders containing DB model extensions @see EE_Register_Model_Extension
  *			@type array $class_extension_paths array of folders containing DB class extensions @see EE_Register_Model_Extension
  * 			@type array message_types {
  *       		 An array of message types with the key as the message type name and the values as below:
  *        		@type string $mtfilename The filename of the message type being registered.  This will be the main
  *                                       EE_{Messagetype_Name}_message_type class. (eg. EE_Declined_Registration_message_type.class.php). Required.
  *               @type array $autoloadpaths An array of paths to add to the messages autoloader for the new message type. Required.
  *               @type array $messengers_to_activate_with An array of messengers that this message
  *                           type should activate with. Each value in the array should match the name property of a EE_messenger. Optional.
  *               @type array $messengers_to_validate_with An array of messengers that this message
  *                          type should validate with. Each value in the array should match the name property of an EE_messenger. Optional.
  *       	}
  *			@type array $custom_post_types
  *			@type array $custom_taxonomies
  *			@type array $payment_method_paths each element is the folder containing the EE_PMT_Base child class
  *				(eg, 'public_html/wp-content/plugins/my_plugin/Payomatic/' which contains the files
  *				EE_PMT_Payomatic.pm.php)
  *			@type array $default_terms
  * 	}
  *
  * @throws EE_Error
  * @return void
  */
 public static function register($addon_name = '', $setup_args = array())
 {
     // required fields MUST be present, so let's make sure they are.
     if (empty($addon_name) || !is_array($setup_args)) {
         throw new EE_Error(__('In order to register an EE_Addon with EE_Register_Addon::register(), you must include the "addon_name" (the name of the addon), and an array of arguments.', 'event_espresso'));
     }
     if (!isset($setup_args['main_file_path']) || empty($setup_args['main_file_path'])) {
         throw new EE_Error(sprintf(__('When registering an addon, you didn\'t provide the "main_file_path", which is the full path to the main file loaded directly by Wordpress. You only provided %s', 'event_espresso'), implode(",", array_keys($setup_args))));
     }
     // check that addon has not already been registered with that name
     if (isset(self::$_settings[$addon_name]) && !did_action('activate_plugin')) {
         throw new EE_Error(sprintf(__('An EE_Addon with the name "%s" has already been registered and each EE_Addon requires a unique name.', 'event_espresso'), $addon_name));
     }
     // no class name for addon?
     if (empty($setup_args['class_name'])) {
         // generate one by first separating name with spaces
         $class_name = str_replace(array('-', '_'), ' ', trim($addon_name));
         //capitalize, then replace spaces with underscores
         $class_name = str_replace(' ', '_', ucwords($class_name));
     } else {
         $class_name = $setup_args['class_name'];
     }
     $class_name = strpos($class_name, 'EE_') === 0 ? $class_name : 'EE_' . $class_name;
     //setup $_settings array from incoming values.
     $addon_settings = array('class_name' => $class_name, 'plugin_slug' => isset($setup_args['plugin_slug']) ? (string) $setup_args['plugin_slug'] : '', 'plugin_action_slug' => isset($setup_args['plugin_action_slug']) ? (string) $setup_args['plugin_action_slug'] : '', 'version' => isset($setup_args['version']) ? (string) $setup_args['version'] : '', 'min_core_version' => isset($setup_args['min_core_version']) ? (string) $setup_args['min_core_version'] : '', 'main_file_path' => isset($setup_args['main_file_path']) ? (string) $setup_args['main_file_path'] : '', 'admin_path' => isset($setup_args['admin_path']) ? (string) $setup_args['admin_path'] : '', 'admin_callback' => isset($setup_args['admin_callback']) ? (string) $setup_args['admin_callback'] : '', 'config_section' => isset($setup_args['config_section']) ? (string) $setup_args['config_section'] : 'addons', 'config_class' => isset($setup_args['config_class']) ? (string) $setup_args['config_class'] : '', 'config_name' => isset($setup_args['config_name']) ? (string) $setup_args['config_name'] : '', 'autoloader_paths' => isset($setup_args['autoloader_paths']) ? (array) $setup_args['autoloader_paths'] : array(), 'autoloader_folders' => isset($setup_args['autoloader_folders']) ? (array) $setup_args['autoloader_folders'] : array(), 'dms_paths' => isset($setup_args['dms_paths']) ? (array) $setup_args['dms_paths'] : array(), 'module_paths' => isset($setup_args['module_paths']) ? (array) $setup_args['module_paths'] : array(), 'shortcode_paths' => isset($setup_args['shortcode_paths']) ? (array) $setup_args['shortcode_paths'] : array(), 'widget_paths' => isset($setup_args['widget_paths']) ? (array) $setup_args['widget_paths'] : array(), 'pue_options' => isset($setup_args['pue_options']) ? (array) $setup_args['pue_options'] : array(), 'message_types' => isset($setup_args['message_types']) ? (array) $setup_args['message_types'] : array(), 'capabilities' => isset($setup_args['capabilities']) ? (array) $setup_args['capabilities'] : array(), 'capability_maps' => isset($setup_args['capability_maps']) ? (array) $setup_args['capability_maps'] : array(), 'model_paths' => isset($setup_args['model_paths']) ? (array) $setup_args['model_paths'] : array(), 'class_paths' => isset($setup_args['class_paths']) ? (array) $setup_args['class_paths'] : array(), 'model_extension_paths' => isset($setup_args['model_extension_paths']) ? (array) $setup_args['model_extension_paths'] : array(), 'class_extension_paths' => isset($setup_args['class_extension_paths']) ? (array) $setup_args['class_extension_paths'] : array(), 'custom_post_types' => isset($setup_args['custom_post_types']) ? (array) $setup_args['custom_post_types'] : array(), 'custom_taxonomies' => isset($setup_args['custom_taxonomies']) ? (array) $setup_args['custom_taxonomies'] : array(), 'payment_method_paths' => isset($setup_args['payment_method_paths']) ? (array) $setup_args['payment_method_paths'] : array(), 'default_terms' => isset($setup_args['default_terms']) ? (array) $setup_args['default_terms'] : array(), 'plugins_page_row' => isset($setup_args['plugins_page_row']) ? $setup_args['plugins_page_row'] : '');
     // if plugin_action_slug is NOT set, but an admin page path IS set, then let's just use the plugin_slug since that will be used for linking to the admin page
     $addon_settings['plugin_action_slug'] = empty($addon_settings['plugin_action_slug']) && !empty($addon_settings['admin_path']) ? $addon_settings['plugin_slug'] : $addon_settings['plugin_action_slug'];
     // full server path to main file (file loaded directly by WP)
     $addon_settings['plugin_basename'] = plugin_basename($addon_settings['main_file_path']);
     //check whether this addon version is compatible with EE core
     if (isset(EE_Register_Addon::$_incompatible_addons[$addon_name]) && !self::_meets_min_core_version_requirement(EE_Register_Addon::$_incompatible_addons[$addon_name], $addon_settings['version'])) {
         $incompatibility_message = sprintf(__('The Event Espresso "%1$s" addon was deactivated because it is incompatible with this version of core.%2$s Only version %3$s or higher of "%1$s" can run with this version of core. This can happen when attempting to run beta versions or release candidates with older versions of core, or running old versions of addons with a newer version of core.%2$sPlease upgrade Event Espresso Core and the "%1$s" addon, then re-attempt activating it.', 'event_espresso'), $addon_name, '<br />', EE_Register_Addon::$_incompatible_addons[$addon_name]);
     } else {
         if (!self::_meets_min_core_version_requirement($setup_args['min_core_version'], espresso_version())) {
             $incompatibility_message = sprintf(__('The Event Espresso "%1$s" addon could not be activated because it requires Event Espresso Core version "%2$s" or higher in order to run.%4$sYour version of Event Espresso Core is currently at "%3$s". Please upgrade Event Espresso Core first and then re-attempt activating "%1$s".', 'event_espresso'), $addon_name, self::_effective_version($setup_args['min_core_version']), self::_effective_version(espresso_version()), '<br />');
         } else {
             $incompatibility_message = '';
         }
     }
     if (!empty($incompatibility_message)) {
         //remove 'activate' from the REQUEST so WP doesn't erroneously tell the user the
         //plugin activated fine when it didn't
         if (isset($_GET['activate'])) {
             unset($_GET['activate']);
         }
         if (isset($_REQUEST['activate'])) {
             unset($_REQUEST['activate']);
         }
         //and show an error message indicating the plugin didn't activate properly
         EE_Error::add_error($incompatibility_message, __FILE__, __FUNCTION__, __LINE__);
         if (current_user_can('activate_plugins')) {
             require_once ABSPATH . 'wp-admin/includes/plugin.php';
             deactivate_plugins(plugin_basename($addon_settings['main_file_path']), TRUE);
         }
         return;
     }
     //this is an activation request
     if (did_action('activate_plugin')) {
         //to find if THIS is the addon that was activated,
         //just check if we have already registered it or not
         //(as the newly-activated addon wasn't around the first time addons were registered)
         if (!isset(self::$_settings[$addon_name])) {
             self::$_settings[$addon_name] = $addon_settings;
             $addon = self::_load_and_init_addon_class($addon_name);
             $addon->set_activation_indicator_option();
             //dont bother setting up the rest of the addon.
             //we know it was just activated and the request will end soon
         }
         return;
     } else {
         // make sure this was called in the right place!
         if (!did_action('AHEE__EE_System__load_espresso_addons') || did_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin')) {
             EE_Error::doing_it_wrong(__METHOD__, sprintf(__('An attempt to register an EE_Addon named "%s" has failed because it was not registered at the correct time.  Please use the "AHEE__EE_System__load_espresso_addons" hook to register addons.', 'event_espresso'), $addon_name), '4.3.0');
         }
         self::$_settings[$addon_name] = $addon_settings;
     }
     // we need cars
     if (!empty(self::$_settings[$addon_name]['autoloader_paths'])) {
         // setup autoloader for single file
         EEH_Autoloader::instance()->register_autoloader(self::$_settings[$addon_name]['autoloader_paths']);
     }
     // setup autoloaders for folders
     if (!empty(self::$_settings[$addon_name]['autoloader_folders'])) {
         foreach (self::$_settings[$addon_name]['autoloader_folders'] as $autoloader_folder) {
             EEH_Autoloader::register_autoloaders_for_each_file_in_folder($autoloader_folder);
         }
     }
     // register new models
     if (!empty(self::$_settings[$addon_name]['model_paths']) || !empty(self::$_settings[$addon_name]['class_paths'])) {
         EE_Register_Model::register($addon_name, array('model_paths' => self::$_settings[$addon_name]['model_paths'], 'class_paths' => self::$_settings[$addon_name]['class_paths']));
     }
     // register model extensions
     if (!empty(self::$_settings[$addon_name]['model_extension_paths']) || !empty(self::$_settings[$addon_name]['class_extension_paths'])) {
         EE_Register_Model_Extensions::register($addon_name, array('model_extension_paths' => self::$_settings[$addon_name]['model_extension_paths'], 'class_extension_paths' => self::$_settings[$addon_name]['class_extension_paths']));
     }
     // setup DMS
     if (!empty(self::$_settings[$addon_name]['dms_paths'])) {
         EE_Register_Data_Migration_Scripts::register($addon_name, array('dms_paths' => self::$_settings[$addon_name]['dms_paths']));
     }
     // if config_class is present let's register config.
     if (!empty(self::$_settings[$addon_name]['config_class'])) {
         EE_Register_Config::register(self::$_settings[$addon_name]['config_class'], array('config_section' => self::$_settings[$addon_name]['config_section'], 'config_name' => self::$_settings[$addon_name]['config_name']));
     }
     // register admin page
     if (!empty(self::$_settings[$addon_name]['admin_path'])) {
         EE_Register_Admin_Page::register($addon_name, array('page_path' => self::$_settings[$addon_name]['admin_path']));
     }
     // add to list of modules to be registered
     if (!empty(self::$_settings[$addon_name]['module_paths'])) {
         EE_Register_Module::register($addon_name, array('module_paths' => self::$_settings[$addon_name]['module_paths']));
     }
     // add to list of shortcodes to be registered
     if (!empty(self::$_settings[$addon_name]['shortcode_paths'])) {
         EE_Register_Shortcode::register($addon_name, array('shortcode_paths' => self::$_settings[$addon_name]['shortcode_paths']));
     }
     // add to list of widgets to be registered
     if (!empty(self::$_settings[$addon_name]['widget_paths'])) {
         EE_Register_Widget::register($addon_name, array('widget_paths' => self::$_settings[$addon_name]['widget_paths']));
     }
     //register capability related stuff.
     if (!empty(self::$_settings[$addon_name]['capabilities'])) {
         EE_Register_Capabilities::register($addon_name, array('capabilities' => self::$_settings[$addon_name]['capabilities'], 'capability_maps' => self::$_settings[$addon_name]['capability_maps']));
     }
     //any message type to register?
     if (!empty(self::$_settings[$addon_name]['message_types'])) {
         add_action('EE_Brewing_Regular___messages_caf', array('EE_Register_Addon', 'register_message_types'));
     }
     // if plugin update engine is being used for auto-updates (not needed if PUE is not being used)
     if (!empty($setup_args['pue_options'])) {
         self::$_settings[$addon_name]['pue_options'] = array('pue_plugin_slug' => isset($setup_args['pue_options']['pue_plugin_slug']) ? (string) $setup_args['pue_options']['pue_plugin_slug'] : 'espresso_' . strtolower($class_name), 'plugin_basename' => isset($setup_args['pue_options']['plugin_basename']) ? (string) $setup_args['pue_options']['plugin_basename'] : plugin_basename(self::$_settings[$addon_name]['main_file_path']), 'checkPeriod' => isset($setup_args['pue_options']['checkPeriod']) ? (string) $setup_args['pue_options']['checkPeriod'] : '24', 'use_wp_update' => isset($setup_args['pue_options']['use_wp_update']) ? (string) $setup_args['pue_options']['use_wp_update'] : FALSE);
         add_action('AHEE__EE_System__brew_espresso__after_pue_init', array('EE_Register_Addon', 'load_pue_update'));
     }
     //any custom post type/ custom capabilities or default terms to register
     if (!empty(self::$_settings[$addon_name]['custom_post_types']) || !empty(self::$_settings[$addon_name]['custom_taxonomies'])) {
         EE_Register_CPT::register($addon_name, array('cpts' => self::$_settings[$addon_name]['custom_post_types'], 'cts' => self::$_settings[$addon_name]['custom_taxonomies'], 'default_terms' => self::$_settings[$addon_name]['default_terms']));
     }
     if (!empty(self::$_settings[$addon_name]['payment_method_paths'])) {
         EE_Register_Payment_Method::register($addon_name, array('payment_method_paths' => self::$_settings[$addon_name]['payment_method_paths']));
     }
     // load and instantiate main addon class
     $addon = self::_load_and_init_addon_class($addon_name);
     // call any additional admin_callback functions during load_admin_controller hook
     if (!empty(self::$_settings[$addon_name]['admin_callback'])) {
         add_action('AHEE__EE_System__load_controllers__load_admin_controllers', array($addon, self::$_settings[$addon_name]['admin_callback']));
     }
 }
コード例 #5
0
 /**
  * Gets the major and minor version of EE core's version string
  * @return string
  */
 public static function core_version()
 {
     return apply_filters('FHEE__EED_Core_REST_API__core_version', implode('.', array_slice(explode('.', espresso_version()), 0, 3)));
 }
コード例 #6
0
ファイル: index.php プロジェクト: sriram911/pls
function espresso_ticket_config_mnu()
{
    global $wpdb, $current_user, $espresso_premium;
    ?>
	<div class="wrap">
		<div id="icon-options-event" class="icon32"> </div>
		<h2><?php 
    echo _e('Manage Ticket Templates', 'event_espresso');
    if (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'edit' && $_REQUEST['action'] != 'add_new_ticket') {
        echo '<a href="admin.php?page=event_tickets&amp;action=add_new_ticket" class="button add-new-h2" style="margin-left: 20px;">' . __('Add New', 'event_espresso') . '</a>';
    }
    ?>
		</h2>
		<?php 
    ob_start();
    if (!empty($_POST['delete_ticket'])) {
        if (is_array($_POST['checkbox'])) {
            while (list($key, $value) = each($_POST['checkbox'])) {
                $del_id = $key;
                //Delete ticket data
                $sql = "DELETE FROM " . EVENTS_TICKET_TEMPLATES . " WHERE id='{$del_id}'";
                $wpdb->query($sql);
            }
        }
        ?>
			<div id="message" class="updated fade">
				<p><strong>
			<?php 
        _e('Ticket Templates have been successfully deleted.', 'event_espresso');
        ?>
					</strong></p>
			</div>
		<?php 
    }
    if (isset($_REQUEST['action'])) {
        switch ($_REQUEST['action']) {
            case 'update_ticket':
                require_once "update_ticket.php";
                update_event_ticket();
                break;
            case 'add':
                require_once "add_to_db.php";
                add_ticket_to_db();
                break;
            case 'add_new_ticket':
                require_once "add_new.php";
                add_new_event_ticket();
                break;
            case 'edit_ticket':
                require_once "edit_ticket.php";
                edit_event_ticket();
                break;
        }
    }
    do_action('action_hook_espresso_admin_notices');
    //This line keeps the notices from displaying twice
    if (did_action('action_hook_espresso_admin_notices') == false) {
        do_action('action_hook_espresso_admin_notices');
    }
    ?>
		<p>
			<?php 
    _e('Create customized ticket template for use in multiple events. ', 'event_espresso');
    echo apply_filters('filter_hook_espresso_help', 'customized_ticket_info');
    ?>
		</p>
		<form id="form1" name="form1" method="post" action="<?php 
    echo $_SERVER["REQUEST_URI"];
    ?>
">
			<table id="table" class="widefat manage-tickets">
				<thead>
					<tr>
						<th class="manage-column column-cb check-column" id="cb" scope="col" style="width:3.5%;"><input type="checkbox"></th>
						<th class="manage-column column-comments num" id="id" style="padding-top:7px; width:3.5%;" scope="col" title="Click to Sort"><?php 
    _e('ID', 'event_espresso');
    ?>
</th>
						<th class="manage-column column-title" id="name" scope="col" title="Click to Sort" style="width:60%;"><?php 
    _e('Name', 'event_espresso');
    ?>
</th>
	<?php 
    if (function_exists('espresso_is_admin') && espresso_is_admin() == true) {
        ?>
							<th class="manage-column column-creator" id="creator" scope="col" title="Click to Sort" style="width:10%;"><?php 
        _e('Creator', 'event_espresso');
        ?>
</th>
	<?php 
    }
    ?>
						<th class="manage-column column-title" id="action" scope="col" title="Click to Sort" style="width:30%;"><?php 
    _e('Action', 'event_espresso');
    ?>
</th>
					</tr>
				</thead>
				<tbody>
					<?php 
    $sql = "SELECT * FROM " . EVENTS_TICKET_TEMPLATES . " e";
    if (function_exists('espresso_manager_pro_version') && !empty($_SESSION['espresso_use_selected_manager'])) {
        $sql .= " JOIN {$wpdb->users} u on u.ID = e.wp_user WHERE e.wp_user = "******" JOIN {$wpdb->users} u on u.ID = e.wp_user WHERE e.wp_user = "******" ORDER BY e.id ASC");
        foreach ($results as $result) {
            $ticket_id = $result->id;
            $ticket_name = stripslashes($result->ticket_name);
            $ticket_content = stripslashes($result->ticket_content);
            $wp_user = $result->wp_user;
            ?>
							<tr>
								<td><input name="checkbox[<?php 
            echo $ticket_id;
            ?>
]" type="checkbox"  title="Delete <?php 
            echo stripslashes($ticket_name);
            ?>
"></td>
								<td><?php 
            echo $ticket_id;
            ?>
</td>
								<td class="post-title page-title column-title"><strong><a href="admin.php?page=event_tickets&action=edit_ticket&id=<?php 
            echo $ticket_id;
            ?>
"><?php 
            echo $ticket_name;
            ?>
</a></strong>
									<div class="row-actions"><span class="edit"><a href="admin.php?page=event_tickets&action=edit_ticket&id=<?php 
            echo $ticket_id;
            ?>
"><?php 
            _e('Edit', 'event_espresso');
            ?>
</a> | </span><span class="delete"><a onclick="return confirmDelete();" class="delete submitdelete" href="admin.php?page=event_tickets&action=delete_ticket&id=<?php 
            echo $ticket_id;
            ?>
"><?php 
            _e('Delete', 'event_espresso');
            ?>
</a></span></div>
								</td>
								<?php 
            if (function_exists('espresso_is_admin') && espresso_is_admin() == true && $espresso_premium == true) {
                $user_company = espresso_user_meta($wp_user, 'company') != '' ? espresso_user_meta($wp_user, 'company') : '';
                $user_organization = espresso_user_meta($wp_user, 'organization') != '' ? espresso_user_meta($wp_user, 'organization') : '';
                $user_co_org = $user_company != '' ? $user_company : $user_organization;
                ?>
									<td class="date"><?php 
                echo espresso_user_meta($wp_user, 'user_firstname') != '' ? espresso_user_meta($wp_user, 'user_firstname') . ' ' . espresso_user_meta($wp_user, 'user_lastname') . ' (<a href="user-edit.php?user_id=' . $wp_user . '">' . espresso_user_meta($wp_user, 'user_nicename') . '</a>)' : espresso_user_meta($wp_user, 'display_name') . ' (<a href="user-edit.php?user_id=' . $wp_user . '">' . espresso_user_meta($wp_user, 'user_nicename') . '</a>)';
                echo $user_co_org != '' ? '<br />[' . espresso_user_meta($wp_user, 'company') . ']' : '';
                ?>
									</td>
							<?php 
            }
            ?>
								<td><a href="admin.php?page=event_tickets&action=edit_ticket&id=<?php 
            echo $ticket_id;
            ?>
">
							<?php 
            _e('Edit Ticket Template', 'event_espresso');
            ?>
									</a></td>
							</tr>
		<?php 
        }
    }
    ?>
				</tbody>
			</table>
			<p>

				<input type="checkbox" name="sAll" onclick="selectAll(this)" />
				<strong>
		<?php 
    _e('Check All', 'event_espresso');
    ?>
				</strong>
				<input name="delete_ticket" type="submit" class="button-secondary" id="delete_ticket" value="<?php 
    _e('Delete Selected', 'event_espresso');
    ?>
" style="margin-left:100px;" onclick="return confirmDelete();"> <?php 
    echo '<a href="admin.php?page=event_tickets&amp;action=add_new_ticket" style="margin-left:5px"class="button-primary">' . __('Add New', 'event_espresso') . '</a>';
    ?>
			</p>
		</form>
		<?php 
    $main_post_content = ob_get_clean();
    if (function_exists('espresso_version') && espresso_version() >= '3.2') {
        ob_start();
        do_meta_boxes('event-espresso_page_event_tickets', 'side', null);
        $sidebar_content = ob_get_clean();
        espresso_choose_layout($main_post_content, $sidebar_content);
    } else {
        espresso_choose_layout($main_post_content, event_espresso_display_right_column());
    }
    ?>
	</div>
	<?php 
    include_once 'tickets_help.php';
    ?>
	<script>
		jQuery(document).ready(function($) {

			/* show the table data */
			var mytable = $('#table').dataTable( {
				"bStateSave": true,
				"sPaginationType": "full_numbers",

				"oLanguage": {	"sSearch": "<strong><?php 
    _e('Live Search Filter', 'event_espresso');
    ?>
:</strong>",
					"sZeroRecords": "<?php 
    _e('No Records Found!', 'event_espresso');
    ?>
" },
				"aoColumns": [
					{ "bSortable": false },
					null,
					null,
	<?php 
    echo function_exists('espresso_is_admin') && espresso_is_admin() == true ? 'null,' : '';
    ?>
					null

				]

			} );

		} );
	</script>

	<?php 
    //echo event_espresso_custom_ticket_info();
}
コード例 #7
0
 /**
  * Updates the wordpress option that keeps track of which which EE version the database
  * is at (ie, the code may be at 4.1.0, but the database is still at 3.1.35)
  * @param array $slug_and_version {
  *	@type string $slug like 'Core' or 'Calendar',
  *	@type string $version like '4.1.0'
  * }
  * @return void
  */
 public function update_current_database_state_to($slug_and_version = null)
 {
     if (!$slug_and_version) {
         //no version was provided, assume it should be at the current code version
         $slug_and_version = array('slug' => 'Core', 'version' => espresso_version());
     }
     $current_database_state = get_option(self::current_database_state);
     $current_database_state[$slug_and_version['slug']] = $slug_and_version['version'];
     update_option(self::current_database_state, $current_database_state);
 }
コード例 #8
0
ファイル: espresso.php プロジェクト: sriram911/pls
        }
    }
}
if (isset($_REQUEST['page_id']) || is_admin()) {
    $this_is_a_reg_page = TRUE;
}
//This will (should) make sure everything is loaded via SSL
//So that the "..not everything is secure.." message doesn't appear
//Still will be a problem if other themes and plugins do not implement ssl correctly
$wp_plugin_url = WP_PLUGIN_URL;
$wp_content_url = WP_CONTENT_URL;
if (is_ssl()) {
    $wp_plugin_url = str_replace('http://', 'https://', WP_PLUGIN_URL);
    $wp_content_url = str_replace('http://', 'https://', WP_CONTENT_URL);
}
define("EVENT_ESPRESSO_VERSION", espresso_version());
define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION);
//Define the plugin directory and path
define("EVENT_ESPRESSO_PLUGINPATH", "/" . plugin_basename(dirname(__FILE__)) . "/");
define("EVENT_ESPRESSO_PLUGINFULLPATH", WP_PLUGIN_DIR . EVENT_ESPRESSO_PLUGINPATH);
define("EVENT_ESPRESSO_PLUGINFULLURL", $wp_plugin_url . EVENT_ESPRESSO_PLUGINPATH);
//End - Define the plugin directory and path
//Define dierectory structure for uploads
if (!defined('WP_CONTENT_DIR')) {
    define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
}
$upload_path = WP_CONTENT_DIR . "/uploads";
$event_espresso_upload_dir = "{$upload_path}/espresso/";
$event_espresso_template_dir = "{$event_espresso_upload_dir}templates/";
$includes_directory = EVENT_ESPRESSO_PLUGINFULLPATH . 'includes/';
define("EVENT_ESPRESSO_INCLUDES_DIR", $includes_directory);
コード例 #9
0
 /**
  * Helps us to remember to update the model version info every time we add something 
  * that would require it to change. AT this point I know something will come up in 4.9
  * so when that comes, we will need to update the model changes array in Model_Version_Info
  */
 function test_model_version_info_is_up_to_date()
 {
     $this->assertTrue(espresso_version() < '4.9.0');
 }
コード例 #10
0
 **/
//month, basicWeek, basicDay, agendaWeek, agendaDay
$espresso_calendar_widget .= 'defaultView: \'month\',';
//Defines the buttons and title at the top of the calendar.
$espresso_calendar_widget .= 'header: { left: \'prev\', center: \'title\', right: \'next\' },';
// setting this to a blank value so no title/buttons appear
/**
 * Theme Settings
 *
 * Once you enable theming with true, you still need to include the CSS file for the theme you want.
 * For example, if you just downloaded a theme from the jQuery UI Themeroller, you need to put a <link> tag in your page's <head>.
 **/
//jQuery UI Themeroller
//Enables/disables use of jQuery UI theming.
//Settings: http://arshaw.com/fullcalendar/docs/display/theme/
if (!empty($org_options['style_settings']['enable_default_style']) && $org_options['style_settings']['enable_default_style'] == 'Y' || function_exists('espresso_version') && espresso_version() >= '3.2.P' && !empty($org_options['style_settings']['enable_default_style']) && $org_options['style_settings']['enable_default_style'] == true) {
    $espresso_calendar_widget .= 'theme: true,';
}
//This option only applies to calendars that have jQuery UI theming enabled with the theme option.
/*buttonIcons:{ //Settings: http://arshaw.com/fullcalendar/docs/display/buttonIcons/
			prev: 'circle-triangle-w',
			next: 'circle-triangle-e'
		},*/
//The day that each week begins.
//The value must be a number that represents the day of the week.
//Sunday=0, Monday=1, Tuesday=2, etc.
$espresso_calendar_widget .= 'firstDay: ' . $espresso_calendar['espresso_calendar_firstday'] . ',';
//Settings: http://arshaw.com/fullcalendar/docs/display/firstDay/
//Displays the calendar in right-to-left mode.
$espresso_calendar_widget .= 'isRTL: false,';
//Whether to include Saturday/Sunday columns in any of the calendar views.
コード例 #11
0
 function test_detect_activation_or_upgrade__downgrade_upon_normal_request()
 {
     $pretend_previous_version = $this->_add_to_version(espresso_version(), '0.1.0.0.0');
     $this->_pretend_espresso_db_update_is(array($pretend_previous_version => array(current_time('mysql'))));
     $this->assertEquals(EE_System::req_type_downgrade, EE_System::reset()->detect_req_type());
     $current_activation_history = get_option('espresso_db_update');
     $this->assertArrayHasKey($pretend_previous_version, $current_activation_history);
     $this->assertTimeIsAbout(current_time('timestamp'), $current_activation_history[$pretend_previous_version][0]);
     $this->assertArrayHasKey(espresso_version(), $current_activation_history);
     $this->assertTimeIsAbout(current_time('timestamp'), $current_activation_history[espresso_version()][0]);
     $this->assertWPOptionDoesNotExist('ee_espresso_activation');
 }
コード例 #12
0
 /**
  * Writes some meta data to the CSV as a bunch of columns. Initially we're only
  * mentioning the version and timezone
  * @param resource $filehandle
  */
 public function write_metadata_to_csv($filehandle)
 {
     EE_Registry::instance()->load_helper('DTT_Helper');
     $data_row = array(EE_CSV::metadata_header);
     //do NOT translate because this exact string is used when importing
     $this->fputcsv2($filehandle, $data_row);
     EE_Registry::instance()->load_helper('DTT_Helper');
     $meta_data = array(0 => array('version' => espresso_version(), 'timezone' => EEH_DTT_Helper::get_timezone(), 'time_of_export' => current_time('mysql'), 'site_url' => site_url()));
     $this->write_data_array_to_csv($filehandle, $meta_data);
 }
 /**
  * Registers the mock addon so it can be used for testing
  */
 public function setUp()
 {
     parent::setUp();
     $this->_pretend_addon_hook_time();
     $mock_addon_path = EE_TESTS_DIR . 'mocks/addons/eea-new-addon/';
     EE_Register_Addon::register($this->_addon_name, array('version' => '1.0.0.dev.000', 'min_core_version' => '4.0.0', 'main_file_path' => $mock_addon_path . 'eea-new-addon.php', 'dms_paths' => $mock_addon_path . 'core/data_migration_scripts'));
     //double-check that worked fine
     $this->assertAttributeNotEmpty('EE_New_Addon', EE_Registry::instance()->addons);
     $DMSs_available = EE_Data_Migration_Manager::reset()->get_all_data_migration_scripts_available();
     $this->assertArrayHasKey('EE_DMS_New_Addon_1_0_0', $DMSs_available);
     //ensure this is the only addon
     $this->assertEquals(1, count(EE_Registry::instance()->addons));
     $this->_addon = EE_Registry::instance()->addons->EE_New_Addon;
     $this->assertTrue($this->_addon instanceof EE_New_Addon);
     $this->_addon_classname = get_class($this->_addon);
     $this->_addon_activation_history = $this->_addon->get_activation_history();
     $this->_current_db_state = get_option(EE_Data_Migration_Manager::current_database_state);
     delete_option(EE_Data_Migration_Manager::current_database_state);
     update_option(EE_Data_Migration_Manager::current_database_state, array('Core' => espresso_version()));
     add_filter('FHEE__EEH_Activation__create_table__short_circuit', array($this, 'dont_short_circuit_new_addon_table'), 20, 3);
 }
コード例 #14
0
 /**
  * This basically mimics the WordPress _doing_it_wrong() function except adds our own messaging etc.
  * Very useful for providing helpful messages to developers when the method of doing something has been deprecated,
  * or we want to make sure they use something the right way.
  *
  * @access public
  * @param string $function      The function that was called
  * @param string $message       A message explaining what has been done incorrectly
  * @param string $version       The version of Event Espresso where the error was added
  * @param string  $applies_when a version string for when you want the doing_it_wrong notice to begin appearing
  *                              for a deprecated function. This allows deprecation to occur during one version,
  *                              but not have any notices appear until a later version. This allows developers
  *                              extra time to update their code before notices appear.
  * @param int     $error_type
  * @uses   trigger_error()
  */
 public function doing_it_wrong($function, $message, $version, $applies_when = '', $error_type = null)
 {
     $applies_when = !empty($applies_when) ? $applies_when : espresso_version();
     $error_type = $error_type !== null ? $error_type : E_USER_NOTICE;
     // because we swapped the parameter order around for the last two params,
     // let's verify that some third party isn't still passing an error type value for the third param
     if (is_int($applies_when)) {
         $error_type = $applies_when;
         $applies_when = espresso_version();
     }
     // if not displaying notices yet, then just leave
     if (version_compare(espresso_version(), $applies_when, '<')) {
         return;
     }
     do_action('AHEE__EEH_Debug_Tools__doing_it_wrong_run', $function, $message, $version);
     $version = $version === null ? '' : sprintf(__('(This message was added in version %s of Event Espresso)', 'event_espresso'), $version);
     $error_message = sprintf(esc_html__('%1$s was called %2$sincorrectly%3$s. %4$s %5$s', 'event_espresso'), $function, '<strong>', '</strong>', $message, $version);
     //don't trigger error if doing ajax, instead we'll add a transient EE_Error notice that in theory should show on the next request.
     if (defined('DOING_AJAX') && DOING_AJAX) {
         $error_message .= ' ' . esc_html__('This is a doing_it_wrong message that was triggered during an ajax request.  The request params on this request were: ', 'event_espresso');
         $error_message .= '<ul><li>';
         $error_message .= implode('</li><li>', EE_Registry::instance()->REQ->params());
         $error_message .= '</ul>';
         EE_Error::add_error($error_message, 'debug::doing_it_wrong', $function, '42');
         //now we set this on the transient so it shows up on the next request.
         EE_Error::get_notices(false, true);
     } else {
         trigger_error($error_message, $error_type);
     }
 }
コード例 #15
0
 function espresso_enqueue_admin_ticketing_menu_css()
 {
     if (is_admin() && function_exists('espresso_version') && espresso_version() >= '3.2.P') {
         wp_enqueue_style('espresso_ticketing_menu', ESPRESSO_TICKETING_FULL_URL . 'css/admin-menu-styles.css');
     }
     if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'event_tickets') {
         wp_enqueue_style('espresso_ticketing', ESPRESSO_TICKETING_FULL_URL . 'css/admin-styles.css');
     }
 }
コード例 #16
0
<?php

$version = espresso_version();
?>
<div class="metabox-holder">
        <div class="postbox">
<h3>Premium Feature</h3>
          <div class="inside">
          <div class="padding">
            <h2 style="color:#F00; text-align:center;">This feature is included in the premium version of Event Espresso. </h2>
            <h4 style=" text-align:center;">Upgrade Now!</h4>
 <style> 
   
  
        
    #pricing-table {
        margin: 20px auto 20px auto;
        text-align: center;
        width: 892px; /* total computed width = 222 x 3 + 226 */
    }

    #pricing-table .plan {
        font: 12px 'Lucida Sans', 'trebuchet MS', Arial, Helvetica;
        text-shadow: 0 1px rgba(255,255,255,.8);        
        background: #fff;      
        border: 1px solid #ddd;
        color: #333;
        padding: 20px;
        width: 180px; /* plan width = 180 + 20 + 20 + 1 + 1 = 222px */      
        float: left;
        position: relative;
コード例 #17
0
ファイル: edit_ticket.php プロジェクト: sriram911/pls
function edit_event_ticket()
{
    global $wpdb;
    $css_files = espresso_ticket_css_template_files();
    $template_files = espresso_ticket_template_files();
    $id = $_REQUEST['id'];
    $results = $wpdb->get_results("SELECT * FROM " . EVENTS_TICKET_TEMPLATES . " WHERE id =" . $id);
    foreach ($results as $result) {
        $ticket_id = $result->id;
        $ticket_name = stripslashes_deep($result->ticket_name);
        $css_file = stripslashes_deep($result->css_file);
        $template_file = stripslashes_deep($result->template_file);
        $ticket_logo_url = stripslashes_deep($result->ticket_logo_url);
        $ticket_content = stripslashes_deep($result->ticket_content);
    }
    ?>

<div class="metabox-holder">
		<div class="postbox">
			<h3>
				<?php 
    _e('Edit Ticket', 'event_espresso');
    ?>
			</h3>
			<div class="inside">
			
				<form id="add-edit-new-event-ticket" method="post" action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
">
					<input type="hidden" name="ticket_id" value="<?php 
    echo $ticket_id;
    ?>
">
						<input type="hidden" name="action" value="update_ticket">
						<?php 
    /*?><h4><?php echo stripslashes($ticket_name) ?></h4><?php */
    ?>
						<table class="form-table">
							<tbody>
								<tr>
									<th> 
										<label>
											<?php 
    _e('Ticket Name', 'event_espresso');
    ?>
										</label>
									</th>
									<td>
										<input type="text" name="ticket_name" size="25" value="<?php 
    echo stripslashes($ticket_name);
    ?>
" />
									</td>
								</tr>
								<tr>
									<th>
									<label for="base-ticket-select" <?php 
    echo $styled;
    ?>
>
										<?php 
    _e('Select Stylesheet', 'event_espresso');
    ?>
									</label>
									</th>
									<td>
										<select id="base-ticket-select" class="wide" <?php 
    echo $disabled;
    ?>
 name="css_file">
										 <option <?php 
    espresso_file_is_selected($fname, $css_file);
    ?>
 value="simple.css">
											<?php 
    _e('Default CSS - Simple', 'event_espresso');
    ?>
										</option>
								<?php 
    foreach ($css_files as $fname) {
        ?>
										<option <?php 
        espresso_file_is_selected($fname, $css_file);
        ?>
 value="<?php 
        echo $fname;
        ?>
"><?php 
        echo $fname;
        ?>
</option>
						<?php 
    }
    ?>
										</select>
									</td>
								</tr>
								<?php 
    if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . "tickets/templates/index.php")) {
        ?>
								<tr>
									<th>
									<label for="base-template-select" <?php 
        echo $styled;
        ?>
>
										<?php 
        _e('Select a Template', 'event_espresso');
        ?>
									</label>
									</th>
									<td>
										<select id="base-template-select" class="wide" <?php 
        echo $disabled;
        ?>
 name="template_file">
										 <option <?php 
        espresso_file_is_selected($fname, $template_file);
        ?>
 value="index.php">
											<?php 
        _e('Default Template', 'event_espresso');
        ?>
										</option>
								<?php 
        foreach ($template_files as $fname) {
            ?>
										<option <?php 
            espresso_file_is_selected($fname, $template_file);
            ?>
 value="<?php 
            echo $fname;
            ?>
"><?php 
            echo $fname;
            ?>
</option>
								<?php 
        }
        ?>
										</select>
									</td>
								</tr>
								<?php 
    }
    ?>
						  <?php 
    if (!empty($ticket_logo_url)) {
        $ticket_logo = $ticket_logo_url;
    } else {
        $ticket_logo = '';
    }
    ?>
								<tr>
									<th>
									  <label for="upload_image">
										<?php 
    _e('Add a Logo', 'event_espresso');
    ?>
									  </label>
									</th>
									<td>
										<div id="ticket-logo-image">
									  <input id="upload_image" type="hidden" size="36" name="upload_image" value="<?php 
    echo $ticket_logo;
    ?>
" />
		  							<input id="upload_image_button" type="button" value="Upload Image" />
		 							 <?php 
    if ($ticket_logo) {
        ?>
		  							<p class="ticket-logo-thumb"><img src="<?php 
        echo $ticket_logo;
        ?>
" alt="" /></p>
										<a id='remove-image' href='#' title='<?php 
        _e('Remove this image', 'event_espresso');
        ?>
' onclick='return false;'><?php 
        _e('Remove Image', 'event_espresso');
        ?>
</a>
		  						<?php 
    }
    ?>
										</div>
									</td>
								</tr>
							</tbody>
						</table>
						
						<div id="descriptiondivrich" class="postarea">
						<label for="ticket_content">
							<strong><?php 
    _e('Ticket Description/Instructions ', 'event_espresso');
    ?>
</strong> 
							<?php 
    if (function_exists('espresso_version') && espresso_version() >= '3.2.P') {
        echo apply_filters('filter_hook_espresso_help', 'ticket_description_info');
    } else {
        echo '<a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=ticket_description_info" target="_blank"><img src="' . EVENT_ESPRESSO_PLUGINFULLURL . '/images/question-frame.png" width="16" height="16" /></a>';
    }
    ?>
						</label>
						<div class="postbox">
						<?php 
    wp_editor(stripslashes_deep($ticket_content), 'ticket_content', array('media_buttons' => true, 'tab_index' => 3));
    ?>
						<table id="manage-event-ticket-form" cellspacing="0">
							<tbody>
								<tr>
									<td class="aer-word-count"></td>
									<td class="autosave-info"><span> <?php 
    /*?><a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=custom_ticket_info">
    			<?php _e('View Custom Ticket Tags', 'event_espresso'); ?>
    				</a> | <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=custom_ticket_example">
    			<?php _e('Ticket Example','event_espresso'); ?></a> 
    		| <a class="thickbox" href="<?php echo ESPRESSO_TICKETING_FULL_URL.'templates/'.$css_file; ?>?TB_iframe=true&height=200&width=630">
    			<?php _e('Preview','event_espresso'); ?>
    			</a><?php */
    ?>
 </span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>

				<p>
					<input class="button-primary" type="submit" name="Submit" value="<?php 
    _e('Update Ticket');
    ?>
" id="update_ticket" />
				</p>

					<?php 
    wp_nonce_field('espresso_form_check', 'update_ticket');
    ?>
				</form>
			</div>
		</div>
</div>
<script type="text/javascript" charset="utf-8">
	//<![CDATA[
 	jQuery(document).ready(function() {    
		var header_clicked = false; 
		jQuery('#upload_image_button').click(function() {
		formfield = jQuery('#upload_image').attr('name');
		tb_show('', 'media-upload.php?type=image&amp;TB_iframe=1');
		jQuery('p.ticket-logo-thumb').addClass('old');
		header_clicked = true;
	    return false;
	   });
		window.original_send_to_editor = window.send_to_editor;
					 
		window.send_to_editor = function(html) {
			if(header_clicked) {
				imgurl = jQuery('img',html).attr('src');
				jQuery('#' + formfield).val(imgurl);
				jQuery('#ticket-logo-image').append("<p id='image-display'><img class='show-selected-img' src='"+imgurl+"' alt='' /></p>");
				header_clicked = false;
				tb_remove();
				} else {
					window.original_send_to_editor(html);
				}
		}
		

		// process the remove link in the metabox
			jQuery('#remove-image').click(function(){
				var answer = confirm('<?php 
    _e('Do you really want to delete this image? Please remember to save your settings to complete the removal.', 'event_espresso');
    ?>
');
				if (answer){
					jQuery("#upload_image").val('');
					jQuery("p.ticket-logo-thumb").remove();
					jQuery("p#image-display").remove();
					jQuery('#remove-image').remove();
				}
				return false;
			});
			
			
	});

	//]]>
</script>
<?php 
    //espresso_tiny_mce();
}
 /**
  * default maintenance page. If we're in maintenance mode level 2, then we need to show
  * the migration scripts and all that UI.
  */
 public function _maintenance()
 {
     //it all depends if we're in maintenance model level 1 (frontend-only) or
     //level 2 (everything except maintenance page)
     try {
         //get the current maintenance level and check if
         //we are removed
         $mm = EE_Maintenance_Mode::instance()->level();
         $placed_in_mm = EE_Maintenance_Mode::instance()->set_maintenance_mode_if_db_old();
         if ($mm == EE_Maintenance_Mode::level_2_complete_maintenance && !$placed_in_mm) {
             //we just took the site out of maintenance mode, so notify the user.
             //unfortunately this message appears to be echoed on the NEXT page load...
             //oh well, we should really be checking for this on addon deactivation anyways
             EE_Error::add_attention(__('Site taken out of maintenance mode because no data migration scripts are required', 'event_espresso'));
             $this->_process_notices(array('page' => 'espresso_maintenance_settings'), false);
         }
         //in case an exception is thrown while trying to handle migrations
         switch (EE_Maintenance_Mode::instance()->level()) {
             case EE_Maintenance_Mode::level_0_not_in_maintenance:
             case EE_Maintenance_Mode::level_1_frontend_only_maintenance:
                 $show_maintenance_switch = true;
                 $show_backup_db_text = false;
                 $show_migration_progress = false;
                 $script_names = array();
                 $addons_should_be_upgraded_first = false;
                 break;
             case EE_Maintenance_Mode::level_2_complete_maintenance:
                 $show_maintenance_switch = false;
                 $show_migration_progress = true;
                 if (isset($this->_req_data['continue_migration'])) {
                     $show_backup_db_text = false;
                 } else {
                     $show_backup_db_text = true;
                 }
                 $scripts_needing_to_run = EE_Data_Migration_Manager::instance()->check_for_applicable_data_migration_scripts();
                 $addons_should_be_upgraded_first = EE_Data_Migration_Manager::instance()->addons_need_updating();
                 $script_names = array();
                 $current_script = NULL;
                 foreach ($scripts_needing_to_run as $script) {
                     if ($script instanceof EE_Data_Migration_Script_Base) {
                         if (!$current_script) {
                             $current_script = $script;
                             $current_script->migration_page_hooks();
                         }
                         $script_names[] = $script->pretty_name();
                     }
                 }
                 break;
         }
         $most_recent_migration = EE_Data_Migration_Manager::instance()->get_last_ran_script(true);
         $exception_thrown = false;
     } catch (EE_Error $e) {
         EE_Data_Migration_Manager::instance()->add_error_to_migrations_ran($e->getMessage());
         //now, just so we can display the page correctly, make a error migration script stage object
         //and also put the error on it. It only persists for the duration of this request
         $most_recent_migration = new EE_DMS_Unknown_1_0_0();
         $most_recent_migration->add_error($e->getMessage());
         $exception_thrown = true;
     }
     $current_db_state = EE_Data_Migration_Manager::instance()->ensure_current_database_state_is_set();
     if ($exception_thrown || $most_recent_migration && $most_recent_migration instanceof EE_Data_Migration_Script_Base && $most_recent_migration->is_broken()) {
         $this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_migration_was_borked_page.template.php';
         $this->_template_args['support_url'] = 'http://eventespresso.com/support/forums/';
         $this->_template_args['next_url'] = EEH_URL::add_query_args_and_nonce(array('action' => 'confirm_migration_crash_report_sent', 'success' => '0'), EE_MAINTENANCE_ADMIN_URL);
     } elseif ($addons_should_be_upgraded_first) {
         $this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_upgrade_addons_before_migrating.template.php';
     } else {
         if ($most_recent_migration && $most_recent_migration instanceof EE_Data_Migration_Script_Base && $most_recent_migration->can_continue()) {
             $show_backup_db_text = false;
             $show_continue_current_migration_script = true;
             $show_most_recent_migration = true;
         } elseif (isset($this->_req_data['continue_migration'])) {
             $show_most_recent_migration = true;
             $show_continue_current_migration_script = false;
         } else {
             $show_most_recent_migration = false;
             $show_continue_current_migration_script = false;
         }
         if (isset($current_script)) {
             $migrates_to = $current_script->migrates_to_version();
             $plugin_slug = $migrates_to['slug'];
             $new_version = $migrates_to['version'];
             $this->_template_args = array_merge($this->_template_args, array('current_db_state' => sprintf(__("EE%s (%s)", "event_espresso"), isset($current_db_state[$plugin_slug]) ? $current_db_state[$plugin_slug] : 3, $plugin_slug), 'next_db_state' => isset($current_script) ? sprintf(__("EE%s (%s)", 'event_espresso'), $new_version, $plugin_slug) : NULL));
         }
         $this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_migration_page.template.php';
         $this->_template_args = array_merge($this->_template_args, array('show_most_recent_migration' => $show_most_recent_migration, 'show_migration_progress' => $show_migration_progress, 'show_backup_db_text' => $show_backup_db_text, 'show_maintenance_switch' => $show_maintenance_switch, 'script_names' => $script_names, 'show_continue_current_migration_script' => $show_continue_current_migration_script, 'reset_db_page_link' => EE_Admin_Page::add_query_args_and_nonce(array('action' => 'reset_db'), EE_MAINTENANCE_ADMIN_URL), 'update_migration_script_page_link' => EE_Admin_Page::add_query_args_and_nonce(array('action' => 'change_maintenance_level'), EE_MAINTENANCE_ADMIN_URL), 'ultimate_db_state' => sprintf(__("EE%s", 'event_espresso'), espresso_version())));
         //make sure we have the form fields helper available. It usually is, but sometimes it isn't
         EE_Registry::instance()->load_helper('Form_Fields');
         //localize script stuff
         wp_localize_script('ee-maintenance', 'ee_maintenance', array('migrating' => __("Migrating...", "event_espresso"), 'next' => __("Next", "event_espresso"), 'fatal_error' => __("A Fatal Error Has Occurred", "event_espresso"), 'click_next_when_ready' => __("The current Migration has ended. Click 'next' when ready to proceed", "event_espresso"), 'status_no_more_migration_scripts' => EE_Data_Migration_Manager::status_no_more_migration_scripts, 'status_fatal_error' => EE_Data_Migration_Manager::status_fatal_error, 'status_completed' => EE_Data_Migration_Manager::status_completed));
     }
     $this->_template_args['most_recent_migration'] = $most_recent_migration;
     //the actual most recently ran migration
     $this->_template_args['admin_page_content'] = EEH_Template::display_template($this->_template_path, $this->_template_args, TRUE);
     $this->display_admin_page_with_sidebar();
 }
コード例 #19
0
ファイル: espresso.php プロジェクト: vinylthieves/kaylyn-kyle
//Returns the plugin version
if (!function_exists('espresso_version')) {
    /**
     * espresso_version
     * @return string
     */
    function espresso_version()
    {
        return '4.7.10.p';
    }
} else {
    unset($_GET['activate']);
    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
}
// define versions
define('EVENT_ESPRESSO_VERSION', espresso_version());
define('EE_MIN_WP_VER_REQUIRED', '4.0');
define('EE_MIN_WP_VER_RECOMMENDED', '4.1');
define('EE_MIN_PHP_VER_REQUIRED', '5.3.0');
define('EE_MIN_PHP_VER_RECOMMENDED', '5.4.33');
define('EVENT_ESPRESSO_POWERED_BY', 'Event Espresso - ' . EVENT_ESPRESSO_VERSION);
define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
//used to be DIRECTORY_SEPARATOR, but that caused issues on windows
if (!defined('DS')) {
    define('DS', '/');
}
if (!defined('PS')) {
    define('PS', PATH_SEPARATOR);
}
if (!defined('SP')) {
    define('SP', ' ');
コード例 #20
0
    /**
     *    _print_scripts
     *
     * @access 	public
     * @param 	bool $force_print
     * @return 	void
     */
    private static function _print_scripts($force_print = FALSE)
    {
        if ((did_action('admin_enqueue_scripts') || did_action('wp_enqueue_scripts')) && !$force_print) {
            if (wp_script_is('ee_error_js', 'enqueued')) {
                return;
            } else {
                if (wp_script_is('ee_error_js', 'registered')) {
                    add_filter('FHEE_load_css', '__return_true');
                    add_filter('FHEE_load_js', '__return_true');
                    wp_enqueue_script('ee_error_js');
                    wp_localize_script('ee_error_js', 'ee_settings', array('wp_debug' => WP_DEBUG));
                }
            }
        } else {
            return '
<script>
/* <![CDATA[ */
var ee_settings = {"wp_debug":"' . WP_DEBUG . '"};
/* ]]> */
</script>
<script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script>
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
';
        }
    }
コード例 #21
0
/**
 * Output the content of the debugging page.
 *
 * @access public
 * @return void
 */
function espresso_system_status()
{
    global $org_options;
    /**
     * let_to_num function. (copied from woocommerce-core-functions.php)
     *
     * This function transforms the php.ini notation for numbers (like '2M') to an integer.
     *
     * @access public
     * @param $size
     * @return int
     */
    function espresso_let_to_num($size)
    {
        $l = substr($size, -1);
        $ret = substr($size, 0, -1);
        switch (strtoupper($l)) {
            case 'P':
                $ret *= 1024;
            case 'T':
                $ret *= 1024;
            case 'G':
                $ret *= 1024;
            case 'M':
                $ret *= 1024;
            case 'K':
                $ret *= 1024;
        }
        return $ret;
    }
    ?>
	<style type="text/css">
		#debug-report {
			display: none;
			font-family: monospace;
			height: 200px;
			margin-bottom: 20px;
			width: 100%;
		}
		table.ee_status_table th {
			font-weight: bold;
		}
		table.ee_status_table td {
			padding: 5px 7px;
		}
		table.ee_status_table td mark {
			background: none repeat scroll 0 0 transparent;
		}
		table.ee_status_table td mark.yes {
			color: green;
		}
		table.ee_status_table td mark.no {
			color: #999999;
		}
		table.ee_status_table td mark.error {
			color: red;
		}
		table.ee_status_table td ul {
			margin: 0;
		}
	</style>
	<div class="wrap event_espresso">
		<div class="icon32" id="icon-options-event"><br /></div>
		<h2><?php 
    _e('System Status', 'event_espresso');
    ?>
 <a href="#" class="add-new-h2 debug-report"><?php 
    _e('Generate report', 'event_espresso');
    ?>
</a></h2>
		<br/>
		<textarea id="debug-report" readonly="readonly"></textarea>
		<table class="ee_status_table widefat" cellspacing="0">

			<thead>
				<tr>
					<th colspan="2"><?php 
    _e('Versions', 'event_espresso');
    ?>
</th>
				</tr>
			</thead>

			<tbody>
                <tr>
                    <td><?php 
    _e('Event Espresso version', 'event_espresso');
    ?>
</td>
                    <td><?php 
    echo espresso_version();
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    _e('WordPress version', 'event_espresso');
    ?>
</td>
                    <td><?php 
    if (is_multisite()) {
        echo 'WPMU';
    } else {
        echo 'WP';
    }
    ?>
 <?php 
    echo bloginfo('version');
    ?>
</td>
                </tr>
             	<tr>
             		<td><?php 
    _e('Installed plugins', 'event_espresso');
    ?>
</td>
             		<td><?php 
    $active_plugins = (array) get_option('active_plugins', array());
    if (is_multisite()) {
        $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
    }
    $active_plugins = array_map('strtolower', $active_plugins);
    $ee_plugins = array();
    foreach ($active_plugins as $plugin) {
        //if ( strstr( $plugin, 'event_espresso' ) ) {
        $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
        if (!empty($plugin_data['Name'])) {
            $ee_plugins[] = $plugin_data['Name'] . ' ' . __('by', 'event_espresso') . ' ' . $plugin_data['Author'] . ' ' . __('version', 'event_espresso') . ' ' . $plugin_data['Version'];
        }
        //}
    }
    if (sizeof($ee_plugins) == 0) {
        echo '-';
    } else {
        echo '<ul><li>' . implode(', </li><li>', $ee_plugins) . '</li></ul>';
    }
    ?>
</td>
             	</tr>
			</tbody>

			<thead>
				<tr>
					<th colspan="2"><?php 
    _e('Settings', 'event_espresso');
    ?>
</th>
				</tr>
			</thead>

			<tbody>
                <tr>
                    <td><?php 
    _e('Home URL', 'event_espresso');
    ?>
</td>
                    <td><?php 
    echo home_url();
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    _e('Site URL', 'event_espresso');
    ?>
</td>
                    <td><?php 
    echo site_url();
    ?>
</td>
                </tr>
			</tbody>

			<thead>
				<tr>
					<th colspan="2"><?php 
    _e('Registration Pages', 'event_espresso');
    ?>
</th>
				</tr>
			</thead>

			<tbody>
				<?php 
    $check_pages = array(__('Event Page', 'event_espresso') => array('option' => $org_options['event_page_id'], 'shortcode' => '[ESPRESSO_EVENTS]'), __('Payment/Thank You Page', 'event_espresso') => array('option' => $org_options['return_url'], 'shortcode' => '[ESPRESSO_PAYMENTS]'), __('Transaction Notification Page', 'event_espresso') => array('option' => $org_options['notify_url'], 'shortcode' => '[ESPRESSO_TXN_PAGE]'), __('Cancel Return Page', 'event_espresso') => array('option' => $org_options['cancel_return'], 'shortcode' => '[ESPRESSO_CANCELLED]'));
    $alt = 1;
    foreach ($check_pages as $page_name => $values) {
        if ($alt == 1) {
            echo '<tr>';
        } else {
            echo '<tr>';
        }
        echo '<td>' . $page_name . '</td><td>';
        $error = false;
        $page_id = $values['option'];
        // Page ID check
        if (!$page_id) {
            echo '<mark class="error">' . __('Page not set', 'event_espresso') . '</mark>';
            $error = true;
        } else {
            // Shortcode check
            if ($values['shortcode']) {
                $page = get_post($page_id);
                if (!strstr($page->post_content, $values['shortcode'])) {
                    echo '<mark class="error">' . sprintf(__('Page does not contain the shortcode: %s', 'event_espresso'), $values['shortcode']) . '</mark>';
                    $error = true;
                }
            }
        }
        if (!$error) {
            echo '<mark class="yes">#' . $page_id . ' - ' . get_permalink($page_id) . '</mark>';
        }
        echo '</td></tr>';
        $alt = $alt * -1;
    }
    ?>
			</tbody>

			
			<thead>
				<tr>
					<th colspan="2"><?php 
    _e('Server Environment', 'event_espresso');
    ?>
</th>
				</tr>
			</thead>

			<tbody>
                <tr>
                    <td><?php 
    _e('PHP Version', 'event_espresso');
    ?>
</td>
                    <td><?php 
    if (function_exists('phpversion')) {
        echo phpversion();
    }
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    _e('Server Software', 'event_espresso');
    ?>
</td>
                    <td><?php 
    echo $_SERVER['SERVER_SOFTWARE'];
    ?>
</td>
                </tr>
				<tr>
                    <td><?php 
    _e('WP Max Upload Size', 'event_espresso');
    ?>
</td>
                    <td><?php 
    echo size_format(wp_max_upload_size());
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    _e('Server upload_max_filesize', 'event_espresso');
    ?>
</td>
                    <td><?php 
    if (function_exists('phpversion')) {
        echo size_format(espresso_let_to_num(ini_get('upload_max_filesize')));
    }
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    _e('Server post_max_size', 'event_espresso');
    ?>
</td>
                    <td><?php 
    if (function_exists('phpversion')) {
        echo size_format(espresso_let_to_num(ini_get('post_max_size')));
    }
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    _e('WP Memory Limit', 'event_espresso');
    ?>
</td>
                    <td><?php 
    $memory = espresso_let_to_num(WP_MEMORY_LIMIT);
    if ($memory < 67108864) {
        echo '<mark class="error">' . sprintf(__('%s - We recommend setting memory to at least 64MB. See: <a href="%s">Increasing memory allocated to PHP</a>', 'event_espresso'), size_format($memory), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP') . '</mark>';
    } else {
        echo '<mark class="yes">' . size_format($memory) . '</mark>';
    }
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    _e('WP Debug Mode', 'event_espresso');
    ?>
</td>
                    <td><?php 
    if (defined('WP_DEBUG') && WP_DEBUG) {
        echo '<mark class="yes">' . __('Yes', 'event_espresso') . '</mark>';
    } else {
        echo '<mark class="no">' . __('No', 'event_espresso') . '</mark>';
    }
    ?>
</td>
                </tr>
                <tr>
                    <td><?php 
    _e('Espresso Logging', 'event_espresso');
    ?>
</td>
                    <td><?php 
    if (@fopen(EVENT_ESPRESSO_UPLOAD_DIR . '/logs/espresso_log.txt', 'a')) {
        echo '<mark class="yes">' . __('Log directory is writable.', 'event_espresso') . '</mark>';
    } else {
        echo '<mark class="error">' . __('Log directory (<code>espresso/logs/</code>) is not writable. Logging will not be possible.', 'event_espresso') . '</mark>';
    }
    ?>
</td>
                </tr>
            </tbody>

            <thead>
				<tr>
					<th colspan="2"><?php 
    _e('PHP Sessions', 'event_espresso');
    ?>
</th>
				</tr>
			</thead>

			<tbody>
            	<tr>
                    <td><?php 
    _e('Session save path', 'event_espresso');
    ?>
</td>
					<td><?php 
    $save_path = session_save_path();
    if (!is_dir($save_path)) {
        echo '<mark class="error">' . sprintf(__('<code>%s</code> does not exist - contact your host to resolve the problem.', 'event_espresso'), $save_path) . '</mark>';
    } elseif (!is_writeable($save_path)) {
        echo '<mark class="error">' . sprintf(__('<code>%s</code> is not writable - contact your host to resolve the problem.', 'event_espresso'), $save_path) . '</mark>';
    } else {
        echo '<mark class="yes">' . sprintf(__('<code>%s</code> is writable.', 'event_espresso'), $save_path) . '</mark>';
    }
    ?>
</td>
                </tr>
                <tr>
                	<td><?php 
    _e('Session name', 'event_espresso');
    ?>
</td>
                	<td><?php 
    echo session_name();
    ?>
</td>
                </tr>
            </tbody>

            <thead>
				<tr>
					<th colspan="2"><?php 
    _e('Remote Posting/IPN', 'event_espresso');
    ?>
</th>
				</tr>
			</thead>

			<?php 
    $posting = array();
    // fsockopen/cURL
    $posting['fsockopen_curl']['name'] = __('fsockopen/cURL', 'event_espresso');
    if (function_exists('fsockopen') || function_exists('curl_init')) {
        if (function_exists('fsockopen') && function_exists('curl_init')) {
            $posting['fsockopen_curl']['note'] = __('Your server has fsockopen and cURL enabled.', 'event_espresso');
        } elseif (function_exists('fsockopen')) {
            $posting['fsockopen_curl']['note'] = __('Your server has fsockopen enabled, cURL is disabled.', 'event_espresso');
        } else {
            $posting['fsockopen_curl']['note'] = __('Your server has cURL enabled, fsockopen is disabled.', 'event_espresso');
        }
        $posting['fsockopen_curl']['success'] = true;
    } else {
        $posting['fsockopen_curl']['note'] = __('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'event_espresso') . '</mark>';
        $posting['fsockopen_curl']['success'] = false;
    }
    // WP Remote Post Check
    /*$posting['wp_remote_post']['name'] = __('WP Remote Post Check','event_espresso');
    				$request['cmd'] = '_notify-validate';
    				$params = array(
    					'sslverify' 	=> false,
    		        	'timeout' 		=> 60,
    		        	'user-agent'	=> 'Event Espresso/' . espresso_version(),
    		        	'body'			=> $request
    				);
    				$response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params );
    
    				if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
                		$posting['wp_remote_post']['note'] = __('wp_remote_post() was successful - PayPal IPN is working.', 'event_espresso');
                		$posting['wp_remote_post']['success'] = true;
                	} elseif ( is_wp_error( $response ) ) {
                		$posting['wp_remote_post']['note'] = __('wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider. Error:', 'event_espresso') . ' ' . $response->get_error_message();
                		$posting['wp_remote_post']['success'] = false;
                	} else {
    	            	$posting['wp_remote_post']['note'] = __('wp_remote_post() failed. PayPal IPN may not work with your server.', 'event_espresso');
                		$posting['wp_remote_post']['success'] = false;
                	}*/
    $posting = apply_filters('wc_debug_posting', $posting);
    ?>

			<tbody>
			<?php 
    foreach ($posting as $post) {
        $mark = isset($post['success']) && $post['success'] == true ? 'yes' : 'error';
        ?>
				<tr>
                    <td><?php 
        echo $post['name'];
        ?>
</td>
                    <td>
                    	<mark class="<?php 
        echo $mark;
        ?>
">
	                    	<?php 
        echo $post['note'];
        ?>
                    	</mark>
                    </td>
                </tr>
			<?php 
    }
    ?>
            </tbody>
		</table>

	</div>
	<script type="text/javascript">

		jQuery('a.debug-report').click(function(){

			if ( ! jQuery('#debug-report').val() ) {

				// Generate report - user can paste into forum
				var report = '`';

				jQuery('thead:not(".tools"), tbody:not(".tools")', '.ee_status_table').each(function(){

					$this = jQuery( this );

					if ( $this.is('thead') ) {

						report = report + "\n=============================================================================================\n";
						report = report + " " + jQuery.trim( $this.text() ) + "\n";
						report = report + "=============================================================================================\n";

					} else {

						jQuery('tr', $this).each(function(){

							$this = jQuery( this );

							report = report + $this.find('td:eq(0)').text() + ": \t";
							report = report + $this.find('td:eq(1)').text() + "\n";

						});

					}

				});

				report = report + '`';

				jQuery('#debug-report').val( report );
			}

			jQuery('#debug-report').slideToggle('500', function() {
				jQuery(this).select();
			});

      		return false;

		});

	</script>
	<?php 
}
コード例 #22
0
 function espresso_ticket_dd($current_value = 0)
 {
     global $espresso_premium;
     if ($espresso_premium != true) {
         return;
     }
     global $wpdb;
     $sql = "SELECT id, ticket_name FROM " . EVENTS_TICKET_TEMPLATES;
     $sql .= " WHERE ticket_name != '' ORDER BY ticket_name ";
     //echo $sql;
     $tickets = $wpdb->get_results($sql);
     $num_rows = $wpdb->num_rows;
     //return print_r( $tickets );
     $field = '<select name="ticket_id" id="ticket_id">\\n';
     $field .= '<option value="0">' . __('Select a Ticket', 'event_espresso') . '</option>';
     if ($num_rows > 0) {
         foreach ($tickets as $ticket) {
             $selected = $ticket->id == $current_value ? 'selected="selected"' : '';
             $field .= '<option ' . $selected . ' value="' . $ticket->id . '">' . $ticket->ticket_name . '</option>\\n';
         }
     }
     $field .= '</select>';
     if (function_exists('espresso_version') && espresso_version() >= '3.2') {
         $ee_help = '<a class="thickbox" target="_blank" href="#TB_inline?height=400&width=500&inlineId=custom_ticket_info"><span class="question"> [?]</span></a>';
     } else {
         $ee_help = ' <a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=status_types_info"><img src="' . EVENT_ESPRESSO_PLUGINFULLURL . '/images/question-frame.png" width="16" height="16" /></a>';
     }
     $html = '<p><label for="ticket_id">' . __('Custom Ticket ', 'event_espresso') . '</label>' . $field . $ee_help . '</p>';
     return $html;
 }
コード例 #23
0
    function form($instance)
    {
        // Set up some default widget settings.
        $defaults = array('title' => 'Calendar', 'show_expired' => false, 'category_id' => '', 'calendar_page' => '');
        $instance = wp_parse_args((array) $instance, $defaults);
        $values = array(array('id' => false, 'text' => __('No', 'event_espresso')), array('id' => true, 'text' => __('Yes', 'event_espresso')));
        ?>
<p>
	<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
		<?php 
        _e('Title:', 'event_espresso');
        ?>
	</label>
	<input type="text" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" width="20" value="<?php 
        echo $instance['title'];
        ?>
" />
</p>
<p>
	<label for="<?php 
        echo $this->get_field_id('show_expired');
        ?>
">
		<?php 
        _e('Display Expired Events?', 'event_espresso');
        ?>
	</label>
	<?php 
        echo select_input($this->get_field_name('show_expired'), $values, $instance['show_expired']);
        ?>
 </p>
<p>
	<label for="<?php 
        echo $this->get_field_id('category_id');
        ?>
">
		<?php 
        _e('Display Single Category?', 'event_espresso');
        ?>
	</label>
	<input type="text" id="<?php 
        echo $this->get_field_id('category_id');
        ?>
" name="<?php 
        echo $this->get_field_name('category_id');
        ?>
" width="20" value="<?php 
        echo $instance['category_id'];
        ?>
" />
	<?php 
        if (function_exists('espresso_version')) {
            if (espresso_version() >= '3.2.P') {
                echo apply_filters('filter_hook_espresso_help', 'display_single_category');
            }
        }
        ?>
</p>
<p>
	<label for="<?php 
        echo $this->get_field_id('calendar_page');
        ?>
">
		<?php 
        _e('Calendar Page', 'event_espresso');
        ?>
	</label>
	<input type="text" id="<?php 
        echo $this->get_field_id('calendar_page');
        ?>
" name="<?php 
        echo $this->get_field_name('calendar_page');
        ?>
" width="20" value="<?php 
        echo $instance['calendar_page'];
        ?>
" />
	<?php 
        if (function_exists('espresso_version')) {
            if (espresso_version() >= '3.2.P') {
                echo apply_filters('filter_hook_espresso_help', 'calendar_page');
            }
        }
        ?>
</p>
<?php 
    }
コード例 #24
0
function add_new_event_ticket()
{
    $css_files = espresso_ticket_css_template_files();
    $template_files = espresso_ticket_template_files();
    ?>
<!--Add event display-->

<div class="metabox-holder">
	<div class="postbox">
		<h3>
			<?php 
    _e('Add a Ticket Template', 'event_espresso');
    ?>
		</h3>
			<div class="inside">
				<form id="add-edit-new-event-ticket" method="post" action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
">
					<input type="hidden" name="action" value="add">
						<table class="form-table">
							<tbody>
								<tr>
									<th> 
										<label for="ticket_name">
											<?php 
    _e('Ticket Name', 'event_espresso');
    ?>
 
											<?php 
    if (function_exists('espresso_version') && espresso_version() >= '3.2.P') {
        //echo apply_filters( 'filter_hook_espresso_help', 'ticket-guide');
    } else {
        //echo '<a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=ticket-guide" target="_blank"><img src="'.EVENT_ESPRESSO_PLUGINFULLURL .'/images/question-frame.png" width="16" height="16" /></a>';
    }
    ?>
										</label>
									</th>
									<td><input type="text" name="ticket_name" size="25" /></td>
								</tr>
								<tr>
									<th>
										<label for="base-css-select"> 
											<?php 
    _e('Select Stylesheet', 'event_espresso');
    ?>
										</label>
									</th>
									<td>
										<select id="base-css-select" class="wide"  name="css_file">
										<option <?php 
    espresso_file_is_selected('simple.css');
    ?>
 value="simple.css">
										<?php 
    _e('Default CSS - Simple', 'event_espresso');
    ?>
										</option>
										<?php 
    foreach ($css_files as $fname) {
        ?>
										<option <?php 
        espresso_file_is_selected($fname);
        ?>
 value="<?php 
        echo $fname;
        ?>
"><?php 
        echo $fname;
        ?>
</option>
								<?php 
    }
    ?>
									</select>
									</td>
								</tr>
								<tr>
									<th>
										<label for="base-template-select"> 
											<?php 
    _e('Select a Template', 'event_espresso');
    ?>
										</label>
									</th>
									<td>
										<select id="base-template-select" class="wide"  name="template_file">
										<option <?php 
    espresso_file_is_selected($fname);
    ?>
 value="index.php">
										<?php 
    _e('Default Template', 'event_espresso');
    ?>
										</option>
										<?php 
    foreach ($template_files as $fname) {
        ?>
										<option <?php 
        espresso_file_is_selected($fname);
        ?>
 value="<?php 
        echo $fname;
        ?>
"><?php 
        echo $fname;
        ?>
</option>
								<?php 
    }
    ?>
									</select>
									</td>
								</tr>
								<?php 
    if (!empty($ticket_logo_url)) {
        $ticket_logo = $ticket_logo_url;
    } else {
        $ticket_logo = '';
    }
    ?>
								<tr>
									<th> 
										<label for="upload_image">
											<?php 
    _e('Add a Logo', 'event_espresso');
    ?>
										</label>
									</th>
									<td>
										<div id="ticket-logo-image">
										<?php 
    // var_dump($event_meta['event_thumbnail_url']);
    ?>
										<input id="upload_image" type="hidden" size="36" name="upload_image" value="<?php 
    echo $ticket_logo;
    ?>
" />
              		<input id="upload_image_button" type="button" value="Upload Image" />
              		
										<?php 
    if ($ticket_logo) {
        ?>
										<p class="ticket-logo"><img src="<?php 
        echo $ticket_logo;
        ?>
" alt="" /></p>
										<a id='remove-image' href='#' title='<?php 
        _e('Remove this image', 'event_espresso');
        ?>
' onclick='return false;'>
										<?php 
        _e('Remove Image', 'event_espresso');
        ?>
									</a>
									<?php 
    }
    ?>
										</div>
									</td>
								</tr>
							</tbody>
						</table>

						<div id="descriptiondivrich" class="postarea">
							<label for="ticket_content">
								<?php 
    _e('Ticket Description/Instructions ', 'event_espresso');
    ?>
								<?php 
    if (function_exists('espresso_version') && espresso_version() >= '3.2.P') {
        echo apply_filters('filter_hook_espresso_help', 'ticket_description_info');
    } else {
        echo '<a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=ticket_description_info" target="_blank"><img src="' . EVENT_ESPRESSO_PLUGINFULLURL . '/images/question-frame.png" width="16" height="16" /></a>';
    }
    ?>
							</label>
							<div class="postbox">
								<?php 
    wp_editor('', 'ticket_content', array('media_buttons' => true, 'tab_index' => 3));
    ?>
									<table id="manage-event-ticket-form" cellspacing="0">
										<tbody>
											<tr>
												<td class="aer-word-count"></td>
												<td class="autosave-info">
													<span> 
													<?php 
    /*?><a class="thickbox" href="#TB_inline?height=300&width=400&inlineId=custom_ticket_tags">
    		<?php _e('View Custom Ticket Tags', 'event_espresso'); ?>
    		</a><?php */
    ?>
													</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						<p>
							<input class="button-primary" type="submit" name="Submit" value="<?php 
    _e('Save Ticket');
    ?>
" id="add_new_ticket" />
						</p>
						 <?php 
    wp_nonce_field('espresso_form_check', 'add_new_ticket');
    ?>
					</form>
				</div>
		</div>
</div>
<script type="text/javascript" charset="utf-8">
	//<![CDATA[
 	jQuery(document).ready(function() {
			var header_clicked = false;
			jQuery('#upload_image_button').click(function() {
	     formfield = jQuery('#upload_image').attr('name');
	     tb_show('', 'media-upload.php?type=image&amp;TB_iframe=1');
				header_clicked = true;
	    return false;
	   });
		window.original_send_to_editor = window.send_to_editor;

		window.send_to_editor = function(html) {
			if(header_clicked) {
				imgurl = jQuery('img',html).attr('src');
				jQuery('#' + formfield).val(imgurl);
				jQuery('#ticket-logo-image').append("<p id='image-display'><img class='show-selected-img' src='"+imgurl+"' alt='' /></p>");
				header_clicked = false;
				tb_remove();
				jQuery("#ticket-logo-image").append("<a id='remove-image' href='#' title='<?php 
    _e('Remove this image', 'event_espresso');
    ?>
' onclick='return false;'><?php 
    _e('Remove Image', 'event_espresso');
    ?>
</a>");
				jQuery('#remove-image').click(function(){
				//alert('delete this image');
				jQuery('#' + formfield).val('');
				jQuery("#image-display").empty();
				jQuery('#remove-image').remove();
				});
				} else {
					window.original_send_to_editor(html);
				}
		}
	});

	//]]>
</script>
<?php 
    //espresso_tiny_mce();
}
コード例 #25
0
ファイル: member_functions.php プロジェクト: sriram911/pls
/**
 * Espresso Edit Profile
 * @author Chris Reynolds
 * @since 1.9.6
 * This runs the code for the shortcode to display an edit profile form on the front end with Event Espresso profile fields added
 */
function event_espresso_member_edit_profile()
{
    /* Get user info. */
    global $current_user, $wp_roles, $org_options;
    get_currentuserinfo();
    // themeroller stuff
    if (!empty($org_options['style_settings']['enable_default_style']) && $org_options['style_settings']['enable_default_style'] == 'Y') {
        //Define the path to the ThemeRoller files
        if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . "themeroller/index.php")) {
            $themeroller_style_path = EVENT_ESPRESSO_UPLOAD_URL . 'themeroller/';
        } else {
            $themeroller_style_path = EVENT_ESPRESSO_PLUGINFULLURL . 'templates/css/themeroller/';
        }
        //Load custom style sheet if available
        if (!empty($org_options['style_settings']['css_name'])) {
            wp_register_style('espresso_custom_css', EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $org_options['style_settings']['css_name']);
            wp_enqueue_style('espresso_custom_css');
        }
        //Register the ThemeRoller styles
        if (!empty($org_options['themeroller']) && !is_admin()) {
            //Load the themeroller base style sheet
            //If the themeroller-base.css is in the uploads folder, then we will use it instead of the one in the core
            if (file_exists(EVENT_ESPRESSO_UPLOAD_DIR . $themeroller_style_path . 'themeroller-base.css')) {
                wp_register_style('espresso_themeroller_base', $themeroller_style_path . 'themeroller-base.css');
            } else {
                wp_register_style('espresso_themeroller_base', EVENT_ESPRESSO_PLUGINFULLURL . 'templates/css/themeroller/themeroller-base.css');
            }
            wp_enqueue_style('espresso_themeroller_base');
            //Load the smoothness style by default<br />
            if (!isset($org_options['themeroller']['themeroller_style']) || empty($org_options['themeroller']['themeroller_style']) || $org_options['themeroller']['themeroller_style'] == 'N') {
                $org_options['themeroller']['themeroller_style'] = 'smoothness';
            }
            //Load the selected themeroller style
            wp_register_style('espresso_themeroller', $themeroller_style_path . $org_options['themeroller']['themeroller_style'] . '/style.css');
            wp_enqueue_style('espresso_themeroller');
        }
    }
    // load some styles
    wp_enqueue_style('my_events_table', EVNT_MBR_PLUGINFULLURL . 'styles/my_events_table.css');
    $error = false;
    $updated = false;
    // TODO add a front-end login form for logged-out users
    /* If profile was saved, update profile. */
    if ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST['action'] == 'update-user' && is_user_logged_in()) {
        /* Update user password. */
        if (!empty($_POST['pass1']) && !empty($_POST['pass2'])) {
            if ($_POST['pass1'] == $_POST['pass2']) {
                wp_update_user(array('ID' => $current_user->ID, 'user_pass' => sanitize_text_field($_POST['pass1'])));
            } else {
                $error = __('The passwords you entered do not match.  Your password was not updated.', 'event_espresso');
            }
        }
        /* Update user information. */
        if (!empty($_POST['url'])) {
            if (strpos($_POST['url'], 'ttp://')) {
                $url_is_valid = true;
            } else {
                $url_is_valid = false;
            }
            if ($url_is_valid) {
                wp_update_user(array('ID' => $current_user->ID, 'user_url' => esc_url($_POST['url'])));
            } else {
                $error = __('The URL you entered does not appear to be valid. Please enter a valid URL.', 'event_espresso');
            }
        }
        if (!empty($_POST['email'])) {
            wp_update_user(array('ID' => $current_user->ID, 'user_email' => sanitize_email($_POST['email'])));
        }
        if (!empty($_POST['first-name'])) {
            update_user_meta($current_user->ID, 'first_name', esc_attr($_POST['first-name']));
        }
        if (!empty($_POST['last-name'])) {
            update_user_meta($current_user->ID, 'last_name', esc_attr($_POST['last-name']));
        }
        if (!empty($_POST['description'])) {
            update_usermeta($current_user->ID, 'description', esc_attr($_POST['description']));
        }
        if (!empty($_POST['event_espresso_address'])) {
            update_user_meta($current_user->ID, 'event_espresso_address', esc_attr($_POST['event_espresso_address']));
        }
        if (!empty($_POST['event_espresso_address2'])) {
            update_user_meta($current_user->ID, 'event_espresso_address2', esc_attr($_POST['event_espresso_address2']));
        }
        if (!empty($_POST['event_espresso_city'])) {
            update_user_meta($current_user->ID, 'event_espresso_city', esc_attr($_POST['event_espresso_city']));
        }
        if (!empty($_POST['event_espresso_state'])) {
            update_user_meta($current_user->ID, 'event_espresso_state', esc_attr($_POST['event_espresso_state']));
        }
        if (!empty($_POST['event_espresso_zip'])) {
            update_user_meta($current_user->ID, 'event_espresso_zip', esc_attr($_POST['event_espresso_zip']));
        }
        if (!empty($_POST['event_espresso_country'])) {
            update_user_meta($current_user->ID, 'event_espresso_country', esc_attr($_POST['event_espresso_country']));
        }
        if (!empty($_POST['event_espresso_phone'])) {
            update_user_meta($current_user->ID, 'event_espresso_phone', esc_attr($_POST['event_espresso_phone']));
        }
        /* Redirect so the page will show updated info. */
        if (!$error) {
            $updated = true;
        }
    }
    if (!empty($org_options['style_settings']['enable_default_style']) && $org_options['style_settings']['enable_default_style'] == 'Y' || espresso_version() >= '3.2.P' && !empty($org_options['style_settings']['enable_default_style']) && $org_options['style_settings']['enable_default_style'] == true) {
        ?>
		<script type="text/javascript">
			$jaer = jQuery.noConflict();
			jQuery(document).ready(function($jaer) {
				$jaer('.warning').addClass('ui-state-highlight ui-corner-all');
				$jaer('.updated').addClass('ui-state-highlight ui-corner-all');
				$jaer('.error').addClass('ui-state-error ui-corner-all');
				$jaer('.notice').removeClass('error');
				$jaer('.notice').removeClass('updated');
				$jaer('.notice').removeClass('warning');
			});
		</script>
	<?php 
    }
    ?>
	<!-- here's the form -->
	<?php 
    if (!is_user_logged_in()) {
        ?>
		<div class="notice warning">
			<p><?php 
        _e('You must be logged in to edit your profile.', 'event_espresso');
        ?>
</p>
		</div><!-- .warning -->
		<?php 
        $args = array('redirect' => home_url());
        wp_login_form($args);
        ?>
	<?php 
    } else {
        ?>
		<?php 
        if ($updated == true) {
            ?>
 <div class="notice updated"><p><?php 
            _e('Your profile has been updated', 'event_espresso');
            ?>
</p></div> <?php 
        }
        ?>
		<?php 
        if ($error) {
            echo '<div class="notice error"><p>' . $error . '</p></div>';
        }
        ?>
			<form method="post" id="adduser" action="<?php 
        the_permalink();
        ?>
" class="edit-profile ui-widget event-display-boxes">
				<fieldset>
					<h3 class="ui-widget-header ui-corner-top"><?php 
        _e('Name', 'event_espresso');
        ?>
</h3>
					<div class="event-data-display ui-widget-content ui-corner-bottom">
						<p class="form-username">
							<label for="first-name"><?php 
        _e('First Name', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="first-name" type="text" id="first-name" value="<?php 
        the_author_meta('user_firstname', $current_user->ID);
        ?>
" />
						</p><!-- .form-username -->
						<p class="form-username">
							<label for="last-name"><?php 
        _e('Last Name', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="last-name" type="text" id="last-name" value="<?php 
        the_author_meta('user_lastname', $current_user->ID);
        ?>
" />
						</p><!-- .form-username -->
						<p class="form-email">
							<label for="email"><?php 
        _e('E-mail *', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="email" type="text" id="email" value="<?php 
        the_author_meta('user_email', $current_user->ID);
        ?>
" />
						</p><!-- .form-email -->
					</div>
				</fieldset>
				<fieldset>
					<h3 class="ui-widget-header ui-corner-top"><?php 
        _e('Contact Info', 'event_espresso');
        ?>
</h3>
					<div class="event-data-display ui-widget-content ui-corner-bottom">
						<p class="form-address">
							<label for="event_espresso_address"><?php 
        _e('Address', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="event_espresso_address" type="text" id="event_espresso_address" value="<?php 
        the_author_meta('event_espresso_address', $current_user->ID);
        ?>
" />
						</p>
						<p class="form-address2">
							<label for="event_espresso_address2"><?php 
        _e('Address 2', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="event_espresso_address2" type="text" id="event_espresso_address2" value="<?php 
        the_author_meta('event_espresso_address2', $current_user->ID);
        ?>
" />
						</p>
						<p class="form-city">
							<label for="event_espresso_city"><?php 
        _e('City', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="event_espresso_city" type="text" id="event_espresso_city" value="<?php 
        the_author_meta('event_espresso_city', $current_user->ID);
        ?>
" />
						</p>
						<p class="form-state">
							<label for="event_espresso_state"><?php 
        _e('State', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="event_espresso_state" type="text" id="event_espresso_state" value="<?php 
        the_author_meta('event_espresso_state', $current_user->ID);
        ?>
" />
						</p>
						<p class="form-zip">
							<label for="event_espresso_zip"><?php 
        _e('Postal Code', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="event_espresso_zip" type="text" id="event_espresso_zip" value="<?php 
        the_author_meta('event_espresso_zip', $current_user->ID);
        ?>
" />
	                        	</p>
						<p class="form-country">
							<label for="event_espresso_country"><?php 
        _e('Country', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="event_espresso_country" type="text" id="event_espresso_country" value="<?php 
        the_author_meta('event_espresso_country', $current_user->ID);
        ?>
" />
	                        	</p>
						<p class="form-phone">
							<label for="event_espresso_phone"><?php 
        _e('Phone', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="event_espresso_phone" type="text" id="event_espresso_phone" value="<?php 
        the_author_meta('event_espresso_phone', $current_user->ID);
        ?>
" />
	                        	</p>
						<p class="form-url">
							<label for="url"><?php 
        _e('Website', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="url" type="text" id="url" value="<?php 
        the_author_meta('user_url', $current_user->ID);
        ?>
" />
						</p><!-- .form-url -->
		            </div>
				</fieldset>
				<fieldset>
					<h3 class="ui-widget-header ui-corner-top"><?php 
        _e('Other Information', 'event_espresso');
        ?>
</h3>
					<div class="event-data-display ui-widget-content ui-corner-bottom">
						<p class="form-password">
							<label for="pass1"><?php 
        _e('Password *', 'event_espresso');
        ?>
 </label>
							<input class="text-input ui-input" name="pass1" type="password" id="pass1" />
						</p><!-- .form-password -->
						<p class="form-password">
							<label for="pass2"><?php 
        _e('Repeat Password *', 'event_espresso');
        ?>
</label>
							<input class="text-input ui-input" name="pass2" type="password" id="pass2" />
						</p><!-- .form-password -->
						<p class="form-textarea">
							<label for="description"><?php 
        _e('Biographical Information', 'event_espresso');
        ?>
</label>
							<textarea name="description" class="ui-input" id="description" rows="3" cols="50"><?php 
        the_author_meta('description', $current_user->ID);
        ?>
</textarea>
						</p><!-- .form-textarea -->
						<p class="form-submit">
							<input name="updateuser" type="submit" id="updateuser" class="submit button ui-button ui-button-big ui-priority-primary ui-state-default ui-state-hover ui-state-focus ui-corner-all" value="<?php 
        _e('Update', 'event_espresso');
        ?>
" />
							<?php 
        wp_nonce_field('update-user');
        ?>
							<input name="action" type="hidden" id="action" value="update-user" />
						</p><!-- .form-submit -->
					</div>
				</fieldset>
			</form><!-- #adduser -->
	<?php 
    }
}
コード例 #26
0
 /**
  * Detects if the current version indicated in the has existed in the list of
  * previously-installed versions of EE (espresso_db_update). Does NOT modify it (ie, no side-effect)
  *
  * @param array $espresso_db_update array from the wp option stored under the name 'espresso_db_update'.
  *                            If not supplied, fetches it from the options table.
  *                            Also, caches its result so later parts of the code can also know whether there's been an
  *                            update or not. This way we can add the current version to espresso_db_update,
  *                            but still know if this is a new install or not
  * @return int one of the constants on EE_System::req_type_
  */
 public function detect_req_type($espresso_db_update = NULL)
 {
     if ($this->_req_type === NULL) {
         $espresso_db_update = !empty($espresso_db_update) ? $espresso_db_update : $this->fix_espresso_db_upgrade_option();
         $this->_req_type = $this->detect_req_type_given_activation_history($espresso_db_update, 'ee_espresso_activation', espresso_version());
     }
     return $this->_req_type;
 }
コード例 #27
0
 /**
  *
  * @return string
  */
 function get_ee_version()
 {
     return espresso_version();
 }