Skip to content

Commit

Permalink
Fix formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenharris committed Nov 2, 2016
1 parent 34d41d1 commit 0020c64
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 79 deletions.
28 changes: 14 additions & 14 deletions classes/class-eo-event-list-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Class used to create the event list widget
*/
class EO_Event_List_Widget extends WP_Widget{
class EO_Event_List_Widget extends WP_Widget {

/*
* Array of default settings
Expand Down Expand Up @@ -102,18 +102,18 @@ function form( $instance ) {
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'eventorganiser' ); ?>: </label>
<input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
<label for="<?php echo $this->get_field_id( 'numberposts' ); ?>"><?php _e( 'Number of events', 'eventorganiser' );?>: </label>
<p>
<label for="<?php echo $this->get_field_id( 'numberposts' ); ?>"><?php _e( 'Number of events', 'eventorganiser' );?>: </label>
<input id="<?php echo $this->get_field_id( 'numberposts' ); ?>" name="<?php echo $this->get_field_name( 'numberposts' ); ?>" type="number" size="3" value="<?php echo intval( $instance['numberposts'] );?>" />
</p>
<p>
<label for="<?php echo $this->get_field_id( 'event-category' ); ?>"><?php _e( 'Event categories', 'eventorganiser' ); ?>: </label>
<p>
<label for="<?php echo $this->get_field_id( 'event-category' ); ?>"><?php _e( 'Event categories', 'eventorganiser' ); ?>: </label>
<input id="<?php echo $this->get_field_id( 'event-category' ); ?>" class="widefat" name="<?php echo $this->get_field_name( 'event-category' ); ?>" type="text" value="<?php echo esc_attr( $instance['event-category'] );?>" />
<em><?php _e( 'List category slug(s), seperate by comma. Leave blank for all', 'eventorganiser' ); ?></em>
<em><?php _e( 'List category slug(s), seperate by comma. Leave blank for all', 'eventorganiser' ); ?></em>
</p>
<?php
if ( taxonomy_exists( 'event-venue' ) ) { ?>
<p>
<p>
<label for="<?php echo $this->get_field_id( 'venue' ); ?>"><?php _e( 'Venue:', 'eventorganiser' ); ?></label>
<?php $venues = get_terms( 'event-venue', array( 'hide_empty' => false ) );?>
<select id="<?php echo $this->get_field_id( 'venue' ); ?>" name="<?php echo $this->get_field_name( 'venue' ); ?>" type="text">
Expand All @@ -125,7 +125,7 @@ function form( $instance ) {
</p>
<?php } ?>
<p>
<label for="<?php echo $this->get_field_id( 'scope' ); ?>"><?php _e( 'Show:', 'eventorganiser' ); ?></label>
<label for="<?php echo $this->get_field_id( 'scope' ); ?>"><?php _e( 'Show:', 'eventorganiser' ); ?></label>
<select id="<?php echo $this->get_field_id( 'scope' ); ?>" name="<?php echo $this->get_field_name( 'scope' ); ?>" >
<?php
foreach ( $this->get_event_intervals() as $scope_id => $scope ) {
Expand All @@ -141,7 +141,7 @@ function form( $instance ) {
</p>

<p>
<label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Order by', 'eventorganiser' ); ?></label>
<label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Order by', 'eventorganiser' ); ?></label>
<select id="<?php echo $this->get_field_id( 'orderby' ); ?>" name="<?php echo $this->get_field_name( 'orderby' ); ?>">
<option value="eventstart" <?php selected( $instance['orderby'], 'eventstart' ); ?>><?php _e( 'Start date', 'eventorganiser' ); ?></option>
<option value="title" <?php selected( $instance['orderby'], 'title' );?>><?php _e( 'Title', 'eventorganiser' ); ?></option>
Expand Down Expand Up @@ -172,12 +172,12 @@ function form( $instance ) {
?>
</label>
<input id="<?php echo esc_attr( $this->get_field_id( 'template' ) ); ?>" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'template' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['template'] );?>" />
</p>
<p>
<label for="<?php echo $this->get_field_id( 'no_events' ); ?>"><?php _e( "'No events' message", 'eventorganiser' ); ?> </label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'no_events' ); ?>"><?php _e( "'No events' message", 'eventorganiser' ); ?> </label>
<input id="<?php echo $this->get_field_id( 'no_events' ); ?>" class="widefat" name="<?php echo $this->get_field_name( 'no_events' ); ?>" type="text" value="<?php echo esc_attr( $instance['no_events'] );?>" />
</p>
</p>
<?php
}

Expand Down
22 changes: 11 additions & 11 deletions classes/class-eventorganiser-admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @ignore
*/
class EventOrganiser_Admin_Page{
class EventOrganiser_Admin_Page {

var $hook;
var $title;
Expand All @@ -12,11 +12,11 @@ class EventOrganiser_Admin_Page{
var $page;

function __construct() {
add_action('init', array($this,'set_constants'));
add_action('init', array($this,'hooks_init'));
add_action( 'init', array( $this, 'set_constants' ) );
add_action( 'init', array( $this, 'hooks_init' ) );
}
function hooks_init(){

function hooks_init() {
add_action( 'admin_menu', array( $this, 'add_page' ) );
}

Expand All @@ -39,13 +39,13 @@ function page_scripts() {
* Actions to be taken prior to page loading. This is after headers have been set.
* @uses load-$hook
*/
function page_actions(){
function page_actions() {
}

function page_styles(){
function page_styles() {
}

function current_action(){
function current_action() {

$request = array_merge( $_GET, $_POST );

Expand All @@ -60,13 +60,13 @@ function current_action(){
return false;
}

function init(){
function init() {
}

function render_page(){
function render_page() {
$this->init();
$this->display();
}
function display(){
function display() {
}
}
46 changes: 23 additions & 23 deletions event-organiser-debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
/**
* @ignore
*/
class EventOrganiser_Debug_Page extends EventOrganiser_Admin_Page
{
class EventOrganiser_Debug_Page extends EventOrganiser_Admin_Page {

function set_constants() {
$this->hook = 'edit.php?post_type=event';
$this->title = __( 'System Info', 'eventorganiser' );
Expand Down Expand Up @@ -53,15 +53,15 @@ function page_actions() {
function display() {
?>
<div class="wrap">

<h2><?php esc_html_e( 'System Info','eventorganiser' );?> </h2>

<?php $eo_debugger = $this->debugger; ?>

<p>
<?php
printf(
esc_html__( "This page highlights useful information for debugging. If you're reporting a bug, please include this information. The 'system info' link in under the Events admin tab is only visible to admins and only when %s is set to %s.", 'eventorganiser' ),
esc_html__( 'This page highlights useful information for debugging. If you\'re reporting a bug, please include this information. The \'system info\' link in under the Events admin tab is only visible to admins and only when %1$s is set to %1$s.', 'eventorganiser' ),
'<code>WP_DEBUG</code>',
'<code>true</code>'
);
Expand All @@ -72,15 +72,15 @@ function display() {
esc_html_e( 'Most bugs arise from theme or plug-in conflicts. You can check this by disabling all other plug-ins and switching to TwentyTweleve. To help speed things along, if you report a bug please indicate if you have done so. Once the plug-in or theme has been identified it is often easy to resolve the issue. Below any <strong>known</strong> plug-in and theme conflicts are highlighted in red.', 'eventorganiser' );
?>
</p>

<?php
printf(
'<p><a href="%s" data-eo-debug="downloadurl" class="button secondary">%s</a></p>',
esc_url( add_query_arg( 'eo-download-debug-file', wp_create_nonce( 'eo-download-debug-file' ) ) ),
esc_html__( 'Download system information file', 'eventorganiser' )
);
?>

<table class="widefat">
<tr>
<th> Site url </th>
Expand All @@ -94,7 +94,7 @@ function display() {
<th> Multisite </th>
<td><?php echo is_multisite() ? 'Yes' : 'No' ?></td>
</tr>

<tr>
<th> Permalink </th>
<td>
Expand All @@ -111,7 +111,7 @@ function display() {
<?php $eo_debugger->verbose_prequiste_check( 'WordPress', get_bloginfo( 'version' ) );?>
</td>
</tr>

<tr>
<th> jQuery Version </th>
<td>
Expand All @@ -120,7 +120,7 @@ function display() {
</tr>
<script>
jQuery(document).ready( function($) {
var eventorganiser = eventorganiser || {};
var eventorganiser = eventorganiser || {};
eventorganiser.add_query_arg = function( key, value, uri ) {
var re = new RegExp("([?|&])" + key + "=.*?(&|$)", "i");
separator = uri.indexOf('?') !== -1 ? "&" : "?";
Expand All @@ -130,44 +130,44 @@ function display() {
return uri + separator + key + "=" + value;
}
}

$('[data-eo-debug="jqueryversion"]').each(function() {

var version = $().jquery;
$(this).text( version);

$('[data-eo-debug="downloadurl"]').each(function(){
var new_url = eventorganiser.add_query_arg( 'data[jqueryv]', version, $(this).attr('href') );
$(this).attr('href',new_url);
});
});
});
});
</script>

<tr>
<th> PHP Version </th>
<td> <?php echo esc_html( PHP_VERSION ); ?></td>
</tr>
<tr>
<th> MySQL Version </th>
<td>
<td>
<?php
global $wpdb;
echo empty( $wpdb->use_mysqli ) ? esc_html( mysql_get_server_info() ) : esc_html( mysqli_get_server_info( $wpdb->dbh ) );
?></td>
</tr>
</tr>
<tr>
<th> Web Server </th>
<td> <?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td>
</tr>
</tr>
<tr>
<th> PHP Memory Usage </th>
<th><?php echo $eo_debugger->verbose_memory_check(); ?>
</tr>
</tr>
<tr>
<th> PHP Post Max Size </th>
<td><?php echo esc_html( ini_get( 'post_max_size' ) ); ?></td>
</tr>
</tr>
<tr>
<th> PHP Upload Max Size </th>
<td><?php echo esc_html( ini_get( 'upload_max_filesize' ) ); ?></td>
Expand Down Expand Up @@ -254,7 +254,7 @@ function display() {
);
?>
</div><!--End .wrap -->
<?php
<?php
}
}
$venues_page = new EventOrganiser_Debug_Page();
Expand Down Expand Up @@ -421,7 +421,7 @@ function verbose_prequiste_check( $requirement, $v ) {
esc_html( $v ),
esc_html( sprintf(
/// TRANSLATORS: [this plugin] has only been tested up to [required plugin] [required plugin version]
__( '%s has only been tested up to %s %s', 'eventorganiser' ),
__( '%1$s has only been tested up to %1$s %1$s', 'eventorganiser' ),
$this->plugin,
$requirement,
$versions['max']
Expand All @@ -434,7 +434,7 @@ function verbose_prequiste_check( $requirement, $v ) {
esc_html( $v ),
esc_html( sprintf(
/// TRANSLATORS: [this plugin] requires [required plugin] version [required plugin version] or higher
__( '%s requires %s version %s or higher', 'eventorganiser' ),
__( '%1$s requires %1$s version %1$s or higher', 'eventorganiser' ),
$this->plugin,
$requirement,
$versions['min']
Expand Down
Loading

0 comments on commit 0020c64

Please sign in to comment.