public static function set_booking_dir($base) { if (defined('WPMU_PLUGIN_DIR') && file_exists(WPMU_PLUGIN_DIR . '/' . basename($base))) { self::$SP_booking_dir = trailingslashit(WPMU_PLUGIN_URL); } elseif (defined('WP_PLUGIN_DIR') && file_exists(WP_PLUGIN_DIR . '/staypressbooking/' . basename($base))) { self::$SP_booking_dir = trailingslashit(WP_PLUGIN_DIR . '/staypressbooking'); } else { self::$SP_booking_dir = trailingslashit(WP_PLUGIN_DIR . '/staypressbooking'); } }
function enqueue_page_headings() { // Only need these on the public side of the site if (is_admin()) { return; } // Check if we are actually being used anywhere if (is_active_widget(false, false, 'sp_availabiltycalendar')) { // we are an active widget so add in our styles and js wp_enqueue_style('bookingwidgetcss', SPBCommon::booking_url('css/booking.calendarwidget.css'), array()); } }
function check_for_shortcodes($posts) { foreach ((array) $posts as $post) { if (strpos($post->post_content, '[availabilitycalendar') !== false) { if (!current_theme_supports('staypress_booking_style')) { // We have a calendar shortcode in here wp_enqueue_style('bookingwidgetcss', SPBCommon::booking_url('css/booking.calendarwidget.css'), array()); //wp_enqueue_script('googlemaps', "http://maps.google.com/maps/api/js?sensor=true", array(), $this->build, true); //wp_enqueue_script('propertymapshortcode', SPPCommon::property_url('js/property.mapshortcode.js'), array('googlemaps', 'jquery'), $this->build, true); } } } return $posts; }
function update_tables_from($installed_build = false) { include_once SPBCommon::booking_dir('includes/upgrade.php'); sp_upgradebooking($installed_build); }
function show_options_panel() { global $action, $page; $defaultoptions = array('checkintext' => 'Check in', 'checkouttext' => 'Check out'); $bookingoptions = SPBCommon::get_option('sp_booking_options', $defaultoptions); $messages = array(); $messages[1] = __('Your options have been updated.', 'membership'); echo "<div class='wrap nosubsub'>"; echo "<div class='innerwrap'>\n"; echo "<h2><a href='' class='selected'>" . __('Edit Options', 'property') . "</a></h2>"; echo "<div class='wrapcontents'>\n"; if (isset($_GET['msg'])) { echo '<div id="upmessage" class="updatedmessage"><p>' . $messages[(int) $_GET['msg']]; echo '<a href="#close" id="closemessage">' . __('close', 'property') . '</a>'; echo '</p></div>'; $_SERVER['REQUEST_URI'] = remove_query_arg(array('msg'), $_SERVER['REQUEST_URI']); } echo "<form action='" . admin_url("admin.php?page=" . $page) . "' method='post'>"; echo "<input type='hidden' name='action' value='updateoptions' />"; wp_nonce_field('update-booking-options'); echo "<p>"; echo __('The options below control the settings, text and urls of your StayPress installation. For multi-site installs, these may change the settings for <strong>all</strong> your sites, depending on your configuration.', 'booking'); echo "</p>"; echo "<h3>" . __('Search form labels', 'booking') . "</h3>"; echo "<p>" . __('Use the settings options below to change the labels on the main search forms.', 'booking') . "</p>"; echo "<table class='form-table'>"; echo "<tbody>"; echo "<tr valign='top'>"; // Un translated for now echo "<th scope='row'>" . __('Check in label', 'booking') . "</th>"; echo "<td>"; echo "<input type='text' name='checkintext' value='" . esc_attr($bookingoptions['checkintext']) . "' class='narrow' />"; echo "</td>"; echo "</tr>"; echo "<tr valign='top'>"; // Un translated for now echo "<th scope='row'>" . __('Check out label', 'booking') . "</th>"; echo "<td>"; echo "<input type='text' name='checkouttext' value='" . esc_attr($bookingoptions['checkouttext']) . "' class='narrow' />"; echo "</td>"; echo "</tr>"; echo "</tbody>"; echo "</table>"; do_action('staypress_booking_options_form', $bookingoptions); echo "<br style='clear:both;' />"; echo "<p class='submit'>"; echo "<input type='submit' name='Submit' class='button-primary' value='" . esc_attr('Update Options') . "' />"; echo "</p>"; echo "</form>\n"; echo "</div> <!-- wrapcontents -->\n"; echo "</div> <!-- innerwrap -->\n"; // Start sidebar here echo "<div class='rightwrap'>"; $this->show_options_rightpanel(); echo "</div> <!-- rightwrap -->"; echo "</div> <!-- wrap -->\n"; }
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ //define('SP_ONMS', true); require_once 'includes/config.php'; require_once 'classes/common.php'; // Set up my location SPBCommon::set_booking_url(__FILE__); SPBCommon::set_booking_dir(__FILE__); if (is_admin()) { require_once 'classes/model.php'; require_once 'classes/queue.php'; require_once 'classes/administration.php'; // Adminstration interface $sp_bookingadmin = new sp_bookingadmin(); } else { require_once 'classes/model.php'; require_once 'classes/public.php'; // Public interface $sp_booking = new sp_booking(); } // Load secondary plugins SPBCommon::load_booking_addons();