Sync plugins from current page

Signed-off-by: Adrian Nöthlich <git@promasu.tech>
This commit is contained in:
2019-09-11 19:08:46 +02:00
parent 85d41e4216
commit 8515ff9587
1847 changed files with 505469 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
<?php
/**
* Admin Add-ons
*
* @package
* @subpackage Admin/Add-ons
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Add-ons Page Init
*
* Hooks check feed to the page load action.
*
* @since 1.0
* @global $amre_add_ons_page Add-ons Pages
* @return void
*/
function amre_add_ons_init() {
global $amre_add_ons_page;
add_action( 'load-' . $amre_add_ons_page, 'amre_add_ons_check_feed' );
}
add_action( 'admin_menu', 'amre_add_ons_init');
/**
* Add-ons Page
*
* Renders the add-ons page content.
*
* @since 1.0
* @return void
*/
function amre_add_ons_page() {
$url = 'http://icalevents.com/plugins_downloads/'
.'?utm_source=plugin-addons-page'
.'&amp;utm_medium=plugin'
.'&amp;utm_campaign=amr-events-plugin%20addons%20page'
.'&amp;utm_content=All%20Addons';
?>
<div class="wrap" id="amru-add-ons">
<h2>
<?php _e( 'Add Ons for amr-events', 'amr-events' ); ?>
&nbsp;&mdash;&nbsp;<a href="<?php echo $url; ?>" class="button-primary" title="<?php _e( 'Browse All Add-ons', 'amr-events' ); ?>" target="_blank"><?php _e( 'Browse All Add-ons', 'amr-events' ); ?></a>
</h2>
<?php echo amre_add_ons_get_feed(); ?>
</div>
<?php
}
/**
* Add-ons Get Feed
*
* Gets the add-ons page feed.
*
* @since 1.0
* @return void
*/
function amre_add_ons_get_feed() {
$feed_url = 'http://icalevents.com/?feed=addons';
$transient_name = 'icalevents_add_ons_feed';
if ( false === ( $cache = get_transient( $transient_name ) ) ) {
$feed = wp_remote_get($feed_url);
//var_dump($feed);
if ( ! is_wp_error( $feed ) ) {
if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
$cache = wp_remote_retrieve_body( $feed );
set_transient( $transient_name, $cache, 1 );
}
} else {
$cache = '<div class="error"><p>' . __( 'There was an error retrieving the add-ons list from the server. Please try again later.', 'amr-events' ) . '</p></div>';
}
}
return $cache;
}

View File

@@ -0,0 +1,157 @@
<?php
/**
* License handler - simplifies the process of adding license information
* to new extensions.
* Each addon will use this
*
* @version 1.1
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! class_exists( 'amr_events_License' ) ) :
/**
* amr_events_License Class
*/
class amr_events_License {
private $file;
private $license;
private $item_name;
private $item_shortname;
private $version;
private $author;
private $api_url = 'http://icalevents.com';
/**
* Class constructor
*
* @global array $edd_options
* @param string $_file
* @param string $_item_name
* @param string $_version
* @param string $_author
* @param string $_optname
* @param string $_api_url
*/
function __construct( $_file, $_item_name, $_version, $_author, $_optname = null, $_api_url = null ) {
$this->file = $_file;
$this->item_name = $_item_name;
$this->item_shortname = //'amr_' .
preg_replace( '/[^a-zA-Z0-9-\s]/', '', str_replace( ' ', '-', strtolower( $this->item_name ) ) );
$this->version = $_version;
$this->license = get_option($this->item_shortname . '-license-key' ) ;
$this->status = get_option($this->item_shortname . '-license-status' ) ;
//$this->expiry = get_option $this->item_shortname . '-license-expiry' ] ) ;
$this->author = $_author;
$this->api_url = is_null( $_api_url ) ? $this->api_url : $_api_url;
// Setup hooks
$this->includes();
$this->hooks();
add_filter( 'amr_events_get_licenses', array($this, 'licenses' ) );
}
/**
* Include the updater class
*
* @access private
* @return void
*/
private function includes() {
if ( ! class_exists( 'amr_sl_plugin_updater' ) ) require_once 'plugin-updater.php';
}
/**
* Setup hooks
*
* @access private
* @return void
*/
private function hooks() {
// Register settings
//add_filter( 'amr_settings_licenses', array( $this, 'settings' ), 1 ); // adds licenses in NLR?
// Updater
add_action( 'admin_init', array( $this, 'auto_updater' ), 0 );
}
/**
* Auto updater
*
* @access private
* @global array $edd_options
* @return void
*/
public function auto_updater() {
// $valid = get_option( $this->item_shortname . '-license-status' );
// if ( 'valid' !== $valid )
// return;
// Setup the updater
$edd_updater = new amr_sl_plugin_updater(
$this->api_url,
$this->file,
array(
'version' => $this->version,
'license' => $this->license,
'item_name' => $this->item_name,
'author' => $this->author
)
);
}
/**
* Add license field to settings
*
* @access public
* @param array $settings
* @return array
*/
public function licenses( $licenses ) { // add to the list of licenses to check
$amr_events_Licenses[$this->item_shortname] = $this->item_name;
// NO ! messes up the license check.' '.$this->version;
//array(
// 'id' => $this->item_shortname . '-license-key',
// 'name' => sprintf( __( '%1$s license key', 'amr-events' ), $this->item_name ),
//'desc' => '',
//'type' => 'license_key',
//'options' => array( 'is_valid_license_option' => $this->item_shortname . '_licenseactive' ),
//'size' => 'regular'
//)
//);
return array_merge( $licenses, $amr_events_Licenses );
}
/**
* Activate the license key
*
* @access public
* @return void
*/
/**
* Deactivate the license key
*
* @access public
* @return void
*/
}
endif; // end class_exists check

View File

@@ -0,0 +1,326 @@
<?php
// uncomment this line for testing
//set_site_transient( 'update_plugins', null );
/**
* Allows plugins to use their own update API.
*
* @author Pippin Williamson
* @version 1.4
*/
class amr_sl_plugin_updater {
private $api_url = '';
private $api_data = array();
private $name = '';
private $slug = '';
private $did_check = false;
/**
* Class constructor.
*
* @uses plugin_basename()
* @uses hook()
*
* @param string $_api_url The URL pointing to the custom API endpoint.
* @param string $_plugin_file Path to the plugin file.
* @param array $_api_data Optional data to send with API calls.
* @return void
*/
function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
$this->api_url = trailingslashit( $_api_url );
$this->api_data = $_api_data;
$this->name = plugin_basename( $_plugin_file );
$this->slug = basename( $_plugin_file, '.php' );
$this->version = $_api_data['version'];
// Set up hooks.
//add_action( 'admin_init', array( $this, 'init' ) );
$this->init();
add_action( 'admin_init', array( $this, 'show_changelog' ) );
}
/**
* Set up WordPress filters to hook into WP's update process.
*
* @uses add_filter()
*
* @return void
*/
public function init() {
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
}
/**
* Check for Updates at the defined API endpoint and modify the update array.
*
* This function dives into the update API just when WordPress creates its update array,
* then adds a custom API call and injects the custom plugin data retrieved from the API.
* It is reassembled from parts of the native WordPress plugin update code.
* See wp-includes/update.php line 121 for the original wp_update_plugins() function.
*
* @uses api_request()
*
* @param array $_transient_data Update array build by WordPress.
* @return array Modified update array with custom plugin data.
*/
function check_update( $_transient_data ) {
global $pagenow;
// if ( $this->did_check ) {
// return $_transient_data;
// }
if( ! is_object( $_transient_data ) ) {
$_transient_data = new stdClass;
}
if( 'plugins.php' == $pagenow && is_multisite() ) {
return $_transient_data;
}
if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
$this->did_check = true;
if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
$_transient_data->response[ $this->name ] = $version_info;
}
$_transient_data->last_checked = time();
$_transient_data->checked[ $this->name ] = $this->version;
}
}
return $_transient_data;
}
/**
* show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
*
* @param string $file
* @param array $plugin
*/
public function show_update_notification( $file, $plugin ) {
if( ! current_user_can( 'update_plugins' ) ) {
return;
}
if( ! is_multisite() ) {
return;
}
if ( $this->name != $file ) {
return;
}
// Remove our filter on the site transient
remove_filter( 'pre_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
$update_cache = get_site_transient( 'update_plugins' );
if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
$update_cache->response[ $this->name ] = $version_info;
}
$update_cache->last_checked = time();
$update_cache->checked[ $this->name ] = $this->version;
set_site_transient( 'update_plugins', $update_cache );
}
// Restore our filter
add_filter( 'pre_site_transient_update_plugins', array( $this, 'check_update' ) );
if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
// build a plugin list row, with update notification
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
if ( empty( $version_info->download_link ) ) {
printf(
__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.' ),
esc_html( $version_info->name ),
esc_url( $changelog_link ),
esc_html( $version_info->new_version )
);
} else {
printf(
__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.' ),
esc_html( $version_info->name ),
esc_url( $changelog_link ),
esc_html( $version_info->new_version ),
esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
);
}
echo '</div></td></tr>';
}
}
/**
* Updates information on the "View version x.x details" page with custom data.
*
* @uses api_request()
*
* @param mixed $_data
* @param string $_action
* @param object $_args
* @return object $_data
*/
function plugins_api_filter( $_data, $_action = '', $_args = null ) {
if ( $_action != 'plugin_information' ) {
return $_data;
}
if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
return $_data;
}
$to_send = array(
'slug' => $this->slug,
'is_ssl' => is_ssl(),
'fields' => array(
'banners' => false, // These will be supported soon hopefully
'reviews' => false
)
);
$api_response = $this->api_request( 'plugin_information', $to_send );
if ( false !== $api_response ) {
$_data = $api_response;
}
return $_data;
}
/**
* Disable SSL verification in order to prevent download update failures
*
* @param array $args
* @param string $url
* @return object $array
*/
function http_request_args( $args, $url ) {
// If it is an https request and we are performing a package download, disable ssl verification
if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
$args['sslverify'] = false;
}
return $args;
}
/**
* Calls the API and, if successfull, returns the object delivered by the API.
*
* @uses get_bloginfo()
* @uses wp_remote_post()
* @uses is_wp_error()
*
* @param string $_action The requested action.
* @param array $_data Parameters for the API action.
* @return false||object
*/
private function api_request( $_action, $_data ) {
global $wp_version;
$data = array_merge( $this->api_data, $_data );
if ( $data['slug'] != $this->slug ) {
return;
}
if ( empty( $data['license'] ) ) {
return;
}
if( $this->api_url == home_url() ) {
return false; // Don't allow a plugin to ping itself
}
$api_params = array(
'edd_action' => 'get_version',
'license' => $data['license'],
'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
'slug' => $this->slug,
'author' => $data['author'],
'url' => home_url()
);
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
if ( ! is_wp_error( $request ) ) {
$request = json_decode( wp_remote_retrieve_body( $request ) );
}
if ( $request && isset( $request->sections ) ) {
$request->sections = maybe_unserialize( $request->sections );
} else {
$request = false;
}
return $request;
}
public function show_changelog() {
if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
return;
}
if( empty( $_REQUEST['plugin'] ) ) {
return;
}
if( empty( $_REQUEST['slug'] ) ) {
return;
}
if( ! current_user_can( 'update_plugins' ) ) {
wp_die( __( 'You do not have permission to install plugin updates' ) );
}
$response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
if( $response && isset( $response->sections['changelog'] ) ) {
echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
}
exit;
}
}

View File

@@ -0,0 +1,464 @@
<?php
/* Description: license page to manage update check licenses.
Licenses will be added by other (add-on or related) plugins via filters and call to license object */
define ('AMR_EVENTS_STORE_URL','https://icalevents.com/plugins_downloads/');
function amr_events_get_licenses() {
$licenses = get_option( 'amr_events_Licenses' );
if ( empty( $licenses ) ) $licenses = array(); //we have no licenses saved
return apply_filters( 'amr_events_get_licenses', $licenses ); // in case new plugins where license not saved yet
}
function amr_events_change_license( $l, $new ) {
$old = get_option( $l.'-license-key' );
$done = true;
if ( isset($old) and ($old !== $new )) {
delete_option( $l.'-license-status' ); // new license has been entered, so must reactivate
$done = update_option( $l.'-license-key', $new );
if ($done) {
amr_confirm_message(sprintf(__('%s -license-key updated','amr-events'),$l));
}
else amr_flag_error ('Error updating '.$l.'-license-key');
}
return $done;
}
function amr_events_save_licenses($licenses) { // security check already done, save in DB if changed
foreach ($licenses as $l => $n) {
$license = '';
if (isset($_POST['key']) and is_array($_POST['key']) ) {
if (!empty($_POST['key'][$l])) {
$license = sanitize_key($_POST['key'][$l]);
}
}
amr_events_change_license($l, $license); // delete when empty
}
//else amr_flag_error ('Error processing license key updates','amr-events');
}
function amr_events_activate_licenses($licenses) {
if ( ! isset( $_POST['activate'] ) and !is_array($_POST['activate']) ) {
return;
}
foreach( $_POST['activate'] as $l => $activate ) { // will only do one at a time really
if (empty($_POST['key']) or (empty($_POST['key'][$l]))) {
amr_flag_error(sprintf(__('No license key entered for %s', 'amr-events'), $l));
continue; // we havent got this key
}
$license_key = sanitize_text_field( $_POST['key'][$l] );
// Data to send to the API
$api_params = array(
'edd_action' => 'activate_license',
'license' => $license_key,
'item_name' => urlencode( $licenses[$l] ),
'url' => home_url()
);
// Call the API
$response = wp_remote_post(
AMR_EVENTS_STORE_URL,
array(
'timeout' => 15,
'sslverify' => false,
'body' => $api_params
)
);
// Make sure there are no errors
if ( is_wp_error( $response ) or empty($response['body']) ) {
amr_flag_error(__('Error activating', 'amr-events'));
echo '<pre>';print_r($response['response']);
print_r($response['body']); echo '</pre>';
return;
}
// Decode license data
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
if (!empty($license_data->success) and $license_data->success) {
update_option( $l . '-license-status', $license_data->license );
// Tell WordPress to look for updates
set_site_transient( 'update_plugins', null );
amr_confirm_message(sprintf(__('%s auto updates activated','amr-events'),$l));
}
else {
amr_flag_error(__('Error activating with that license key', 'amr-events')
.' '.print_r($response['body'], true ));
}
}
}
function amr_events_deactivate_license($licenses) {
if ( ! isset( $_POST['deactivate'] ) and !is_array($_POST['deactivate']) ) {
return;
}
foreach( $_POST['deactivate'] as $l => $activate ) { // will only do one at a time really
if (empty($_POST['key'])) continue; // we got no keys
if (empty($_POST['key'][$l])) continue; // we havent got this key
$license_key = sanitize_text_field( $_POST['key'][$l] );
// Data to send to the API
$api_params = array(
'edd_action' => 'deactivate_license',
'license' => $license_key,
'item_name' => urlencode( $licenses[$l] ),
'url' => home_url()
);
// Call the API
$response = wp_remote_post(
AMR_EVENTS_STORE_URL,
array(
'timeout' => 15,
'sslverify' => false,
'body' => $api_params
)
);
if ( is_wp_error( $response ) or empty($response['body']) ) {
amr_flag_error(__('Error deactivating', 'amr-events'));
echo '<pre>';print_r($response['response']);
print_r($response['body']); echo '</pre>';
return;
}
// Decode license data
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
if (!empty($license_data->license) and ($license_data->license=='deactivated')) {
delete_option( $l . '-license-status', $license_data->license );
amr_confirm_message(sprintf(__('%s auto updates deactivated','amr-events'),$l));
}
else {
amr_flag_error(__('License expired or error deactivating with that license key', 'amr-events').' '
.print_r($response['body'], true ));
//license probably expired
delete_option( $l . '-license-status', $license_data->license );
}
}
}
function amr_events_get_plugin_version($id) {
$license = trim( get_option( $id.'-license-key' ) );
$api_params = array(
'edd_action' => 'get_version',
'license' => $license,
'item_name' => urlencode( $id ),
'url' => home_url()
);
// Call the custom API.
$response = wp_remote_get(
add_query_arg( $api_params, AMR_EVENTS_STORE_URL ), // we specified this url so not coming from external sources - no esc_url_raw needed
array( 'timeout' => 15, 'sslverify' => false ) );
if ( is_wp_error( $response ) )
return false;
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
return $license_data;
}
function amr_events_show_version ($version_data) {
?><table class="form-table"><caption><?php
if (!empty($version_data->msg)) {
echo $version_data->msg;
?></caption><?php
}?>
<tbody><tr><th><?php
_e('Latest Version','amr-events' ) ;
?></th><td><?php
if (!empty($version_data->new_version)) {
?><a href=" <?php
echo $version_data->homepage; ?>" title="<?php _e('Plugin details','amr-events'); ?> ">
<?php
echo $version_data->new_version; ?>
</a><?php
if (!empty($version_data->download_link)) {
?>&nbsp;<a href=" <?php
echo $version_data->download_link; ?>"
title="<?php _e('Or wait for wordpress to pick it up in the plugin update check','amr-events'); ?> ">
<?php _e('Download','amr-events'); ?></a>
<?php
}
}
else {
_e('Version information not available for this license key and this site.','amr-events' );
_e('Verify at:','amr-events' );
?> <a href="<?php echo AMR_EVENTS_STORE_URL;?>"><?php echo AMR_EVENTS_STORE_URL;?></a>
<?php
} ?>
</td></tr></tbody></table><?php
/*
public 'new_version' => string '2.12' (length=4)
public 'name' => string 'amr users plus' (length=14)
public 'slug' => boolean false
public 'url' => string 'http://wpusersplugin.com/downloads/amr-events/?changelog=1' (length=62)
public 'homepage' => string 'http://wpusersplugin.com/downloads/amr-events/' (length=50)
public 'package' => string 'http://wpusersplugin.com/?edd_action=package_download&id=4213&key=001fe02f8ba95e799d29efedf9e80885&expires=MTQxMzg3Nzg1Nw%3D%3D' (length=127)
public 'download_link' => string 'http://wpusersplugin.com/?edd_action=package_download&id=4213&key=001fe02f8ba95e799d29efedf9e80885&expires=MTQxMzg3Nzg1Nw%3D%3D' (length=127)
public 'sections'
*/
//var_dump($version_data);
}
function amr_events_get_license_data($l) {
global $wp_version;
$license = trim( get_option( $l.'-license-key' ) );
$api_params = array(
'edd_action'=> 'check_license',
'license' => $license,
'item_name' => urlencode( $l ),
'url' => home_url()
);
// Call the custom API.
$response = wp_remote_get(
add_query_arg( $api_params,
AMR_EVENTS_STORE_URL ),
array( 'timeout' => 15,
'sslverify' => false )
);
if ( is_wp_error( $response ) )
return false;
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
if ($license_data->license == 'site_inactive') { // deactivated remotely at host site?
delete_option( $l . '-license-status', $license_data->license );
amr_flag_error(sprintf(__('%s at this site is inactive at remote host', 'amr-events'), $license_data->item_name));
}
return $license_data;
}
function amr_events_show_license($license_data) {
/*
'license_limit' =>__('Maximum sites for license','amr-events'),
'site_count' =>__('Sites using license key','amr-events'),
'activations_left' =>__('Activations left','amr-events')
*/
if (!empty($license_data->site_count))
$license_data->sites_limit = $license_data->site_count;
if (!empty($license_data->license_limit))
$license_data->sites_limit .= ' / '.$license_data->license_limit;
unset ($license_data->license_limit);
unset ($license_data->site_count);
unset ($license_data->activations_left);
$license_fields = array (
'license' =>__('Remote Status','amr-events'),
'sites_limit' =>__('Sites / Limit','amr-events'),
//'item_name' =>__('Item name','amr-events'),
'expires' =>__('Expiry Date','amr-events'),
//'payment_id' =>__('Payment id','amr-events'),
//'customer_name' =>__('Customer Name','amr-events'),
'customer_email' =>__('Customer Email','amr-events'),
);
if (!empty($license_data)) {
?><table class="widefat"><tr><?php
foreach ($license_fields as $fld => $fldtitle) {
echo '<th>'.$fldtitle.'</th>';
}
?></tr><tr><?php
foreach ($license_fields as $fld => $fldtitle) {
?><td><?php
if (!empty($license_data->$fld)) {
if (($fld == 'expires') and ($license_data->$fld == '1970-01-01 00:00:00'))
echo '';
else
echo $license_data->$fld;
}
else echo '&nbsp;';
?></td><?php
}
?></tr>
</table><?php
}
else {
echo '<p class="error"><strong>Error Fetching License Status. Try logging on to '.AMR_EVENTS_STORE_URL.'</strong></p>';
return false;
}
}
function amr_events_handle_license_data_request ($licenses) { // will normally only be one
foreach ($licenses as $l => $license_name) {
if (!empty($_POST['get_license_data'][$l])) {
$license_data = amr_events_get_license_data($l);
amr_events_show_license($license_data);
}
}
}
function amr_events_get_status_text($status) {
if (empty($status)) {
$status_text= '<span style="color:red;">'.
__('Plugin updates not activated','amr-events')
.'</span>';
}
elseif ( $status == 'valid' ) {
$status_text = '<span style="color:green;">'.
__('Activated','amr-events')
.'</span>';
}
else {
'<span style="color:red;">'.
$status_text =__('Deactivated','amr-events')
.'</span>';
}
return ($status_text);
}
function amr_events_license_page() {
if (!current_user_can('manage_options')) return;
$licenses = amr_events_get_licenses(); // ones we already have saved and new ones from plugins just activated.
// check if we should be doing any form processing and was the post from this page
if ( isset( $_POST['submit'] ) or
!empty($_POST['activate'] ) or
!empty($_POST['deactivate'] ) or
!empty($_POST['get_license_data'] ) or
!empty($_POST['get_plugin_version'] )
) {
check_admin_referer('amr_events_nonce','amr_events_nonce');
if ( isset( $_POST['submit'] ) or !empty($_POST['activate']) )
amr_events_save_licenses($licenses);
if (!empty($_POST['activate'])) {
amr_events_activate_licenses($licenses);
}
elseif (!empty($_POST['deactivate'])) {
amr_events_deactivate_license($licenses);
}
elseif (!empty($_POST['get_license_data']) and is_array($_POST['get_license_data'])) {
//amr_events_handle_license_data_request($licenses);
}
elseif (!empty($_POST['get_plugin_version'])) {
//amr_events_get_plugin_version($id);
}
}
$key=array();
foreach ($licenses as $license_short_name => $license_name) {
$key[$license_short_name] = get_option( $license_short_name.'-license-key' ); // array (plugin -> array (licensekey, status, url?)
$status [$license_short_name] = get_option( $license_short_name.'-license-status' );
$status_text[$license_short_name] = amr_events_get_status_text($status[$license_short_name]);
}
$base = get_permalink();
?>
<div class="wrap">
<h2><?php _e('add on plugin updates','amr-events'); ?></h2>
<?php if (empty ($licenses)) { ?>
<p><?php _e('Either you have no add-ons active or the versions you have cannot yet check for updates.','amr-events');
?></p><p><?php
printf(__('Please check manually for updates at %s.','amr-events'),
'<a title="'.__('See plugins','amr-events').'" href="'.AMR_EVENTS_STORE_URL.'">'.AMR_EVENTS_STORE_URL.'</a>'); ?></p>
<?php }
else {?>
<p><?php printf(__('Enter your license keys to activate automatic plugin updates from %s','amr-events'),
'<a title="'.__('See plugins','amr-events').'" href="'.AMR_EVENTS_STORE_URL.'">'.AMR_EVENTS_STORE_URL.'</a>'); ?></p>
<form method="post" action="<?php echo $base; ?>">
<?php
wp_nonce_field( 'amr_events_nonce', 'amr_events_nonce' );?>
<table class="widefat">
<tbody><tr>
<th><?php _e('Plugin name','amr-events'); ?>
</th>
<th><?php _e('License key','amr-events'); ?>
</th>
</tr>
<?php
foreach ($licenses as $l => $license_name) {
?>
<tr>
<td><b style="font-size: larger; valign:bottom;"><?php echo $license_name; ?></b>
</td>
<td>
<input id="<?php echo $key[$l]; ?>" name="key[<?php echo $l; ?>]" type="text" class="regular-text" value="<?php esc_attr_e( $key[$l] ); ?>" />
</td>
</tr>
<tr>
<td valign="top">
<?php
if (!empty($_POST['get_license_data'] )) { //needs changing
if (is_array($_POST['get_license_data']) and (!empty ($_POST['get_license_data'][$l]))) {
$license_data = amr_events_get_license_data($l);
amr_events_show_license( $license_data );
}
}
elseif (!empty($_POST['get_plugin_version'] )) {
if (is_array($_POST['get_plugin_version']) and (!empty ($_POST['get_plugin_version'][$l]))) {
$version_data = amr_events_get_plugin_version($l);
amr_events_show_version( $version_data );
}
}
else echo ($status_text[$l]); ?>
</td>
<td>
<?php
if ( !empty( $key[$l] ) and ( $status[$l] !== false && $status[$l] == 'valid' )) { ?>
<input type="submit" class="button-secondary" name="deactivate[<?php echo $l; ?>]" value="<?php _e('Deactivate','amr-events'); ?>"
title="<?php _e('Deactivate this site from automatic plugin update checking.','amr-events'); ?>" />
<?php }
else { ?>
<input type="submit" class="button-primary" name="activate[<?php echo $l; ?>]" value="<?php _e('Activate','amr-events'); ?>"
title="<?php _e('Activate automatic plugin update checking with valid license key.','amr-events'); ?>" />
<?php }
?>
&nbsp;
<input type="submit" class="button-secondary" name="get_license_data[<?php echo $l; ?>]" value="<?php _e('Check License','amr-events'); ?>"
title="<?php _e('Check updates license details on plugin hosting system.','amr-events'); ?>" />
&nbsp;
<input type="submit" class="button-secondary" name="get_plugin_version[<?php echo $l; ?>]" value="<?php _e('Latest Version','amr-events'); ?>"
title="<?php _e('Check for latest plugin version after entering your updates license key','amr-events'); ?>" />
<?php
//}
?>
</td>
</tr>
<?php }
?>
</tbody>
</table>
<?php submit_button( __('Save without activating','amr-events')); ?>
</form>
<?php }
}

View File

@@ -0,0 +1,53 @@
<?php /* amr-ical-custom-style-file example
For advanced users only who are very familiar with php, html and css
Copy this file to your uploads directory so that it will not be overwritten. Then tailor the html.
Tag examples that do not have closing '>' will have classes added to them and then closed - do not close them here.
If the tag is empty '', then no classes will be added (of course) asthat would break the html
* Think of the layout as events in rows with event properties in columns.
* Ensure that the settings in the listtype will work with the html.
* Note that you could add your own css tags by adding div's or spans to the before and after elements
* You may also need to check / change the css.
* the .AMR_NL's add new lines in the osurce for readability - the idea was to switch that off later for more compact code
*/
if ($where_am_i === 'in_events') {
$htm['ul'] = '';
$htm['ulc'] = '';
$htm['li'] = '<span '; // required for rich snippets, microformat
$htm['lic'] = '</span>';
/* allow for a class specifictaion */
$htm['row'] = '<article '; // each event
$htm['rowc'] = '</article>'.AMR_NL;
$htm['hcell'] ='<h2 '; // the 'column' header cell
$htm['hcellc'] ='</h2>';
$htm['cell'] ='';
$htm['cellc'] ='';
//
$htm['grow'] = '<header><h3 '; // the grouping html text for a group of events - not the surrounding selector
$htm['growc'] = '</h3></header>'.AMR_NL;
$htm['ghcell'] = '';
$htm['ghcellc'] = '';
//
$htm['head'] = '<h2 ';
$htm['headc'] = '</h2>';
$htm['foot'] = '<footer '; // this could have the pagination inside it if pagination is requested , and the "add new event link" when logged in
$htm['footc'] = '</footer>'.AMR_NL;
//
$htm['body'] = '<section '; // the grouping html text for a group of events - not the surrounding selector
$htm['bodyc'] = '</section>'.AMR_NL;
//
$htm['box'] = '<section'; // the whole calendar
$htm['boxc'] = '</section>'.AMR_NL;
}
else if ($where_am_i === 'in_calendar_properties') {
$htm['box'] = '<section'; // the whole bunch of properties
$htm['boxc'] = '</section>'.AMR_NL; ;
$r = '<header><h2'; // the row of properties
$rc = '</h2></header> ';
$d =''; // each cell or column of properties as specified by the listtype
$dc ='';
}
?>

View File

@@ -0,0 +1,89 @@
<?php
/*
Plugin Name: amr event lists with ical files
Author: anmari
Author URI: http://anmari.com/
Plugin URI: http://icalevents.com
Version: 5.7
Text Domain: amr-ical-events-list
Domain Path: /lang
Description: Display simple or highly customisable and styleable list of events. Handles all types of recurring events, notes, journals, freebusy etc. Offers links to add events to viewers calendar or subscribe to whole calendar. Create a page and put [iCal http://yoururl.ics ] where you want the list of events of an ics file and [events] to get internal events. To tweak: <a href="admin.php?page=manage_amr_ical">Manage Settings Page</a>, <a href="widgets.php">Manage Widget</a>.
/* Copyright 2009 AmR iCal Events List (email : anmari@anmari.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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 see <http://www.gnu.org/licenses/>.
for more details.
*/
// NB Change version in code too define('AMR_ICAL_LIST_VERSION', '3.0.1');
define('AMR_ICAL_LIST_VERSION', '5.7');
define('AMR_PHPVERSION_REQUIRED', '5.2.0');
/* these are globals that we do not want easily changed -others are in the config file */
define( 'AMR_BASENAME', plugin_basename( __FILE__ ) );
require_once('includes/amr-ical-groupings.php'); // must be before shortcode function
require_once('includes/amr-ical-config.php');
require_once('includes/amr-upcoming-events-widget.php');
require_once('includes/amr-ical-events-list-main.php');
require_once('includes/amr-import-ical.php');
require_once('includes/amr-rrule.php');
require_once('includes/amr_date_i18n.php');
require_once('includes/amr-ical-calendar.php');
require_once('includes/amr-ical-pretty-print.php');
require_once('includes/functions.php');
require_once('includes/amr-ical-plugin-form-html.php');
// require_once('includes/amr-ical-post-type.php');
if (is_admin() ) { // are we in admin territory
require_once('includes/amr-ical-list-admin.php');
require_once('includes/amr-ical-fields-admin.php');
include('admin/add-ons.php');
include('admin/updates-page.php');
include('admin/class-amr-license-handler.php');
}
/*----------------------------------------------------------------------------------------*/
function amr_ical_updates_menu($parent_slug) {
//$parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function
$amr_pluginpage['add-ons'] = add_submenu_page($parent_slug,
__('Add ons','amr-events'),
__('Add ons','amr-events'),
'manage_options',
'add-ons', 'amre_add_ons_page');
$page = add_submenu_page($parent_slug, // parent slug
'amr events add-on licensed updates' // page title
,'+ updates' // menu title
,'manage_options' //capability required
,'amr_events_updates_page' // menu slug
,'amr_events_license_page' ); // function
}
/*--------------------------------------------------------------------------------------------------*/
function amr_ical_load_text() {
// allows for a custom language file in WP_LANG_DIR as per prior versions
// note NOT in WP_LANG_DIR/plugins as that will be used by wp language pack feature
$domain = 'amr-ical-events-list';
// The "plugin_locale" filter is also used in load_plugin_textdomain()
$locale = apply_filters('plugin_locale', get_locale(), $domain);
//var_dump($locale);
// if custom language file allowed for in prior versions exists, then load it first
$result = load_textdomain($domain, WP_LANG_DIR.'/'.$domain.'-'.$locale.'.mo');
// wp (see l10n.php) will check wp-content/languages/plugins if nothing found in plugin dir
//default is languages, maybe change in future?
$result = load_plugin_textdomain( $domain, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
//var_dump($result);
}
add_action('plugins_loaded' , 'amr_ical_load_text' );
?>

View File

@@ -0,0 +1,45 @@
div#amrical fieldset {margin-top: 1em;}
div#amrical {margin: 0 1em;}
div#amrical .expandall {margin: 0 2.5em; color: #D54E21; font-size: smaller;}
div#amrical ul {list-style: none; padding: 0; margin:0;}
div#amrical .List {width: 100%; clear:both; padding-top: 20px;}
div#amrical fieldset#amrglobal label {margin-top: 1em;}
div#amrical fieldset#amrglobal { width: 35em; }
div#amrical fieldset#submit { margin: 1em 2em 0 1em;}
div#amrical fieldset#ListTypes fieldset { padding: 0 0.5em; }
div#amrical legend {font-weight: bold; }
div#amrical fieldset.layout legend {font-weight: normal; }
div#amrical textarea,
div#amrical input {margin-left: 1em; padding: 0.5em; }
div#amrical .formats input {width: 20em;}
div#amrical fieldset.layout input {margin: 0; padding: 0.2em;}
div#amrical fieldset#submit input {padding: 0.4em;}
div#amrical fieldset#ListTypes fieldset.formats input { }
div#amrical fieldset.limits label {margin-left: 1em; }
div#amrical fieldset.general label {margin-left: 1em; }
div#amrical fieldset#amrglobal label { display: block;}
div#amrical label.Column {margin-left: 9em; }
div#amrical fieldset#ListTypes fieldset.formats label
{ margin-left: 1em;
}
div#amrical fieldset.layout label
{ font-size: xx-small;
position:relative;
top: -2.5em;
right: -4em;
}
div#amrical input.wide {
width: 90%;
}
div#amrical h4 { padding:0; margin: 0 0 0.4em 0;
}
.layout td {text-align: left ;}
.layout th .desc {
font-weight: light;
}

View File

@@ -0,0 +1,33 @@
/* --------------------This css is needed in some themes that force list bullets in-----------------------------*/
/* Do our very best to re move the list bullets from some weird themes where we do not want them.
Themes specify list bullet styling in many (okay maybe only 3 ) different ways and it is hard to force precdence sometimes! */
.wical ul li.group,
.wicalprop ul li,
.icalprop ul li { /* remove list bullets for calendar properties and groups */
list-style: none !important;
text-indent: 0;
padding: 0;
margin: 0;
background: none !important;
}
.ical ul.amrcol li:before,
.wcalprop ul.amrcol li:before ,
.icalprop ul.amrcol li:before { /* remove list bullets in the default theme and similar themes */
content:"" !important; /* none should work, but chrome seems to ignore it */
}
#sidebar #wccalprop0 li:before,
#sidebar .wical li:before { /* remove list bullets in the default theme and similar themes , for all fields*/
content:"" !important;
}
/* Old Default Theme and similar only ---------------------------------------------------------------*/
/* add back list bullets for a field only - see what your theme is using and put it in here */
#sidebar .wical li {
}
#sidebar .wical li.eventdate:before {
/* content: "\00BB \0020" !important; */
}
/* ------------------------ ---- End list bullets---------------------------------------------------------------*/
#menu .wical ul { /* to override classic theme where all appears greyed out */
color: #000;
}

View File

@@ -0,0 +1,462 @@
/* AmRiCal Default Style for first calendar on page
This file should have been copied to a css folder in your uploads directory. It may safely be edited in the uploads folder and will not be overwritten by upgrades,
You can always refer back to the default css in the plugin folder for the latest suggested or example css.
*/
/* TwentyTwelve widget compatibility*/
.widget .ical .enddate,
.widget .ical .eventdate,
.widget .ical .endtime,
.widget .ical .starttime {
color: #AAAAAA;
line-height: 1.84615;
font-size: 0.785714rem;
}
/*----------------------------------------------- */
/* html5 code */
#events_wrap article,
#events_wrap article span.summary,
#events_wrap article span.description,
#events_wrap aside,
#events_wrap figure,
#events_wrap footer,
#events_wrap header,
#events_wrap hgroup,
#events_wrap menu,
#events_wrap nav,
#events_wrap section {
/* for browsers that are not up to html5 yet, except will not work on IE */
display: block;
}
/* html5 code */
#events_wrap article,
#events_wrap article span.description,
#events_wrap aside,
#events_wrap figure,
#events_wrap section {
/* for browsers that are not up to html5 yet, except will not work on IE */
margin: 10px 0 10px 0;
}
#events_wrap article {
margin-bottom: 20px;
}
/* Optional - for grouping collapseability */
.master th.level0 { font-weight: bold; background-color: #ddd; }
.master th.group .termdesc { font-weight: normal; text-transform: none; }
#calendar_toggle {
float: right;
}
tr.level0 {
background: #ccc;
}
/*----------------------------------------------- */
#events_wrap {
word-wrap: break-word; /* make sure that any very long words do not cause overflow*/
}
.event abbr,
#events_wrap abbr {
/* do not show the hcalendar abbr underline - the abbr is confusing especially since the format of the date is ISO8601, not human friendly
However is required if we want hcal functionality */
border-bottom: none;
}
#events_wrap .largecalendar tbody td { /* wordpress default too big */
font-size: small;
}
#events_wrap thead th {
text-align: center;
}
#events_wrap .largecalendar thead th,
#events_wrap .largecalendar tbody td {
padding: 3px 0 2px; /* the 0 so that the multi-days line up */
}
#events_wrap .largecalendar tbody td {
/* padding: 3px 3px 2px; */ /*- no for multi day - need them next to each other */
}
#events_wrap .largecalendar tbody td .day {
padding: 0 3px 0;
}
#events_wrap .largecalendar tbody td .event {
padding: 0 3px;
}
#events_wrap table.largecalendar td {
width: 100px; /* the min width*/
}
#events_wrap table.largecalendar {
table-layout: fixed;
width: 100%;
/* width: 650px; */ /* if you wanted to fix to a certain size, - or use margins instead*/
}
#events_wrap table a { /* generally in the table , better not to have these */
text-decoration: none;
}
/*----------------------------------------------- */
/* Calendar Widget - styles to look like the post calendar widget */
/* Note this works for 2011 theme to override default table settings and achieve compatibility with the wpcalendar widget .
You need to find out what works for your theme */
#events_wrap .smallcalendar,
#multismallcalendar .smallcalendar {
border-collapse: separate;
border-spacing: 0px;
}
/* for some reason firefox does not apply css if we use events*/
#multismallcalendar tr.dayheaders th,
#multismallcalendar tr.week th,
#multismallcalendar tr.week td,
#multismallcalendar td.pad,
#events_wrap .smallcalendar td ,
#events_wrap .smallcalendar th ,
#events_wrap .smallcalendar td div,
#events_wrap1 .smallcalendar td ,/* for small plus agenda*/
#events_wrap1 .smallcalendar th ,
#events_wrap1 .smallcalendar td div {
margin: 0;
border: 0;
padding: 0;
border: 0px none;
outline: 0px none;
}
#multismallcalendar a.daylink,
#multismallcalendar a,
#events_wrap .smallcalendar a.daylink {
text-decoration: none;
}
/*-----------------------------------boxcalendar days------------ */
#multismallcalendar td,
#multismallcalendar th,
#events_wrap td {
vertical-align: top;
}
.smallcalendar td.day1,
.smallcalendar td.day2,
.smallcalendar td.day3,
.smallcalendar td.day4,
.smallcalendar td.day5 {
/* background: #f5f5f5; */ /* if you want the days of the week to be styled*/
}
#events_wrap table td.day6,
table.ical td.day7 { /* to style the weekend */
/* background: #eee; */
}
#events_wrap table td.pad {
/* background: #fefefe; */ /* if you wanted the padding cells to show - else let background come through */
}
/* highlight which day we are hovering over */
#events_wrap .smallcalendar td.hasevents a:hover {
color: #fff;
}
/* highlight which day we are hovering over */
#events_wrap .largecalendar td.hasevents:hover .day{
background: #777;
color: #fff;
}
#events_wrap .largecalendar td.hasevents:hover .day a{
color: #fff;
}
/*#events_wrap table.largecalendar td.today a,
table.smallcalendar td.selected a,
table.smallcalendar td.today a {
color: #fff;
}*/
table.largecalendar td.today a {
color: #111;
}
table.smallcalendar td.hasevents{
/* background: green; */
/* enter a colour code here to have days with events stand out - maybe for availability */
}
table.smallcalendar,
#events_wrap table.smallcalendar {
max-width: 200px;
border: 0;
margin: 0 auto;
}
#events_wrap table.smallcalendar tbody td {
/* background: #f5f5f5; */
/* border: 1px solid #fff; */
/* padding: 3px 0 2px; dont use - doesn't look like wp calendar then*/
/* text-align: center; */
}
#events_wrap table.largecalendar tbody td {
height:80px; /* it will expand if necessary */
}
#events_wrap table tbody td .event { /* use something like this if you want to force each event to take one line only */
/* overflow: hidden;
height: 20px; /* need a height for the overflow to work and still to keep table flexible ? */
}
#events_wrap table tbody td .firstday,
#events_wrap table tbody td .middleday,
#events_wrap table tbody td .lastday { /* Multi day styling */
background: #eee;
}
/* must be after multiday */
#events_wrap .smallcalendar td.hasevents:hover,
#events_wrap table.largecalendar td.today ,
#multismallcalendar td.today ,
table.smallcalendar td.selected ,
table.smallcalendar td.today {
font-weight: bold;
}
/* to override Multi day styling */
#events_wrap table tbody td.today .firstday,
#events_wrap table tbody td.today .middleday,
#events_wrap table tbody td.today .lastday
#events_wrap table tbody td.today .firstday,
#events_wrap table tbody td.today .middleday,
#events_wrap table tbody td.today .lastday {
background: #777;
}
/* unfortunately we need to use divs to hide the details if we want to allow html in details and keep html valid */
/* ------------------------------ In Box Calendar-- hide the details until we want them */
#events_wrap table.ical td .event div.details2{ /* hide column 2 */
display: none;
}
#events_wrap table.ical .event:hover div.details2 {
color:#333333;
background:#ffffff;
display:block;
position:absolute;
margin-top: 12px;
margin-left: 50px;
padding:10px;
width:200px;
z-index:100;
border: 1px solid #000000;
overflow: hidden; /* v 4.0.12 */
}
#events_wrap table.ical .event:hover div.details2 {
display: block;
}
#events_wrap table.ical .event:hover div.details2 img {
width: 200px; /* make any images smaller */
}
#events_wrap table.ical td.endweek .event:hover div.details2 {
/* shift the last column right side over a bit so it fits on the page*/
margin-left: -110px;
}
/*-------------------------------------------calendar_navigation */
.calendar_navigation {
clear: both;
margin: 0;
padding: 0;
border: hidden;
}
#icallookmore a#icalalookmore,
.calendar_navigation .nextweek,
.calendar_navigation .nextmonth {
text-align: right;
float:right;
}
#icallookmore a#icalalookprev,
.calendar_navigation .prevweek,
.calendar_navigation .prevmonth {
text-align: left;
float: left;
}
.calendar_navigation .prevweek,
.calendar_navigation .nextweek {
font-size: XX-large;
}
.calendar_navigation form {
/* display: inline; */
padding: 0 8px;
text-align: center;
margin: auto;
}
.calendar_navigation input,
.calendar_navigation select{
margin: 0;
line-height: 14px;
font-size: 12px;
}
.calendar_navigation a {
text-decoration: none;
}
/*-------------------------------------------calendar_views */
#calendar_views {
float:right;
padding-left: 5px;
}
#calendar_views a {
text-decoration: none;
}
/* -------------------------------------------------if you have a bunch of small calendars */
#multismallcalendar {
/* margin: 0 auto;
text-align: center; */
}
#multismallcalendar table {
padding: 0;
float: left; /* chrome browser will not float - why?? */
/*width: 32%; */
max-width: 200px;
min-width: 150px;
margin:2%;
text-align: center;
table-layout: fixed;
font-size: small;
}
#multismallcalendar .day {
text-align: center;
}
#multismallcalendar caption,
#multismallcalendar tr th,
#multismallcalendar tr td {
text-align: center;
padding: 0;
}
/*----------------------------------------weeks calendar */
#events_wrap table.weekscalendar caption {
/* text-align: left; */
}
#events_wrap .weekscalendar tr.caption {
background: #eee; /* do not normally want to do this, but looks shite in 2011 otherwise*/
}
#events_wrap .weekscalendar th,
#events_wrap .weekscalendar td {
width: 14%;
padding: 0;
margin: 0;
}
#events_wrap .weekscalendar td div.event {
padding-left: 2px;
padding-right: 2px;
}
/*----------------------------------------ics calendar properties */
.icalprop,
#events_wrap .icalprop,
#multismallcalendar .icalprop {
border: 0;
margin: 0;
padding: 0;
width: 100%;
max-width: 100%;
}
.icalprop td,
#events_wrap .icalprop td,
#multismallcalendar .icalprop td {
border: 0;
text-align: left;
padding: 0;
}
/* -------------------------------images can look strange in some themes -------------------------------*/
#events_wrap img {
border: none !important;
vertical-align: text-bottom;
}
#events_wrap .vevent { /*--/ helps */
clear: right;
}
/*------------------------------if event posts have large images in the content - can make the table too wide -------------- */
#events_wrap table img {
max-width: 400px;
}
/* ------------------------------- the bling icons -------------------------------*/
.amr-bling { /* float our little icons to the right */
float: right;
padding:0;
margin: 0; /* required where sometimes they don't line up nicely if limited text */
font-size: small;
}
.amr-bling img {
/* padding: 0 0 0 0.5em; */
}
/* -------------------------------------------------- for semi paginate ------------------------------------------------------- */
#icalnavs {
width: 250px;
text-align: center;
vertical-align: middle;
margin: 0 auto;
font-size:small;
}
.icalnav { vertical-align:middle;}
.icalnav a { text-decoration: none; color: #ADADAD;}
.icalnav a.symbol { font-size:large; }
.icalnavs:hover { background-color: #ffffff;}
.icalnav a:hover { color: #000000;}
.add-new-event {display: block; clear:both;}
/* for credits if shown - keep it low key ------------------------------------------------------- */
.amrical_credit,.amrical_credit a,.amrical_credit a:visited {
font-size:x-small;
color: #ADADAD;
font-style: italic;
vertical-align: middle;
}
.amrical_credit a:hover {
font-size: x-small;
font-style: italic;
color: #000000;
}
/* ---- ---------------------------------------------- to make large images okay */
.eventinfo ul li {
clear: both;
}
/* ---------------------------------------------------OPTIONAL --------------*/
/* #events_wrap .largecalendar tbody td div.event { /* use this if you want to force each box to be a fixed size - day div required because one cannot force a td height */
/* line-height: 26px;
overflow: hidden;
white-space: nowrap;
} */
table.largecalendar tbody td:hover div.day { /* and then use this to see the day box on hover - confusing with too manu hover's though, so maybe do not use desc hover then */
/* position: absolute;
border: 1px solid #000000;
padding: 10px;
background: #eee;
overflow: visible;
z-index:100; */
}
#events_wrap .history {
/* to style past events */
}
/* ------------------------------------------------------ more optional catgeory or tag styling , by name or id (using tid)
#events_wrap .eventscat,
#events_wrap table tr.eventscat td.amrcol1 {
border-left: solid 5px green;
}
#events_wrap table tr.t1 td.amrcol1 {
border-left: solid 5px red;
}
*/
/*----------------------------------------------- */
/* for multiple calendars, to check what events come from where */
.col1, .amrcol1 { /* the first cell */
padding-left: 2px;
}
.cal0 {
border-left: medium solid transparent; /*default colour*/
}
.cal1 {
border-left: medium solid LightGray;
}
.cal2 {
border-left: medium solid Gray;
}
.cal3 {
border-left: medium solid DarkGray;
}

View File

@@ -0,0 +1,207 @@
/* AmRiCal Default Style for first calendar on page
This file should have been copied to a css folder in your uploads directory. It may safely be edited in the uploads folder and will not be overwritten by upgrades,
You can always refer back to the default css in the plugin folder for the latest suggested or example css.
*/
td.today
{
background: #eee;
color: #111;
}
table td a.amr-bling {
text-align: right;
display: block;
float: right;
text-decoration: none;
}
table td a.hrefmap {
display: inline;
float: none;
text-decoration: none;
}
/* make tables look okay */
table.weekscalendar,
table.largecalendar,
table.smallcalendar {
table-layout: fixed;
width: 100%;
column-width: 14%;
}
table.ical td,
table.weekscalendar td,
table.smallcalendar td,
table.largecalendar td {
display: table-cell;
vertical-align:top;
}
table.weekscalendar tr.dayheaders th{
padding-top: 4em;
}
table.ical td .event {
padding-bottom: 1em;
}
.ical address {
margin: 0 0 0.1 0;
}
.calendar_navigation {
margin: 1em 0;
}
.icalnav,
.calendar_navigation form {
margin: auto;
text-align: center;
}
.calendar_navigation a {
text-decoration: none;
}
/* move the 'prev' links over to the right */
.calendar_navigation .prevmonth,
.calendar_navigation .prevweek {
display: block;
text-align: left;
float: left;
}
/* move the 'next' links over to the right */
.calendar_navigation .nextmonth,
.calendar_navigation .nextweek {
display: block;
text-align: right;
float: right;
}
/* remove the underline from the abbr that most browsers put in now*/
.event abbr[title] ,
.ical abbr[title] {
border-bottom: none !important;
text-decoration: none !important;
}
.ical abbr[title] {
cursor: help !important;
}
/* centre the days pagination at bottom */
.icalnav {
margin: auto;
}
/* highlight which day we are hovering over */
#events_wrap .largecalendar td.hasevents:hover .day{
background: #777;
color: #fff;
}
#events_wrap .largecalendar td.hasevents:hover .day a{
color: #fff;
}
/* in list type 10 space events */
.ical .toggle_container {
margin-top: 2em;
}
/* in list type 6 space events */
.icalprop h2.cal0 a {
text-align: right;
display: inline-block;
float: right;
text-decoration: none;
box-shadow: none;
}
#events_wrap .ical span.starttime,
#events_wrap .ical span.location,
#events_wrap .ical span.summary {
clear: both;
display: block;
float: left;
}
.eventinfo .map,
.eventinfo .addevent,
.eventinfo .subscribeevent,
.eventinfo .subseries,
#events_wrap .ical span.map,
#events_wrap .ical span.addevent{
display: block;
float: right;
}
#events_wrap .ical span.description {
clear: both;
display: block;
}
#events_wrap .ical article {
border-bottom: medium solid lightgrey;
padding-bottom: 1em;
margin-bottom: 1.5em;
}
/* unfortunately we need to use divs to hide the details if we want to allow html in details and keep html valid */
/* ------------------------------ In Box Calendar-- hide the details until we want them */
#events_wrap table.ical td .event div.details2 { /* hide column 2 */
display: none;
}
#events_wrap table.ical .event:hover div.details2 {
color:#333333;
background:#ffffff;
display:block;
position:absolute;
margin-top: 12px;
margin-left: 50px;
padding:10px;
width:200px;
z-index:100;
border: 1px solid #000000;
overflow: hidden; /* v 4.0.12 */
}
#events_wrap table.ical .event:hover div.details2 {
display: block;
}
#events_wrap table.ical .event:hover div.details2 img {
width: 200px; /* make any images smaller */
}
#events_wrap table.ical td.endweek .event:hover div.details2 {
/* shift the last column right side over a bit so it fits on the page*/
margin-left: -110px;
}
@media screen and (max-width: 600px) {
table.icalprop,
table.ical {width:100%;}
.ical thead {display: none;}
.ical tr:nth-of-type(2n) {background-color: inherit;}
.ical tr td:first-child {background: #f0f0f0; font-weight:bold;font-size:1.3em;}
.ical tbody td {display: block; text-align:center;}
.ical tbody td:before {
content: attr(data-th);
display: block;
text-align:center;
}
.ical .amrcol1 div {
display: inline;
}

View File

@@ -0,0 +1,7 @@
/* AmRiCal Style for printed pages */
#icalnavs,
.add-new-event,
.amrical_credit,
.amr-bling { /* not display the clickable icons */
display:none;
}

View File

@@ -0,0 +1,3 @@
<?php
// Silence is golden.
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,29 @@
ical.sprite-accept_16{ background-position: 0 0; width: 16px; height: 16px; }
ical.sprite-addtogoogle{ background-position: 0 -66px; width: 16px; height: 16px; }
ical.sprite-addtogoogle_16{ background-position: 0 -132px; width: 16px; height: 16px; }
ical.sprite-arrow_refresh_16{ background-position: 0 -198px; width: 16px; height: 16px; }
ical.sprite-calendar_16{ background-position: 0 -264px; width: 16px; height: 16px; }
ical.sprite-calendar_add_16{ background-position: 0 -330px; width: 16px; height: 16px; }
ical.sprite-calendar_link_16{ background-position: 0 -396px; width: 16px; height: 16px; }
ical.sprite-calendar_view_day_16{ background-position: 0 -462px; width: 16px; height: 16px; }
ical.sprite-calendar_view_month_16{ background-position: 0 -528px; width: 16px; height: 16px; }
ical.sprite-calendar_view_week_16{ background-position: 0 -594px; width: 16px; height: 16px; }
ical.sprite-clock_add{ background-position: 0 -660px; width: 16px; height: 16px; }
ical.sprite-date_add_16{ background-position: 0 -726px; width: 16px; height: 16px; }
ical.sprite-email_16{ background-position: 0 -792px; width: 16px; height: 16px; }
ical.sprite-facebook_16{ background-position: 0 -858px; width: 16px; height: 16px; }
ical.sprite-feed_add_16{ background-position: 0 -924px; width: 16px; height: 16px; }
ical.sprite-google_16{ background-position: 0 -990px; width: 16px; height: 16px; }
ical.sprite-info_16{ background-position: 0 -1056px; width: 16px; height: 16px; }
ical.sprite-linkedin_16{ background-position: 0 -1122px; width: 16px; height: 16px; }
ical.sprite-map_16{ background-position: 0 -1188px; width: 16px; height: 16px; }
ical.sprite-music_16{ background-position: 0 -1254px; width: 16px; height: 16px; }
ical.sprite-stumbleupon_16{ background-position: 0 -1320px; width: 16px; height: 16px; }
ical.sprite-timezone_16{ background-position: 0 -1386px; width: 16px; height: 16px; }
ical.sprite-twitter_1_16{ background-position: 0 -1452px; width: 16px; height: 16px; }
ical.sprite-youtube_16{ background-position: 0 -1518px; width: 16px; height: 16px; }
/*Don't forget to add a background rule to reference the sprite image. Something like this, for example: */
#container li {
background: url(csg-4da5455767b51.png) no-repeat top left;
}

View File

@@ -0,0 +1,29 @@
ical.sprite-accept_32{ background-position: 0 0; width: 32px; height: 32px; }
ical.sprite-addtogoogle_32{ background-position: 0 -82px; width: 32px; height: 32px; }
ical.sprite-arrow_refresh_32{ background-position: 0 -164px; width: 32px; height: 32px; }
ical.sprite-calendar_32{ background-position: 0 -246px; width: 32px; height: 32px; }
ical.sprite-calendar_add_32{ background-position: 0 -328px; width: 32px; height: 32px; }
ical.sprite-calendar_link_32{ background-position: 0 -410px; width: 32px; height: 32px; }
ical.sprite-calendar_view_day_32{ background-position: 0 -492px; width: 32px; height: 32px; }
ical.sprite-calendar_view_month_32{ background-position: 0 -574px; width: 32px; height: 32px; }
ical.sprite-calendar_view_week_32{ background-position: 0 -656px; width: 32px; height: 32px; }
ical.sprite-clock_add_32{ background-position: 0 -738px; width: 32px; height: 32px; }
ical.sprite-date_add_32{ background-position: 0 -820px; width: 32px; height: 32px; }
ical.sprite-delete_32{ background-position: 0 -902px; width: 32px; height: 32px; }
ical.sprite-email_32{ background-position: 0 -984px; width: 32px; height: 32px; }
ical.sprite-facebook_32{ background-position: 0 -1066px; width: 32px; height: 32px; }
ical.sprite-feed_add_32{ background-position: 0 -1148px; width: 32px; height: 32px; }
ical.sprite-google_32{ background-position: 0 -1230px; width: 32px; height: 32px; }
ical.sprite-info_32{ background-position: 0 -1312px; width: 32px; height: 32px; }
ical.sprite-linkedin_32{ background-position: 0 -1394px; width: 32px; height: 32px; }
ical.sprite-map_32{ background-position: 0 -1476px; width: 32px; height: 32px; }
ical.sprite-music_32{ background-position: 0 -1558px; width: 32px; height: 32px; }
ical.sprite-stumbleupon_32{ background-position: 0 -1640px; width: 32px; height: 32px; }
ical.sprite-timezone_32{ background-position: 0 -1722px; width: 32px; height: 32px; }
ical.sprite-twitter_1_32{ background-position: 0 -1804px; width: 32px; height: 32px; }
ical.sprite-youtube_32{ background-position: 0 -1886px; width: 32px; height: 32px; }
/*Don't forget to add a background rule to reference the sprite image. Something like this, for example: */
#container li {
background: url(csg-4da543d948061.png) no-repeat top left;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

View File

@@ -0,0 +1,3 @@
#container li {
background: url(csg-4d9825b3d7e23.png) no-repeat top left;
}

Some files were not shown because too many files have changed in this diff Show More