first commit
11
wp-content/plugins/akismet/.htaccess
Normal file
@ -0,0 +1,11 @@
|
||||
Order Deny,Allow
|
||||
Deny from all
|
||||
|
||||
<FilesMatch "^akismet\.(css|js)$">
|
||||
Allow from all
|
||||
</FilesMatch>
|
||||
|
||||
#allow access to any image
|
||||
<FilesMatch "^(.+)\.(png|gif)$">
|
||||
Allow from all
|
||||
</FilesMatch>
|
911
wp-content/plugins/akismet/admin.php
Normal file
@ -0,0 +1,911 @@
|
||||
<?php
|
||||
add_action( 'admin_menu', 'akismet_admin_menu' );
|
||||
|
||||
akismet_admin_warnings();
|
||||
|
||||
function akismet_admin_init() {
|
||||
global $wp_version;
|
||||
|
||||
// all admin functions are disabled in old versions
|
||||
if ( !function_exists('is_multisite') && version_compare( $wp_version, '3.0', '<' ) ) {
|
||||
|
||||
function akismet_version_warning() {
|
||||
echo '
|
||||
<div id="akismet-warning" class="updated fade"><p><strong>'.sprintf(__('Akismet %s requires WordPress 3.0 or higher.'), AKISMET_VERSION) .'</strong> '.sprintf(__('Please <a href="%s">upgrade WordPress</a> to a current version, or <a href="%s">downgrade to version 2.4 of the Akismet plugin</a>.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). '</p></div>
|
||||
';
|
||||
}
|
||||
add_action('admin_notices', 'akismet_version_warning');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( function_exists( 'get_plugin_page_hook' ) )
|
||||
$hook = get_plugin_page_hook( 'akismet-stats-display', 'index.php' );
|
||||
else
|
||||
$hook = 'dashboard_page_akismet-stats-display';
|
||||
add_meta_box('akismet-status', __('Comment History'), 'akismet_comment_status_meta_box', 'comment', 'normal');
|
||||
}
|
||||
add_action('admin_init', 'akismet_admin_init');
|
||||
|
||||
add_action( 'admin_enqueue_scripts', 'akismet_load_js_and_css' );
|
||||
function akismet_load_js_and_css() {
|
||||
global $hook_suffix;
|
||||
|
||||
if ( in_array( $hook_suffix, array(
|
||||
'index.php', # dashboard
|
||||
'edit-comments.php',
|
||||
'comment.php',
|
||||
'post.php',
|
||||
'plugins_page_akismet-key-config',
|
||||
'jetpack_page_akismet-key-config',
|
||||
) ) ) {
|
||||
wp_register_style( 'akismet.css', AKISMET_PLUGIN_URL . 'akismet.css', array(), '2.5.4.4' );
|
||||
wp_enqueue_style( 'akismet.css');
|
||||
|
||||
wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'), '2.5.4.6' );
|
||||
wp_enqueue_script( 'akismet.js' );
|
||||
wp_localize_script( 'akismet.js', 'WPAkismet', array(
|
||||
'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' )
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function akismet_nonce_field($action = -1) { return wp_nonce_field($action); }
|
||||
$akismet_nonce = 'akismet-update-key';
|
||||
|
||||
function akismet_plugin_action_links( $links, $file ) {
|
||||
if ( $file == plugin_basename( dirname(__FILE__).'/akismet.php' ) ) {
|
||||
$links[] = '<a href="' . admin_url( 'admin.php?page=akismet-key-config' ) . '">'.__( 'Settings' ).'</a>';
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
add_filter( 'plugin_action_links', 'akismet_plugin_action_links', 10, 2 );
|
||||
|
||||
function akismet_conf() {
|
||||
global $akismet_nonce, $current_user;
|
||||
|
||||
$new_key_link = 'https://akismet.com/get/';
|
||||
$api_key = akismet_get_key();
|
||||
$show_key_form = $api_key;
|
||||
$key_status = 'empty';
|
||||
$saved_ok = false;
|
||||
|
||||
$ms = array();
|
||||
|
||||
if ( isset( $_POST['submit'] ) ) {
|
||||
if ( function_exists('current_user_can') && !current_user_can('manage_options') )
|
||||
die(__('Cheatin’ uh?'));
|
||||
|
||||
$show_key_form = true;
|
||||
|
||||
check_admin_referer( $akismet_nonce );
|
||||
$key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
|
||||
$home_url = parse_url( get_bloginfo('url') );
|
||||
|
||||
if ( empty( $home_url['host'] ) )
|
||||
$ms[] = 'bad_home_url';
|
||||
|
||||
if ( empty( $key ) ) {
|
||||
if ( $api_key ) {
|
||||
delete_option('wordpress_api_key');
|
||||
$saved_ok = true;
|
||||
$ms[] = 'new_key_empty';
|
||||
}
|
||||
else
|
||||
$ms[] = 'key_empty';
|
||||
}
|
||||
else
|
||||
$key_status = akismet_verify_key( $key );
|
||||
|
||||
if ( $key != $api_key && $key_status == 'valid' ) {
|
||||
update_option('wordpress_api_key', $key);
|
||||
$ms[] = 'new_key_valid';
|
||||
}
|
||||
elseif ( $key_status == 'invalid' )
|
||||
$ms[] = 'new_key_invalid';
|
||||
elseif ( $key_status == 'failed' )
|
||||
$ms[] = 'new_key_failed';
|
||||
|
||||
$api_key = $key_status == 'valid' ? $key : false;
|
||||
|
||||
if ( isset( $_POST['akismet_discard_month'] ) )
|
||||
update_option( 'akismet_discard_month', 'true' );
|
||||
else
|
||||
update_option( 'akismet_discard_month', 'false' );
|
||||
|
||||
if ( isset( $_POST['akismet_show_user_comments_approved'] ) )
|
||||
update_option( 'akismet_show_user_comments_approved', 'true' );
|
||||
else
|
||||
update_option( 'akismet_show_user_comments_approved', 'false' );
|
||||
|
||||
if ( empty( $ms ) )
|
||||
$saved_ok = true;
|
||||
|
||||
}
|
||||
elseif ( isset( $_POST['check'] ) ) {
|
||||
$show_key_form = true;
|
||||
check_admin_referer( $akismet_nonce );
|
||||
akismet_get_server_connectivity(0);
|
||||
}
|
||||
|
||||
if ( $show_key_form ) {
|
||||
//check current key status
|
||||
//only get this if showing the key form otherwise takes longer for page to load for new user
|
||||
//no need to get it if we already know it and its valid
|
||||
if ( in_array( $key_status, array( 'invalid', 'failed', 'empty' ) ) ) {
|
||||
$key = get_option('wordpress_api_key');
|
||||
if ( empty( $key ) ) {
|
||||
//no key saved yet - maybe connection to Akismet down?
|
||||
if ( in_array( $key_status, array( 'invalid', 'empty' ) ) ) {
|
||||
if ( akismet_verify_key( '1234567890ab' ) == 'failed' )
|
||||
$ms[] = 'no_connection';
|
||||
}
|
||||
}
|
||||
else
|
||||
$key_status = akismet_verify_key( $key );
|
||||
}
|
||||
|
||||
if ( !isset( $_POST['submit'] ) ) {
|
||||
if ( $key_status == 'invalid' )
|
||||
$ms[] = 'key_invalid';
|
||||
elseif ( !empty( $key ) && $key_status == 'failed' )
|
||||
$ms[] = 'key_failed';
|
||||
}
|
||||
}
|
||||
|
||||
$messages = array(
|
||||
'new_key_empty' => array( 'class' => 'updated fade', 'text' => __('Your key has been cleared.' ) ),
|
||||
'new_key_valid' => array( 'class' => 'updated fade', 'text' => __('Your Akismet account has been successfully set up and activated. Happy blogging!' ) ),
|
||||
'new_key_invalid' => array( 'class' => 'error', 'text' => __('The key you entered is invalid. Please double-check it.' ) ),
|
||||
'new_key_failed' => array( 'class' => 'error', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.' ) ),
|
||||
'no_connection' => array( 'class' => 'error', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.' ) ),
|
||||
'key_empty' => array( 'class' => 'updated fade', 'text' => __('Please enter an API key' ) ),
|
||||
'key_invalid' => array( 'class' => 'error', 'text' => __('This key is invalid.' ) ),
|
||||
'key_failed' => array( 'class' => 'error', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.' ) ),
|
||||
'bad_home_url' => array( 'class' => 'error', 'text' => sprintf( __('Your WordPress home URL %s is invalid. Please fix the <a href="%s">home option</a>.'), esc_html( get_bloginfo('url') ), admin_url('options.php#home') ) )
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
<div class="wrap">
|
||||
<?php if ( !$api_key ) : ?>
|
||||
<h2 class="ak-header"><?php _e('Akismet'); ?></h2>
|
||||
<?php else: ?>
|
||||
<h2 class="ak-header"><?php printf( __( 'Akismet <a href="%s" class="add-new-h2">Stats</a>' ), esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) ) ); ?></h2>
|
||||
<?php endif; ?>
|
||||
<div class="no-key <?php echo $show_key_form ? 'hidden' : '';?>">
|
||||
<p><?php _e('Akismet eliminates the comment and trackback spam you get on your site. To use Akismet you may need to sign up for an API key. Click the button below to get started.'); ?></p>
|
||||
<form name="akismet_activate" action="https://akismet.com/get/" method="POST">
|
||||
<input type="hidden" name="return" value="1"/>
|
||||
<input type="hidden" name="jetpack" value="<?php echo (string) class_exists( 'Jetpack' );?>"/>
|
||||
<input type="hidden" name="user" value="<?php echo esc_attr( $current_user->user_login );?>"/>
|
||||
<input type="submit" class="button button-primary" value="<?php echo esc_attr( __('Create a new Akismet Key') ); ?>"/>
|
||||
</form>
|
||||
<br/>
|
||||
<a href="#" class="switch-have-key"><?php _e('I already have a key'); ?></a>
|
||||
</div>
|
||||
<div class="have-key <?php echo $show_key_form ? '' : 'hidden';?>">
|
||||
<?php if ( !empty($_POST['submit'] ) && $saved_ok ) : ?>
|
||||
<div id="message" class="updated fade"><p><strong><?php _e('Settings saved.') ?></strong></p></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( isset($_GET['message']) && $_GET['message'] == 'success' ) : ?>
|
||||
<div id="message" class="updated fade"><p><?php _e('<strong>Sign up success!</strong> Please check your email for your Akismet API Key and enter it below.') ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php foreach( $ms as $m ) : ?>
|
||||
<div class="<?php echo $messages[$m]['class']; ?>"><p><strong><?php echo $messages[$m]['text']; ?></strong></p></div>
|
||||
<?php endforeach; ?>
|
||||
<form action="" method="post" id="akismet-conf">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><label for="key"><?php _e('Akismet API Key');?></label></th>
|
||||
<td>
|
||||
<input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo esc_html( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $key_status;?>"><div class="under-input key-status <?php echo $key_status;?>"><?php echo ucfirst( $key_status );?></div>
|
||||
<p class="need-key description"><?php printf( __('You must enter a valid Akismet API key here. If you need an API key, you can <a href="%s">create one here</a>'), '#' );?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( $api_key ):?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Settings');?></th>
|
||||
<td>
|
||||
<fieldset><legend class="screen-reader-text"><span><?php _e('Settings');?></span></legend>
|
||||
<label for="akismet_discard_month" title="<?php echo esc_attr( __( 'Auto-detete old spam' ) ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></span></label><br>
|
||||
<label for="akismet_show_user_comments_approved" title="<?php echo esc_attr( __( 'Show approved comments' ) ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></span></label>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php akismet_nonce_field($akismet_nonce) ?>
|
||||
<p class="submit">
|
||||
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save Changes');?>">
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<?php if ( $api_key ) : ?>
|
||||
<h3><?php _e('Server Connectivity'); ?></h3>
|
||||
<form action="" method="post" id="akismet-connectivity">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><label for="key"><?php _e('Server Status');?></label></th>
|
||||
<td>
|
||||
<?php if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') ) : ?>
|
||||
<p class="key-status failed"><?php _e('Network functions are disabled.'); ?></p>
|
||||
<p class="description"><?php echo sprintf( __('Your web host or server administrator has disabled PHP\'s <code>fsockopen</code> or <code>gethostbynamel</code> functions. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet\'s system requirements</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
||||
<?php else :
|
||||
$servers = akismet_get_server_connectivity();
|
||||
$fail_count = count( $servers ) - count( array_filter( $servers ) );
|
||||
if ( is_array( $servers ) && count( $servers ) > 0 ) {
|
||||
if ( $fail_count > 0 && $fail_count < count( $servers ) ) { // some connections work, some fail ?>
|
||||
<p class="key-status some"><?php _e('Unable to reach some Akismet servers.'); ?></p>
|
||||
<p class="description"><?php echo sprintf( __('A network problem or firewall is blocking some connections from your web server to Akismet.com. Akismet is working but this may cause problems during times of network congestion. Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
||||
<?php } elseif ( $fail_count > 0 ) { // all connections fail ?>
|
||||
<p class="key-status failed"><?php _e('Unable to reach any Akismet servers.'); ?></p>
|
||||
<p class="description"><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
||||
<?php } else { // all connections work ?>
|
||||
<p class="key-status valid"><?php _e('All Akismet servers are available.'); ?></p>
|
||||
<p class="description"><?php _e('Akismet is working correctly. All servers are accessible.'); ?></p>
|
||||
<?php }
|
||||
} else { //can't connect to any server ?>
|
||||
<p class="key-status failed"><?php _e('Unable to find Akismet servers.'); ?></p>
|
||||
<p class="description"><?php echo sprintf( __('A DNS problem or firewall is preventing all access from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
||||
<?php }
|
||||
endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( !empty( $servers ) ) : ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Network Status');?></th>
|
||||
<td>
|
||||
<table class="network-status">
|
||||
<thead>
|
||||
<th><?php _e('Akismet server'); ?></th><th><?php _e('Network Status'); ?></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
asort($servers);
|
||||
foreach ( $servers as $ip => $status ) : ?>
|
||||
<tr>
|
||||
<td align="center"><?php echo esc_html( $ip ); ?></td>
|
||||
<td class="key-status <?php echo $status ? 'valid' : 'failed'; ?>"><?php echo $status ? __('Accessible') : __('Re-trying'); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<input type="submit" name="check" id="submit" class="button" style="margin-left: 13.3em;" value="<?php _e('Check Network Status');?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Last Checked');?></th>
|
||||
<td>
|
||||
<p><strong><?php echo get_option('akismet_connectivity_time') ? sprintf( __('%s Ago'), ucwords( human_time_diff( get_option('akismet_connectivity_time') ) ) ) : __( 'Not yet' ); ?></strong></p>
|
||||
<p class="description"><?php printf( __('You can confirm that Akismet.com is up by <a href="%s" target="_blank">clicking here</a>.'), 'http://status.automattic.com/9931/136079/Akismet-API' ); ?></p>
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php akismet_nonce_field($akismet_nonce) ?>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function akismet_stats_display() {
|
||||
global $akismet_api_host, $akismet_api_port;
|
||||
|
||||
$blog = urlencode( get_bloginfo('url') );
|
||||
$api_key = akismet_get_key();?>
|
||||
|
||||
<div class="wrap"><?php
|
||||
if ( !$api_key ) :?>
|
||||
<div id="akismet-warning" class="updated fade"><p><strong><?php _e('Akismet is almost ready.');?></strong> <?php printf( __( 'You must <a href="%1$s">enter your Akismet API key</a> for it to work.' ), esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), admin_url( 'admin.php' ) ) ) );?></p></div><?php
|
||||
else :?>
|
||||
<iframe src="<?php echo esc_url( sprintf( '%s://akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s', is_ssl()?'https':'http', $blog, $api_key ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe><?php
|
||||
endif;?>
|
||||
</div><?php
|
||||
}
|
||||
|
||||
function akismet_stats() {
|
||||
if ( !function_exists('did_action') || did_action( 'rightnow_end' ) ) // We already displayed this info in the "Right Now" section
|
||||
return;
|
||||
if ( !$count = get_option('akismet_spam_count') )
|
||||
return;
|
||||
$path = plugin_basename(__FILE__);
|
||||
echo '<h3>' . _x( 'Spam', 'comments' ) . '</h3>';
|
||||
global $submenu;
|
||||
if ( isset( $submenu['edit-comments.php'] ) )
|
||||
$link = 'edit-comments.php';
|
||||
else
|
||||
$link = 'edit.php';
|
||||
echo '<p>'.sprintf( _n( '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.', '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.', $count ), 'http://akismet.com/?return=true', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'</p>';
|
||||
}
|
||||
add_action('activity_box_end', 'akismet_stats');
|
||||
|
||||
function akismet_admin_warnings() {
|
||||
global $wpcom_api_key, $pagenow;
|
||||
|
||||
if (
|
||||
$pagenow == 'edit-comments.php'
|
||||
|| ( !empty( $_GET['page'] ) && $_GET['page'] == 'akismet-key-config' )
|
||||
|| ( !empty( $_GET['page'] ) && $_GET['page'] == 'akismet-stats-display' )
|
||||
) {
|
||||
if ( get_option( 'akismet_alert_code' ) ) {
|
||||
function akismet_alert() {
|
||||
$alert = array(
|
||||
'code' => (int) get_option( 'akismet_alert_code' ),
|
||||
'msg' => get_option( 'akismet_alert_msg' )
|
||||
);
|
||||
?>
|
||||
<div class='error'>
|
||||
<p><strong><?php _e( 'Akismet Error Code');?>: <?php echo $alert['code']; ?></strong></p>
|
||||
<p><?php esc_html_e( $alert['msg'] ); ?></p>
|
||||
<p><?php //FIXME: need to revert this to using __() in next version
|
||||
printf( translate( 'For more information:' ) . ' <a href="%s">%s</a>' , 'https://akismet.com/errors/'.$alert['code'], 'https://akismet.com/errors/'.$alert['code'] );?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action( 'admin_notices', 'akismet_alert' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !get_option('wordpress_api_key') && !$wpcom_api_key && !isset($_POST['submit']) ) {
|
||||
function akismet_warning() {
|
||||
global $hook_suffix, $current_user;
|
||||
|
||||
if ( $hook_suffix == 'plugins.php' ) {
|
||||
echo '
|
||||
<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
|
||||
<style type="text/css">
|
||||
.akismet_activate{min-width:825px;border:1px solid #4F800D;padding:5px;margin:15px 0;background:#83AF24;background-image:-webkit-gradient(linear,0% 0,80% 100%,from(#83AF24),to(#4F800D));background-image:-moz-linear-gradient(80% 100% 120deg,#4F800D,#83AF24);-moz-border-radius:3px;border-radius:3px;-webkit-border-radius:3px;position:relative;overflow:hidden}.akismet_activate .aa_a{position:absolute;top:-5px;right:10px;font-size:140px;color:#769F33;font-family:Georgia, "Times New Roman", Times, serif;z-index:1}.akismet_activate .aa_button{font-weight:bold;border:1px solid #029DD6;border-top:1px solid #06B9FD;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#FFF;background:#029DD6;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#029DD6),to(#0079B1));background-image:-moz-linear-gradient(0% 100% 90deg,#0079B1,#029DD6);-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}.akismet_activate .aa_button:hover{text-decoration:none !important;border:1px solid #029DD6;border-bottom:1px solid #00A8EF;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#F0F8FB;background:#0079B1;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#0079B1),to(#0092BF));background-image:-moz-linear-gradient(0% 100% 90deg,#0092BF,#0079B1);-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}.akismet_activate .aa_button_border{border:1px solid #006699;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;background:#029DD6;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#029DD6),to(#0079B1));background-image:-moz-linear-gradient(0% 100% 90deg,#0079B1,#029DD6)}.akismet_activate .aa_button_container{cursor:pointer;display:inline-block;background:#DEF1B8;padding:5px;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;width:266px}.akismet_activate .aa_description{position:absolute;top:22px;left:285px;margin-left:25px;color:#E5F2B1;font-size:15px;z-index:1000}.akismet_activate .aa_description strong{color:#FFF;font-weight:normal}
|
||||
</style>
|
||||
<form name="akismet_activate" action="https://akismet.com/get/" method="POST">
|
||||
<input type="hidden" name="return" value="1"/>
|
||||
<input type="hidden" name="jetpack" value="'.(string) class_exists( 'Jetpack' ).'"/>
|
||||
<input type="hidden" name="user" value="'.esc_attr( $current_user->user_login ).'"/>
|
||||
<div class="akismet_activate">
|
||||
<div class="aa_a">A</div>
|
||||
<div class="aa_button_container" onclick="document.akismet_activate.submit();">
|
||||
<div class="aa_button_border">
|
||||
<div class="aa_button">Activate your Akismet account</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aa_description"><strong>Almost done</strong> - activate your account and say goodbye to comment spam.</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
}
|
||||
|
||||
add_action('admin_notices', 'akismet_warning');
|
||||
return;
|
||||
} elseif ( ( empty($_SERVER['SCRIPT_FILENAME']) || basename($_SERVER['SCRIPT_FILENAME']) == 'edit-comments.php' ) && wp_next_scheduled('akismet_schedule_cron_recheck') ) {
|
||||
function akismet_warning() {
|
||||
global $wpdb;
|
||||
akismet_fix_scheduled_recheck();
|
||||
$waiting = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE meta_key = 'akismet_error'" );
|
||||
$next_check = wp_next_scheduled('akismet_schedule_cron_recheck');
|
||||
if ( $waiting > 0 && $next_check > time() )
|
||||
echo '
|
||||
<div id="akismet-warning" class="updated fade"><p><strong>'.__('Akismet has detected a problem.').'</strong> '.sprintf(__('Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation. Please check your <a href="%s">Akismet configuration</a> and contact your web host if problems persist.'), 'admin.php?page=akismet-key-config').'</p></div>
|
||||
';
|
||||
}
|
||||
add_action('admin_notices', 'akismet_warning');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME placeholder
|
||||
|
||||
function akismet_comment_row_action( $a, $comment ) {
|
||||
|
||||
// failsafe for old WP versions
|
||||
if ( !function_exists('add_comment_meta') )
|
||||
return $a;
|
||||
|
||||
$akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true );
|
||||
$akismet_error = get_comment_meta( $comment->comment_ID, 'akismet_error', true );
|
||||
$user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);
|
||||
$comment_status = wp_get_comment_status( $comment->comment_ID );
|
||||
$desc = null;
|
||||
if ( $akismet_error ) {
|
||||
$desc = __( 'Awaiting spam check' );
|
||||
} elseif ( !$user_result || $user_result == $akismet_result ) {
|
||||
// Show the original Akismet result if the user hasn't overridden it, or if their decision was the same
|
||||
if ( $akismet_result == 'true' && $comment_status != 'spam' && $comment_status != 'trash' )
|
||||
$desc = __( 'Flagged as spam by Akismet' );
|
||||
elseif ( $akismet_result == 'false' && $comment_status == 'spam' )
|
||||
$desc = __( 'Cleared by Akismet' );
|
||||
} else {
|
||||
$who = get_comment_meta( $comment->comment_ID, 'akismet_user', true );
|
||||
if ( $user_result == 'true' )
|
||||
$desc = sprintf( __('Flagged as spam by %s'), $who );
|
||||
else
|
||||
$desc = sprintf( __('Un-spammed by %s'), $who );
|
||||
}
|
||||
|
||||
// add a History item to the hover links, just after Edit
|
||||
if ( $akismet_result ) {
|
||||
$b = array();
|
||||
foreach ( $a as $k => $item ) {
|
||||
$b[ $k ] = $item;
|
||||
if (
|
||||
$k == 'edit'
|
||||
|| ( $k == 'unspam' && $GLOBALS['wp_version'] >= 3.4 )
|
||||
) {
|
||||
$b['history'] = '<a href="comment.php?action=editcomment&c='.$comment->comment_ID.'#akismet-status" title="'. esc_attr__( 'View comment history' ) . '"> '. __('History') . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
$a = $b;
|
||||
}
|
||||
|
||||
if ( $desc )
|
||||
echo '<span class="akismet-status" commentid="'.$comment->comment_ID.'"><a href="comment.php?action=editcomment&c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' ) . '">'.esc_html( $desc ).'</a></span>';
|
||||
|
||||
if ( apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') ) == 'true' ) {
|
||||
$comment_count = akismet_get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );
|
||||
$comment_count = intval( $comment_count );
|
||||
echo '<span class="akismet-user-comment-count" commentid="'.$comment->comment_ID.'" style="display:none;"><br><span class="akismet-user-comment-counts">'.sprintf( _n( '%s approved', '%s approved', $comment_count ), number_format_i18n( $comment_count ) ) . '</span></span>';
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
add_filter( 'comment_row_actions', 'akismet_comment_row_action', 10, 2 );
|
||||
|
||||
function akismet_comment_status_meta_box($comment) {
|
||||
$history = akismet_get_comment_history( $comment->comment_ID );
|
||||
|
||||
if ( $history ) {
|
||||
echo '<div class="akismet-history" style="margin: 13px;">';
|
||||
foreach ( $history as $row ) {
|
||||
$time = date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT';
|
||||
echo '<div style="margin-bottom: 13px;"><span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf( __('%s ago'), human_time_diff( $row['time'] ) ) . '</span> - ';
|
||||
echo esc_html( $row['message'] ) . '</div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add an extra column header to the comments screen
|
||||
function akismet_comments_columns( $columns ) {
|
||||
$columns[ 'akismet' ] = __( 'Akismet' );
|
||||
return $columns;
|
||||
}
|
||||
|
||||
#add_filter( 'manage_edit-comments_columns', 'akismet_comments_columns' );
|
||||
|
||||
// Show stuff in the extra column
|
||||
function akismet_comment_column_row( $column, $comment_id ) {
|
||||
if ( $column != 'akismet' )
|
||||
return;
|
||||
|
||||
$history = akismet_get_comment_history( $comment_id );
|
||||
|
||||
if ( $history ) {
|
||||
echo '<dl class="akismet-history">';
|
||||
foreach ( $history as $row ) {
|
||||
echo '<dt>' . sprintf( __('%s ago'), human_time_diff( $row['time'] ) ) . '</dt>';
|
||||
echo '<dd>' . esc_html( $row['message'] ) . '</dd>';
|
||||
}
|
||||
|
||||
echo '</dl>';
|
||||
}
|
||||
}
|
||||
|
||||
#add_action( 'manage_comments_custom_column', 'akismet_comment_column_row', 10, 2 );
|
||||
|
||||
// END FIXME
|
||||
|
||||
// call out URLS in comments
|
||||
function akismet_text_add_link_callback( $m ) {
|
||||
// bare link?
|
||||
if ( $m[4] == $m[2] )
|
||||
return '<a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a>';
|
||||
else
|
||||
return '<span title="'.$m[2].'" class="comment-link"><a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a></span>';
|
||||
}
|
||||
|
||||
function akismet_text_add_link_class( $comment_text ) {
|
||||
return preg_replace_callback( '#<a ([^>]*)href="([^"]+)"([^>]*)>(.*?)</a>#i', 'akismet_text_add_link_callback', $comment_text );
|
||||
}
|
||||
|
||||
add_filter('comment_text', 'akismet_text_add_link_class');
|
||||
|
||||
|
||||
// WP 2.5+
|
||||
function akismet_rightnow() {
|
||||
global $submenu, $wp_db_version;
|
||||
|
||||
if ( 8645 < $wp_db_version ) // 2.7
|
||||
$link = 'edit-comments.php?comment_status=spam';
|
||||
elseif ( isset( $submenu['edit-comments.php'] ) )
|
||||
$link = 'edit-comments.php?page=akismet-admin';
|
||||
else
|
||||
$link = 'edit.php?page=akismet-admin';
|
||||
|
||||
if ( $count = get_option('akismet_spam_count') ) {
|
||||
$intro = sprintf( _n(
|
||||
'<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
|
||||
'<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',
|
||||
$count
|
||||
), 'http://akismet.com/?return=true', number_format_i18n( $count ) );
|
||||
} else {
|
||||
$intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog. '), 'http://akismet.com/?return=true' );
|
||||
}
|
||||
|
||||
$link = function_exists( 'esc_url' ) ? esc_url( $link ) : clean_url( $link );
|
||||
if ( $queue_count = akismet_spam_count() ) {
|
||||
$queue_text = sprintf( _n(
|
||||
'There\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
|
||||
'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
|
||||
$queue_count
|
||||
), number_format_i18n( $queue_count ), $link );
|
||||
} else {
|
||||
$queue_text = sprintf( __( "There's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $link );
|
||||
}
|
||||
|
||||
$text = $intro . '<br />' . $queue_text;
|
||||
echo "<p class='akismet-right-now'>$text</p>\n";
|
||||
}
|
||||
|
||||
add_action('rightnow_end', 'akismet_rightnow');
|
||||
|
||||
|
||||
// For WP >= 2.5
|
||||
function akismet_check_for_spam_button($comment_status) {
|
||||
if ( 'approved' == $comment_status )
|
||||
return;
|
||||
if ( function_exists('plugins_url') )
|
||||
$link = 'admin.php?action=akismet_recheck_queue';
|
||||
else
|
||||
$link = 'edit-comments.php?page=akismet-admin&recheckqueue=true&noheader=true';
|
||||
echo "</div><div class='alignleft'><a class='button-secondary checkforspam' href='$link'>" . __('Check for Spam') . "</a>";
|
||||
}
|
||||
add_action('manage_comments_nav', 'akismet_check_for_spam_button');
|
||||
|
||||
function akismet_submit_nonspam_comment ( $comment_id ) {
|
||||
global $wpdb, $akismet_api_host, $akismet_api_port, $current_user, $current_site;
|
||||
$comment_id = (int) $comment_id;
|
||||
|
||||
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'");
|
||||
if ( !$comment ) // it was deleted
|
||||
return;
|
||||
|
||||
// use the original version stored in comment_meta if available
|
||||
$as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
|
||||
if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) ) {
|
||||
$comment = (object) array_merge( (array)$comment, $as_submitted );
|
||||
}
|
||||
|
||||
$comment->blog = get_bloginfo('url');
|
||||
$comment->blog_lang = get_locale();
|
||||
$comment->blog_charset = get_option('blog_charset');
|
||||
$comment->permalink = get_permalink($comment->comment_post_ID);
|
||||
if ( is_object($current_user) ) {
|
||||
$comment->reporter = $current_user->user_login;
|
||||
}
|
||||
if ( is_object($current_site) ) {
|
||||
$comment->site_domain = $current_site->domain;
|
||||
}
|
||||
|
||||
$comment->user_role = '';
|
||||
if ( isset( $comment->user_ID ) )
|
||||
$comment->user_role = akismet_get_user_roles($comment->user_ID);
|
||||
|
||||
if ( akismet_test_mode() )
|
||||
$comment->is_test = 'true';
|
||||
|
||||
$post = get_post( $comment->comment_post_ID );
|
||||
$comment->comment_post_modified_gmt = $post->post_modified_gmt;
|
||||
|
||||
$query_string = '';
|
||||
foreach ( $comment as $key => $data )
|
||||
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
|
||||
|
||||
$response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-ham", $akismet_api_port);
|
||||
if ( $comment->reporter ) {
|
||||
akismet_update_comment_history( $comment_id, sprintf( __('%s reported this comment as not spam'), $comment->reporter ), 'report-ham' );
|
||||
update_comment_meta( $comment_id, 'akismet_user_result', 'false' );
|
||||
update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
|
||||
}
|
||||
|
||||
do_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);
|
||||
}
|
||||
|
||||
function akismet_submit_spam_comment ( $comment_id ) {
|
||||
global $wpdb, $akismet_api_host, $akismet_api_port, $current_user, $current_site;
|
||||
$comment_id = (int) $comment_id;
|
||||
|
||||
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'");
|
||||
if ( !$comment ) // it was deleted
|
||||
return;
|
||||
if ( 'spam' != $comment->comment_approved )
|
||||
return;
|
||||
|
||||
// use the original version stored in comment_meta if available
|
||||
$as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
|
||||
if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) ) {
|
||||
$comment = (object) array_merge( (array)$comment, $as_submitted );
|
||||
}
|
||||
|
||||
$comment->blog = get_bloginfo('url');
|
||||
$comment->blog_lang = get_locale();
|
||||
$comment->blog_charset = get_option('blog_charset');
|
||||
$comment->permalink = get_permalink($comment->comment_post_ID);
|
||||
if ( is_object($current_user) ) {
|
||||
$comment->reporter = $current_user->user_login;
|
||||
}
|
||||
if ( is_object($current_site) ) {
|
||||
$comment->site_domain = $current_site->domain;
|
||||
}
|
||||
|
||||
$comment->user_role = '';
|
||||
if ( isset( $comment->user_ID ) )
|
||||
$comment->user_role = akismet_get_user_roles($comment->user_ID);
|
||||
|
||||
if ( akismet_test_mode() )
|
||||
$comment->is_test = 'true';
|
||||
|
||||
$post = get_post( $comment->comment_post_ID );
|
||||
$comment->comment_post_modified_gmt = $post->post_modified_gmt;
|
||||
|
||||
$query_string = '';
|
||||
foreach ( $comment as $key => $data )
|
||||
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
|
||||
|
||||
$response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-spam", $akismet_api_port);
|
||||
if ( $comment->reporter ) {
|
||||
akismet_update_comment_history( $comment_id, sprintf( __('%s reported this comment as spam'), $comment->reporter ), 'report-spam' );
|
||||
update_comment_meta( $comment_id, 'akismet_user_result', 'true' );
|
||||
update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
|
||||
}
|
||||
do_action('akismet_submit_spam_comment', $comment_id, $response[1]);
|
||||
}
|
||||
|
||||
// For WP 2.7+
|
||||
function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
|
||||
if ( $new_status == $old_status )
|
||||
return;
|
||||
|
||||
# we don't need to record a history item for deleted comments
|
||||
if ( $new_status == 'delete' )
|
||||
return;
|
||||
|
||||
if ( !is_admin() )
|
||||
return;
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )
|
||||
return;
|
||||
|
||||
if ( defined('WP_IMPORTING') && WP_IMPORTING == true )
|
||||
return;
|
||||
|
||||
// if this is present, it means the status has been changed by a re-check, not an explicit user action
|
||||
if ( get_comment_meta( $comment->comment_ID, 'akismet_rechecking' ) )
|
||||
return;
|
||||
|
||||
global $current_user;
|
||||
$reporter = '';
|
||||
if ( is_object( $current_user ) )
|
||||
$reporter = $current_user->user_login;
|
||||
|
||||
// Assumption alert:
|
||||
// We want to submit comments to Akismet only when a moderator explicitly spams or approves it - not if the status
|
||||
// is changed automatically by another plugin. Unfortunately WordPress doesn't provide an unambiguous way to
|
||||
// determine why the transition_comment_status action was triggered. And there are several different ways by which
|
||||
// to spam and unspam comments: bulk actions, ajax, links in moderation emails, the dashboard, and perhaps others.
|
||||
// We'll assume that this is an explicit user action if POST or GET has an 'action' key.
|
||||
if ( isset($_POST['action']) || isset($_GET['action']) ) {
|
||||
if ( $new_status == 'spam' && ( $old_status == 'approved' || $old_status == 'unapproved' || !$old_status ) ) {
|
||||
return akismet_submit_spam_comment( $comment->comment_ID );
|
||||
} elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) {
|
||||
return akismet_submit_nonspam_comment( $comment->comment_ID );
|
||||
}
|
||||
}
|
||||
|
||||
akismet_update_comment_history( $comment->comment_ID, sprintf( __('%s changed the comment status to %s'), $reporter, $new_status ), 'status-' . $new_status );
|
||||
}
|
||||
|
||||
add_action( 'transition_comment_status', 'akismet_transition_comment_status', 10, 3 );
|
||||
|
||||
// Total spam in queue
|
||||
// get_option( 'akismet_spam_count' ) is the total caught ever
|
||||
function akismet_spam_count( $type = false ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( !$type ) { // total
|
||||
$count = wp_cache_get( 'akismet_spam_count', 'widget' );
|
||||
if ( false === $count ) {
|
||||
if ( function_exists('wp_count_comments') ) {
|
||||
$count = wp_count_comments();
|
||||
$count = $count->spam;
|
||||
} else {
|
||||
$count = (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam'");
|
||||
}
|
||||
wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 );
|
||||
}
|
||||
return $count;
|
||||
} elseif ( 'comments' == $type || 'comment' == $type ) { // comments
|
||||
$type = '';
|
||||
} else { // pingback, trackback, ...
|
||||
$type = $wpdb->escape( $type );
|
||||
}
|
||||
|
||||
return (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type'");
|
||||
}
|
||||
|
||||
|
||||
function akismet_recheck_queue() {
|
||||
global $wpdb, $akismet_api_host, $akismet_api_port;
|
||||
|
||||
akismet_fix_scheduled_recheck();
|
||||
|
||||
if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) )
|
||||
return;
|
||||
|
||||
$moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'", ARRAY_A );
|
||||
foreach ( (array) $moderation as $c ) {
|
||||
$c['user_ip'] = $c['comment_author_IP'];
|
||||
$c['user_agent'] = $c['comment_agent'];
|
||||
$c['referrer'] = '';
|
||||
$c['blog'] = get_bloginfo('url');
|
||||
$c['blog_lang'] = get_locale();
|
||||
$c['blog_charset'] = get_option('blog_charset');
|
||||
$c['permalink'] = get_permalink($c['comment_post_ID']);
|
||||
|
||||
$c['user_role'] = '';
|
||||
if ( isset( $c['user_ID'] ) )
|
||||
$c['user_role'] = akismet_get_user_roles($c['user_ID']);
|
||||
|
||||
if ( akismet_test_mode() )
|
||||
$c['is_test'] = 'true';
|
||||
|
||||
$id = (int) $c['comment_ID'];
|
||||
|
||||
$query_string = '';
|
||||
foreach ( $c as $key => $data )
|
||||
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
|
||||
|
||||
add_comment_meta( $c['comment_ID'], 'akismet_rechecking', true );
|
||||
$response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
|
||||
if ( 'true' == $response[1] ) {
|
||||
wp_set_comment_status($c['comment_ID'], 'spam');
|
||||
update_comment_meta( $c['comment_ID'], 'akismet_result', 'true' );
|
||||
delete_comment_meta( $c['comment_ID'], 'akismet_error' );
|
||||
akismet_update_comment_history( $c['comment_ID'], __('Akismet re-checked and caught this comment as spam'), 'check-spam' );
|
||||
|
||||
} elseif ( 'false' == $response[1] ) {
|
||||
update_comment_meta( $c['comment_ID'], 'akismet_result', 'false' );
|
||||
delete_comment_meta( $c['comment_ID'], 'akismet_error' );
|
||||
akismet_update_comment_history( $c['comment_ID'], __('Akismet re-checked and cleared this comment'), 'check-ham' );
|
||||
// abnormal result: error
|
||||
} else {
|
||||
update_comment_meta( $c['comment_ID'], 'akismet_result', 'error' );
|
||||
akismet_update_comment_history( $c['comment_ID'], sprintf( __('Akismet was unable to re-check this comment (response: %s)'), substr($response[1], 0, 50)), 'check-error' );
|
||||
}
|
||||
|
||||
delete_comment_meta( $c['comment_ID'], 'akismet_rechecking' );
|
||||
}
|
||||
$redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : admin_url( 'edit-comments.php' );
|
||||
wp_safe_redirect( $redirect_to );
|
||||
exit;
|
||||
}
|
||||
|
||||
add_action('admin_action_akismet_recheck_queue', 'akismet_recheck_queue');
|
||||
|
||||
// Adds an 'x' link next to author URLs, clicking will remove the author URL and show an undo link
|
||||
function akismet_remove_comment_author_url() {
|
||||
if ( !empty($_POST['id'] ) && check_admin_referer( 'comment_author_url_nonce' ) ) {
|
||||
global $wpdb;
|
||||
$comment = get_comment( intval($_POST['id']), ARRAY_A );
|
||||
if (current_user_can('edit_comment', $comment['comment_ID'])) {
|
||||
$comment['comment_author_url'] = '';
|
||||
do_action( 'comment_remove_author_url' );
|
||||
print(wp_update_comment( $comment ));
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_action('wp_ajax_comment_author_deurl', 'akismet_remove_comment_author_url');
|
||||
|
||||
function akismet_add_comment_author_url() {
|
||||
if ( !empty( $_POST['id'] ) && !empty( $_POST['url'] ) && check_admin_referer( 'comment_author_url_nonce' ) ) {
|
||||
global $wpdb;
|
||||
$comment = get_comment( intval($_POST['id']), ARRAY_A );
|
||||
if (current_user_can('edit_comment', $comment['comment_ID'])) {
|
||||
$comment['comment_author_url'] = esc_url($_POST['url']);
|
||||
do_action( 'comment_add_author_url' );
|
||||
print(wp_update_comment( $comment ));
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_action('wp_ajax_comment_author_reurl', 'akismet_add_comment_author_url');
|
||||
|
||||
// Check connectivity between the WordPress blog and Akismet's servers.
|
||||
// Returns an associative array of server IP addresses, where the key is the IP address, and value is true (available) or false (unable to connect).
|
||||
function akismet_check_server_connectivity() {
|
||||
global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
|
||||
|
||||
$test_host = 'rest.akismet.com';
|
||||
|
||||
// Some web hosts may disable one or both functions
|
||||
if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') )
|
||||
return array();
|
||||
|
||||
$ips = gethostbynamel($test_host);
|
||||
if ( !$ips || !is_array($ips) || !count($ips) )
|
||||
return array();
|
||||
|
||||
$servers = array();
|
||||
foreach ( $ips as $ip ) {
|
||||
$response = akismet_verify_key( akismet_get_key(), $ip );
|
||||
// even if the key is invalid, at least we know we have connectivity
|
||||
if ( $response == 'valid' || $response == 'invalid' )
|
||||
$servers[$ip] = true;
|
||||
else
|
||||
$servers[$ip] = false;
|
||||
}
|
||||
|
||||
return $servers;
|
||||
}
|
||||
|
||||
// Check the server connectivity and store the results in an option.
|
||||
// Cached results will be used if not older than the specified timeout in seconds; use $cache_timeout = 0 to force an update.
|
||||
// Returns the same associative array as akismet_check_server_connectivity()
|
||||
function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
|
||||
$servers = get_option('akismet_available_servers');
|
||||
if ( (time() - get_option('akismet_connectivity_time') < $cache_timeout) && $servers !== false )
|
||||
return $servers;
|
||||
|
||||
// There's a race condition here but the effect is harmless.
|
||||
$servers = akismet_check_server_connectivity();
|
||||
update_option('akismet_available_servers', $servers);
|
||||
update_option('akismet_connectivity_time', time());
|
||||
return $servers;
|
||||
}
|
||||
|
||||
// Returns true if server connectivity was OK at the last check, false if there was a problem that needs to be fixed.
|
||||
function akismet_server_connectivity_ok() {
|
||||
// skip the check on WPMU because the status page is hidden
|
||||
global $wpcom_api_key;
|
||||
if ( $wpcom_api_key )
|
||||
return true;
|
||||
$servers = akismet_get_server_connectivity();
|
||||
return !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );
|
||||
}
|
||||
|
||||
function akismet_admin_menu() {
|
||||
if ( class_exists( 'Jetpack' ) ) {
|
||||
add_action( 'jetpack_admin_menu', 'akismet_load_menu' );
|
||||
} else {
|
||||
akismet_load_menu();
|
||||
}
|
||||
}
|
||||
|
||||
function akismet_load_menu() {
|
||||
if ( class_exists( 'Jetpack' ) ) {
|
||||
add_submenu_page( 'jetpack', __( 'Akismet' ), __( 'Akismet' ), 'manage_options', 'akismet-key-config', 'akismet_conf' );
|
||||
add_submenu_page( 'jetpack', __( 'Akismet Stats' ), __( 'Akismet Stats' ), 'manage_options', 'akismet-stats-display', 'akismet_stats_display' );
|
||||
} else {
|
||||
add_submenu_page('plugins.php', __('Akismet'), __('Akismet'), 'manage_options', 'akismet-key-config', 'akismet_conf');
|
||||
add_submenu_page('index.php', __('Akismet Stats'), __('Akismet Stats'), 'manage_options', 'akismet-stats-display', 'akismet_stats_display');
|
||||
}
|
||||
}
|
1
wp-content/plugins/akismet/akismet.css
Normal file
@ -0,0 +1 @@
|
||||
#submitted-on{position:relative}#the-comment-list .author .akismet-user-comment-count{display:inline}#the-comment-list .author a span{text-decoration:none;color:#999}#the-comment-list .remove_url{margin-left:3px;color:#999;padding:2px 3px 2px 0}#the-comment-list .remove_url:hover{color:#A7301F;font-weight:bold;padding:2px 2px 2px 0}#dashboard_recent_comments .akismet-status{display:none}.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}span.comment-link a{text-decoration:underline}span.comment-link:after{content:" "attr(title) " ";color:#aaa;text-decoration:none}.mshot-arrow{width:0;height:0;border-top:10px solid transparent;border-bottom:10px solid transparent;border-right:10px solid #5C5C5C;position:absolute;left:-6px;top:91px}.mshot-container{background:#5C5C5C;position:absolute;top:-94px;padding:7px;width:450px;height:338px;z-index:20000;-moz-border-radius:6px;border-radius:6px;-webkit-border-radius:6px}h2.ak-header{padding-left:38px;background:url('img/logo.png') no-repeat 0 9px;margin-bottom:14px;line-height:32px}.key-status{padding:0.4em 1em;color:#fff;font-weight:bold;text-align:center;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;max-width:23.3em}input#key{width:25.3em !important}input#key.valid{border-color:#4F800D}input#key.invalid,input#key.failed{border-color:#888}.key-status.under-input{margin-top:-5px;padding-bottom:0px}.key-status.invalid,.key-status.failed{background-color:#888}.key-status.valid{background-color:#4F800D}.key-status.some{background-color:#993300}.key-status.empty{display:none}table.network-status th,table.network-status td{padding:0.4em;margin:0;text-align:center}table.network-status{border-color:#dfdfdf;border-width:0 0 1px 1px;border-style:solid;border-spacing:0;width:25.6em}table.network-status th,table.network-status td{border-color:#dfdfdf;border-width:1px 1px 0 0;border-style:solid;margin:0;border-spacing:0}table.network-status td.key-status{border-radius:0px;-webkit-border-radius:0px}
|
BIN
wp-content/plugins/akismet/akismet.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
126
wp-content/plugins/akismet/akismet.js
Normal file
@ -0,0 +1,126 @@
|
||||
jQuery(document).ready(function () {
|
||||
jQuery( '.switch-have-key' ).click( function() {
|
||||
var no_key = jQuery( this ).parents().find('div.no-key');
|
||||
var have_key = jQuery( this ).parents().find('div.have-key');
|
||||
|
||||
no_key.addClass( 'hidden' );
|
||||
have_key.removeClass( 'hidden' );
|
||||
|
||||
return false;
|
||||
});
|
||||
jQuery( 'p.need-key a' ).click( function(){
|
||||
document.akismet_activate.submit();
|
||||
});
|
||||
jQuery('.akismet-status').each(function () {
|
||||
var thisId = jQuery(this).attr('commentid');
|
||||
jQuery(this).prependTo('#comment-' + thisId + ' .column-comment div:first-child');
|
||||
});
|
||||
jQuery('.akismet-user-comment-count').each(function () {
|
||||
var thisId = jQuery(this).attr('commentid');
|
||||
jQuery(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
|
||||
});
|
||||
jQuery('#the-comment-list tr.comment .column-author a[title ^= "http://"]').each(function () {
|
||||
var thisTitle = jQuery(this).attr('title');
|
||||
thisCommentId = jQuery(this).parents('tr:first').attr('id').split("-");
|
||||
|
||||
jQuery(this).attr("id", "author_comment_url_"+ thisCommentId[1]);
|
||||
|
||||
if (thisTitle) {
|
||||
jQuery(this).after(' <a href="#" class="remove_url" commentid="'+ thisCommentId[1] +'" title="Remove this URL">x</a>');
|
||||
}
|
||||
});
|
||||
jQuery('.remove_url').live('click', function () {
|
||||
var thisId = jQuery(this).attr('commentid');
|
||||
var data = {
|
||||
action: 'comment_author_deurl',
|
||||
_wpnonce: WPAkismet.comment_author_url_nonce,
|
||||
id: thisId
|
||||
};
|
||||
jQuery.ajax({
|
||||
url: ajaxurl,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
beforeSend: function () {
|
||||
// Removes "x" link
|
||||
jQuery("a[commentid='"+ thisId +"']").hide();
|
||||
// Show temp status
|
||||
jQuery("#author_comment_url_"+ thisId).html('<span>Removing...</span>');
|
||||
},
|
||||
success: function (response) {
|
||||
if (response) {
|
||||
// Show status/undo link
|
||||
jQuery("#author_comment_url_"+ thisId).attr('cid', thisId).addClass('akismet_undo_link_removal').html('<span>URL removed (</span>undo<span>)</span>');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
jQuery('.akismet_undo_link_removal').live('click', function () {
|
||||
var thisId = jQuery(this).attr('cid');
|
||||
var thisUrl = jQuery(this).attr('href').replace("http://www.", "").replace("http://", "");
|
||||
var data = {
|
||||
action: 'comment_author_reurl',
|
||||
_wpnonce: WPAkismet.comment_author_url_nonce,
|
||||
id: thisId,
|
||||
url: thisUrl
|
||||
};
|
||||
jQuery.ajax({
|
||||
url: ajaxurl,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
beforeSend: function () {
|
||||
// Show temp status
|
||||
jQuery("#author_comment_url_"+ thisId).html('<span>Re-adding…</span>');
|
||||
},
|
||||
success: function (response) {
|
||||
if (response) {
|
||||
// Add "x" link
|
||||
jQuery("a[commentid='"+ thisId +"']").show();
|
||||
// Show link
|
||||
jQuery("#author_comment_url_"+ thisId).removeClass('akismet_undo_link_removal').html(thisUrl);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
jQuery('a[id^="author_comment_url"]').mouseover(function () {
|
||||
var wpcomProtocol = ( 'https:' === location.protocol ) ? 'https://' : 'http://';
|
||||
// Need to determine size of author column
|
||||
var thisParentWidth = jQuery(this).parent().width();
|
||||
// It changes based on if there is a gravatar present
|
||||
thisParentWidth = (jQuery(this).parent().find('.grav-hijack').length) ? thisParentWidth - 42 + 'px' : thisParentWidth + 'px';
|
||||
if (jQuery(this).find('.mShot').length == 0 && !jQuery(this).hasClass('akismet_undo_link_removal')) {
|
||||
var thisId = jQuery(this).attr('id').replace('author_comment_url_', '');
|
||||
jQuery('.widefat td').css('overflow', 'visible');
|
||||
jQuery(this).css('position', 'relative');
|
||||
var thisHref = jQuery.URLEncode(jQuery(this).attr('href'));
|
||||
jQuery(this).append('<div class="mShot mshot-container" style="left: '+thisParentWidth+'"><div class="mshot-arrow"></div><img src="'+wpcomProtocol+'s0.wordpress.com/mshots/v1/'+thisHref+'?w=450" width="450" class="mshot-image_'+thisId+'" style="margin: 0;" /></div>');
|
||||
setTimeout(function () {
|
||||
jQuery('.mshot-image_'+thisId).attr('src', wpcomProtocol+'s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=2');
|
||||
}, 6000);
|
||||
setTimeout(function () {
|
||||
jQuery('.mshot-image_'+thisId).attr('src', wpcomProtocol+'s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=3');
|
||||
}, 12000);
|
||||
} else {
|
||||
jQuery(this).find('.mShot').css('left', thisParentWidth).show();
|
||||
}
|
||||
}).mouseout(function () {
|
||||
jQuery(this).find('.mShot').hide();
|
||||
});
|
||||
});
|
||||
// URL encode plugin
|
||||
jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
|
||||
while(x<c.length){var m=r.exec(c.substr(x));
|
||||
if(m!=null && m.length>1 && m[1]!=''){o+=m[1];x+=m[1].length;
|
||||
}else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16);
|
||||
o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;}
|
||||
});
|
||||
// Preload mshot images after everything else has loaded
|
||||
jQuery(window).load(function() {
|
||||
var wpcomProtocol = ( 'https:' === location.protocol ) ? 'https://' : 'http://';
|
||||
jQuery('a[id^="author_comment_url"]').each(function () {
|
||||
jQuery.get(wpcomProtocol+'s0.wordpress.com/mshots/v1/'+jQuery.URLEncode(jQuery(this).attr('href'))+'?w=450');
|
||||
});
|
||||
});
|
613
wp-content/plugins/akismet/akismet.php
Normal file
@ -0,0 +1,613 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Akismet
|
||||
*/
|
||||
/*
|
||||
Plugin Name: Akismet
|
||||
Plugin URI: http://akismet.com/?return=true
|
||||
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
|
||||
Version: 2.5.8
|
||||
Author: Automattic
|
||||
Author URI: http://automattic.com/wordpress-plugins/
|
||||
License: GPLv2 or later
|
||||
*/
|
||||
|
||||
/*
|
||||
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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
// Make sure we don't expose any info if called directly
|
||||
if ( !function_exists( 'add_action' ) ) {
|
||||
echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';
|
||||
exit;
|
||||
}
|
||||
|
||||
define('AKISMET_VERSION', '2.5.8');
|
||||
define('AKISMET_PLUGIN_URL', plugin_dir_url( __FILE__ ));
|
||||
|
||||
/** If you hardcode a WP.com API key here, all key config screens will be hidden */
|
||||
if ( defined('WPCOM_API_KEY') )
|
||||
$wpcom_api_key = constant('WPCOM_API_KEY');
|
||||
else
|
||||
$wpcom_api_key = '';
|
||||
|
||||
if ( isset($wp_db_version) && $wp_db_version <= 9872 )
|
||||
include_once dirname( __FILE__ ) . '/legacy.php';
|
||||
|
||||
include_once dirname( __FILE__ ) . '/widget.php';
|
||||
|
||||
if ( is_admin() )
|
||||
require_once dirname( __FILE__ ) . '/admin.php';
|
||||
|
||||
function akismet_init() {
|
||||
global $wpcom_api_key, $akismet_api_host, $akismet_api_port;
|
||||
|
||||
if ( $wpcom_api_key )
|
||||
$akismet_api_host = $wpcom_api_key . '.rest.akismet.com';
|
||||
else
|
||||
$akismet_api_host = get_option('wordpress_api_key') . '.rest.akismet.com';
|
||||
|
||||
$akismet_api_port = 80;
|
||||
}
|
||||
add_action('init', 'akismet_init');
|
||||
|
||||
function akismet_get_key() {
|
||||
global $wpcom_api_key;
|
||||
if ( !empty($wpcom_api_key) )
|
||||
return $wpcom_api_key;
|
||||
return get_option('wordpress_api_key');
|
||||
}
|
||||
|
||||
function akismet_check_key_status( $key, $ip = null ) {
|
||||
global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
|
||||
$blog = urlencode( get_option('home') );
|
||||
if ( $wpcom_api_key )
|
||||
$key = $wpcom_api_key;
|
||||
$response = akismet_http_post("key=$key&blog=$blog", 'rest.akismet.com', '/1.1/verify-key', $akismet_api_port, $ip);
|
||||
return $response;
|
||||
}
|
||||
|
||||
// given a response from an API call like akismet_check_key_status(), update the alert code options if an alert is present.
|
||||
function akismet_update_alert( $response ) {
|
||||
$code = $msg = null;
|
||||
if ( isset($response[0]['x-akismet-alert-code']) ) {
|
||||
$code = $response[0]['x-akismet-alert-code'];
|
||||
$msg = $response[0]['x-akismet-alert-msg'];
|
||||
}
|
||||
|
||||
// only call update_option() if the value has changed
|
||||
if ( $code != get_option( 'akismet_alert_code' ) ) {
|
||||
update_option( 'akismet_alert_code', $code );
|
||||
update_option( 'akismet_alert_msg', $msg );
|
||||
}
|
||||
}
|
||||
|
||||
function akismet_verify_key( $key, $ip = null ) {
|
||||
$response = akismet_check_key_status( $key, $ip );
|
||||
akismet_update_alert( $response );
|
||||
if ( !is_array($response) || !isset($response[1]) || $response[1] != 'valid' && $response[1] != 'invalid' )
|
||||
return 'failed';
|
||||
return $response[1];
|
||||
}
|
||||
|
||||
// if we're in debug or test modes, use a reduced service level so as not to polute training or stats data
|
||||
function akismet_test_mode() {
|
||||
if ( defined('AKISMET_TEST_MODE') && AKISMET_TEST_MODE )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// return a comma-separated list of role names for the given user
|
||||
function akismet_get_user_roles( $user_id ) {
|
||||
$roles = false;
|
||||
|
||||
if ( !class_exists('WP_User') )
|
||||
return false;
|
||||
|
||||
if ( $user_id > 0 ) {
|
||||
$comment_user = new WP_User($user_id);
|
||||
if ( isset($comment_user->roles) )
|
||||
$roles = join(',', $comment_user->roles);
|
||||
}
|
||||
|
||||
if ( is_multisite() && is_super_admin( $user_id ) ) {
|
||||
if ( empty( $roles ) ) {
|
||||
$roles = 'super_admin';
|
||||
} else {
|
||||
$comment_user->roles[] = 'super_admin';
|
||||
$roles = join( ',', $comment_user->roles );
|
||||
}
|
||||
}
|
||||
|
||||
return $roles;
|
||||
}
|
||||
|
||||
// Returns array with headers in $response[0] and body in $response[1]
|
||||
function akismet_http_post($request, $host, $path, $port = 80, $ip=null) {
|
||||
global $wp_version;
|
||||
|
||||
$akismet_ua = "WordPress/{$wp_version} | ";
|
||||
$akismet_ua .= 'Akismet/' . constant( 'AKISMET_VERSION' );
|
||||
|
||||
$akismet_ua = apply_filters( 'akismet_ua', $akismet_ua );
|
||||
|
||||
$content_length = strlen( $request );
|
||||
|
||||
$http_host = $host;
|
||||
// use a specific IP if provided
|
||||
// needed by akismet_check_server_connectivity()
|
||||
if ( $ip && long2ip( ip2long( $ip ) ) ) {
|
||||
$http_host = $ip;
|
||||
} else {
|
||||
$http_host = $host;
|
||||
}
|
||||
|
||||
// use the WP HTTP class if it is available
|
||||
if ( function_exists( 'wp_remote_post' ) ) {
|
||||
$http_args = array(
|
||||
'body' => $request,
|
||||
'headers' => array(
|
||||
'Content-Type' => 'application/x-www-form-urlencoded; ' .
|
||||
'charset=' . get_option( 'blog_charset' ),
|
||||
'Host' => $host,
|
||||
'User-Agent' => $akismet_ua
|
||||
),
|
||||
'httpversion' => '1.0',
|
||||
'timeout' => 15
|
||||
);
|
||||
$akismet_url = "http://{$http_host}{$path}";
|
||||
$response = wp_remote_post( $akismet_url, $http_args );
|
||||
if ( is_wp_error( $response ) )
|
||||
return '';
|
||||
|
||||
return array( $response['headers'], $response['body'] );
|
||||
} else {
|
||||
$http_request = "POST $path HTTP/1.0\r\n";
|
||||
$http_request .= "Host: $host\r\n";
|
||||
$http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n";
|
||||
$http_request .= "Content-Length: {$content_length}\r\n";
|
||||
$http_request .= "User-Agent: {$akismet_ua}\r\n";
|
||||
$http_request .= "\r\n";
|
||||
$http_request .= $request;
|
||||
|
||||
$response = '';
|
||||
if( false != ( $fs = @fsockopen( $http_host, $port, $errno, $errstr, 10 ) ) ) {
|
||||
fwrite( $fs, $http_request );
|
||||
|
||||
while ( !feof( $fs ) )
|
||||
$response .= fgets( $fs, 1160 ); // One TCP-IP packet
|
||||
fclose( $fs );
|
||||
$response = explode( "\r\n\r\n", $response, 2 );
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
// filter handler used to return a spam result to pre_comment_approved
|
||||
function akismet_result_spam( $approved ) {
|
||||
// bump the counter here instead of when the filter is added to reduce the possibility of overcounting
|
||||
if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
|
||||
update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
|
||||
// this is a one-shot deal
|
||||
remove_filter( 'pre_comment_approved', 'akismet_result_spam' );
|
||||
return 'spam';
|
||||
}
|
||||
|
||||
function akismet_result_hold( $approved ) {
|
||||
// once only
|
||||
remove_filter( 'pre_comment_approved', 'akismet_result_hold' );
|
||||
return '0';
|
||||
}
|
||||
|
||||
// how many approved comments does this author have?
|
||||
function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( !empty($user_id) )
|
||||
return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE user_id = %d AND comment_approved = 1", $user_id ) );
|
||||
|
||||
if ( !empty($comment_author_email) )
|
||||
return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_author_email = %s AND comment_author = %s AND comment_author_url = %s AND comment_approved = 1", $comment_author_email, $comment_author, $comment_author_url ) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function akismet_microtime() {
|
||||
$mtime = explode( ' ', microtime() );
|
||||
return $mtime[1] + $mtime[0];
|
||||
}
|
||||
|
||||
// log an event for a given comment, storing it in comment_meta
|
||||
function akismet_update_comment_history( $comment_id, $message, $event=null ) {
|
||||
global $current_user;
|
||||
|
||||
// failsafe for old WP versions
|
||||
if ( !function_exists('add_comment_meta') )
|
||||
return false;
|
||||
|
||||
$user = '';
|
||||
if ( is_object($current_user) && isset($current_user->user_login) )
|
||||
$user = $current_user->user_login;
|
||||
|
||||
$event = array(
|
||||
'time' => akismet_microtime(),
|
||||
'message' => $message,
|
||||
'event' => $event,
|
||||
'user' => $user,
|
||||
);
|
||||
|
||||
// $unique = false so as to allow multiple values per comment
|
||||
$r = add_comment_meta( $comment_id, 'akismet_history', $event, false );
|
||||
}
|
||||
|
||||
// get the full comment history for a given comment, as an array in reverse chronological order
|
||||
function akismet_get_comment_history( $comment_id ) {
|
||||
|
||||
// failsafe for old WP versions
|
||||
if ( !function_exists('add_comment_meta') )
|
||||
return false;
|
||||
|
||||
$history = get_comment_meta( $comment_id, 'akismet_history', false );
|
||||
usort( $history, 'akismet_cmp_time' );
|
||||
return $history;
|
||||
}
|
||||
|
||||
function akismet_cmp_time( $a, $b ) {
|
||||
return $a['time'] > $b['time'] ? -1 : 1;
|
||||
}
|
||||
|
||||
// this fires on wp_insert_comment. we can't update comment_meta when akismet_auto_check_comment() runs
|
||||
// because we don't know the comment ID at that point.
|
||||
function akismet_auto_check_update_meta( $id, $comment ) {
|
||||
global $akismet_last_comment;
|
||||
|
||||
// failsafe for old WP versions
|
||||
if ( !function_exists('add_comment_meta') )
|
||||
return false;
|
||||
|
||||
if ( !isset( $akismet_last_comment['comment_author_email'] ) )
|
||||
$akismet_last_comment['comment_author_email'] = '';
|
||||
|
||||
// wp_insert_comment() might be called in other contexts, so make sure this is the same comment
|
||||
// as was checked by akismet_auto_check_comment
|
||||
if ( is_object($comment) && !empty($akismet_last_comment) && is_array($akismet_last_comment) ) {
|
||||
if ( isset($akismet_last_comment['comment_post_ID']) && intval($akismet_last_comment['comment_post_ID']) == intval($comment->comment_post_ID)
|
||||
&& $akismet_last_comment['comment_author'] == $comment->comment_author
|
||||
&& $akismet_last_comment['comment_author_email'] == $comment->comment_author_email ) {
|
||||
// normal result: true or false
|
||||
if ( $akismet_last_comment['akismet_result'] == 'true' ) {
|
||||
update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
|
||||
akismet_update_comment_history( $comment->comment_ID, __('Akismet caught this comment as spam'), 'check-spam' );
|
||||
if ( $comment->comment_approved != 'spam' )
|
||||
akismet_update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s'), $comment->comment_approved), 'status-changed'.$comment->comment_approved );
|
||||
} elseif ( $akismet_last_comment['akismet_result'] == 'false' ) {
|
||||
update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );
|
||||
akismet_update_comment_history( $comment->comment_ID, __('Akismet cleared this comment'), 'check-ham' );
|
||||
if ( $comment->comment_approved == 'spam' ) {
|
||||
if ( wp_blacklist_check($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent) )
|
||||
akismet_update_comment_history( $comment->comment_ID, __('Comment was caught by wp_blacklist_check'), 'wp-blacklisted' );
|
||||
else
|
||||
akismet_update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s'), $comment->comment_approved), 'status-changed-'.$comment->comment_approved );
|
||||
}
|
||||
// abnormal result: error
|
||||
} else {
|
||||
update_comment_meta( $comment->comment_ID, 'akismet_error', time() );
|
||||
akismet_update_comment_history( $comment->comment_ID, sprintf( __('Akismet was unable to check this comment (response: %s), will automatically retry again later.'), substr($akismet_last_comment['akismet_result'], 0, 50)), 'check-error' );
|
||||
}
|
||||
|
||||
// record the complete original data as submitted for checking
|
||||
if ( isset($akismet_last_comment['comment_as_submitted']) )
|
||||
update_comment_meta( $comment->comment_ID, 'akismet_as_submitted', $akismet_last_comment['comment_as_submitted'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'wp_insert_comment', 'akismet_auto_check_update_meta', 10, 2 );
|
||||
|
||||
|
||||
function akismet_auto_check_comment( $commentdata ) {
|
||||
global $akismet_api_host, $akismet_api_port, $akismet_last_comment;
|
||||
|
||||
$comment = $commentdata;
|
||||
$comment['user_ip'] = $_SERVER['REMOTE_ADDR'];
|
||||
$comment['user_agent'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
|
||||
$comment['referrer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
|
||||
$comment['blog'] = get_option('home');
|
||||
$comment['blog_lang'] = get_locale();
|
||||
$comment['blog_charset'] = get_option('blog_charset');
|
||||
$comment['permalink'] = get_permalink($comment['comment_post_ID']);
|
||||
|
||||
if ( !empty( $comment['user_ID'] ) ) {
|
||||
$comment['user_role'] = akismet_get_user_roles( $comment['user_ID'] );
|
||||
}
|
||||
|
||||
$akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
|
||||
$comment['akismet_comment_nonce'] = 'inactive';
|
||||
if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) {
|
||||
$comment['akismet_comment_nonce'] = 'failed';
|
||||
if ( isset( $_POST['akismet_comment_nonce'] ) && wp_verify_nonce( $_POST['akismet_comment_nonce'], 'akismet_comment_nonce_' . $comment['comment_post_ID'] ) )
|
||||
$comment['akismet_comment_nonce'] = 'passed';
|
||||
|
||||
// comment reply in wp-admin
|
||||
if ( isset( $_POST['_ajax_nonce-replyto-comment'] ) && check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ) )
|
||||
$comment['akismet_comment_nonce'] = 'passed';
|
||||
|
||||
}
|
||||
|
||||
if ( akismet_test_mode() )
|
||||
$comment['is_test'] = 'true';
|
||||
|
||||
foreach ($_POST as $key => $value ) {
|
||||
if ( is_string($value) )
|
||||
$comment["POST_{$key}"] = $value;
|
||||
}
|
||||
|
||||
$ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
|
||||
|
||||
foreach ( $_SERVER as $key => $value ) {
|
||||
if ( !in_array( $key, $ignore ) && is_string($value) )
|
||||
$comment["$key"] = $value;
|
||||
else
|
||||
$comment["$key"] = '';
|
||||
}
|
||||
|
||||
$post = get_post( $comment['comment_post_ID'] );
|
||||
$comment[ 'comment_post_modified_gmt' ] = $post->post_modified_gmt;
|
||||
|
||||
$query_string = '';
|
||||
foreach ( $comment as $key => $data )
|
||||
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
|
||||
|
||||
$commentdata['comment_as_submitted'] = $comment;
|
||||
|
||||
$response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
|
||||
do_action( 'akismet_comment_check_response', $response );
|
||||
akismet_update_alert( $response );
|
||||
$commentdata['akismet_result'] = $response[1];
|
||||
if ( 'true' == $response[1] ) {
|
||||
// akismet_spam_count will be incremented later by akismet_result_spam()
|
||||
add_filter('pre_comment_approved', 'akismet_result_spam');
|
||||
|
||||
do_action( 'akismet_spam_caught' );
|
||||
|
||||
$last_updated = strtotime( $post->post_modified_gmt );
|
||||
$diff = time() - $last_updated;
|
||||
$diff = $diff / 86400;
|
||||
|
||||
if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' && empty($comment['user_ID']) ) {
|
||||
// akismet_result_spam() won't be called so bump the counter here
|
||||
if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
|
||||
update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
|
||||
$redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : get_permalink( $post );
|
||||
wp_safe_redirect( $redirect_to );
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
// if the response is neither true nor false, hold the comment for moderation and schedule a recheck
|
||||
if ( 'true' != $response[1] && 'false' != $response[1] ) {
|
||||
if ( !current_user_can('moderate_comments') ) {
|
||||
add_filter('pre_comment_approved', 'akismet_result_hold');
|
||||
}
|
||||
if ( !wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
|
||||
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( function_exists('wp_next_scheduled') && function_exists('wp_schedule_event') ) {
|
||||
// WP 2.1+: delete old comments daily
|
||||
if ( !wp_next_scheduled('akismet_scheduled_delete') )
|
||||
wp_schedule_event(time(), 'daily', 'akismet_scheduled_delete');
|
||||
} elseif ( (mt_rand(1, 10) == 3) ) {
|
||||
// WP 2.0: run this one time in ten
|
||||
akismet_delete_old();
|
||||
}
|
||||
$akismet_last_comment = $commentdata;
|
||||
|
||||
akismet_fix_scheduled_recheck();
|
||||
return $commentdata;
|
||||
}
|
||||
|
||||
add_action('preprocess_comment', 'akismet_auto_check_comment', 1);
|
||||
|
||||
function akismet_delete_old() {
|
||||
global $wpdb;
|
||||
$now_gmt = current_time('mysql', 1);
|
||||
$comment_ids = $wpdb->get_col("SELECT comment_id FROM $wpdb->comments WHERE DATE_SUB('$now_gmt', INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam'");
|
||||
if ( empty( $comment_ids ) )
|
||||
return;
|
||||
|
||||
$comma_comment_ids = implode( ', ', array_map('intval', $comment_ids) );
|
||||
|
||||
do_action( 'delete_comment', $comment_ids );
|
||||
$wpdb->query("DELETE FROM $wpdb->comments WHERE comment_id IN ( $comma_comment_ids )");
|
||||
$wpdb->query("DELETE FROM $wpdb->commentmeta WHERE comment_id IN ( $comma_comment_ids )");
|
||||
clean_comment_cache( $comment_ids );
|
||||
$n = mt_rand(1, 5000);
|
||||
if ( apply_filters('akismet_optimize_table', ($n == 11)) ) // lucky number
|
||||
$wpdb->query("OPTIMIZE TABLE $wpdb->comments");
|
||||
|
||||
}
|
||||
|
||||
function akismet_delete_old_metadata() {
|
||||
global $wpdb;
|
||||
|
||||
$now_gmt = current_time( 'mysql', 1 );
|
||||
$interval = apply_filters( 'akismet_delete_commentmeta_interval', 15 );
|
||||
|
||||
# enfore a minimum of 1 day
|
||||
$interval = absint( $interval );
|
||||
if ( $interval < 1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// akismet_as_submitted meta values are large, so expire them
|
||||
// after $interval days regardless of the comment status
|
||||
while ( TRUE ) {
|
||||
$comment_ids = $wpdb->get_col( "SELECT $wpdb->comments.comment_id FROM $wpdb->commentmeta INNER JOIN $wpdb->comments USING(comment_id) WHERE meta_key = 'akismet_as_submitted' AND DATE_SUB('$now_gmt', INTERVAL {$interval} DAY) > comment_date_gmt LIMIT 10000" );
|
||||
|
||||
if ( empty( $comment_ids ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $comment_ids as $comment_id ) {
|
||||
delete_comment_meta( $comment_id, 'akismet_as_submitted' );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$n = mt_rand( 1, 5000 );
|
||||
if ( apply_filters( 'akismet_optimize_table', ( $n == 11 ), 'commentmeta' ) ) { // lucky number
|
||||
$wpdb->query( "OPTIMIZE TABLE $wpdb->commentmeta" );
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
add_action('akismet_scheduled_delete', 'akismet_delete_old');
|
||||
add_action('akismet_scheduled_delete', 'akismet_delete_old_metadata');
|
||||
|
||||
function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
|
||||
global $wpdb, $akismet_api_host, $akismet_api_port;
|
||||
|
||||
$id = (int) $id;
|
||||
$c = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID = '$id'", ARRAY_A );
|
||||
if ( !$c )
|
||||
return;
|
||||
|
||||
$c['user_ip'] = $c['comment_author_IP'];
|
||||
$c['user_agent'] = $c['comment_agent'];
|
||||
$c['referrer'] = '';
|
||||
$c['blog'] = get_option('home');
|
||||
$c['blog_lang'] = get_locale();
|
||||
$c['blog_charset'] = get_option('blog_charset');
|
||||
$c['permalink'] = get_permalink($c['comment_post_ID']);
|
||||
$id = $c['comment_ID'];
|
||||
if ( akismet_test_mode() )
|
||||
$c['is_test'] = 'true';
|
||||
$c['recheck_reason'] = $recheck_reason;
|
||||
|
||||
$query_string = '';
|
||||
foreach ( $c as $key => $data )
|
||||
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
|
||||
|
||||
$response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
|
||||
return ( is_array( $response ) && isset( $response[1] ) ) ? $response[1] : false;
|
||||
}
|
||||
|
||||
function akismet_cron_recheck() {
|
||||
global $wpdb;
|
||||
|
||||
$status = akismet_verify_key( akismet_get_key() );
|
||||
if ( get_option( 'akismet_alert_code' ) || $status == 'invalid' ) {
|
||||
// since there is currently a problem with the key, reschedule a check for 6 hours hence
|
||||
wp_schedule_single_event( time() + 21600, 'akismet_schedule_cron_recheck' );
|
||||
return false;
|
||||
}
|
||||
|
||||
delete_option('akismet_available_servers');
|
||||
|
||||
$comment_errors = $wpdb->get_col( "
|
||||
SELECT comment_id
|
||||
FROM {$wpdb->prefix}commentmeta
|
||||
WHERE meta_key = 'akismet_error'
|
||||
LIMIT 100
|
||||
" );
|
||||
|
||||
foreach ( (array) $comment_errors as $comment_id ) {
|
||||
// if the comment no longer exists, or is too old, remove the meta entry from the queue to avoid getting stuck
|
||||
$comment = get_comment( $comment_id );
|
||||
if ( !$comment || strtotime( $comment->comment_date_gmt ) < strtotime( "-15 days" ) ) {
|
||||
delete_comment_meta( $comment_id, 'akismet_error' );
|
||||
continue;
|
||||
}
|
||||
|
||||
add_comment_meta( $comment_id, 'akismet_rechecking', true );
|
||||
$status = akismet_check_db_comment( $comment_id, 'retry' );
|
||||
|
||||
$msg = '';
|
||||
if ( $status == 'true' ) {
|
||||
$msg = __( 'Akismet caught this comment as spam during an automatic retry.' );
|
||||
} elseif ( $status == 'false' ) {
|
||||
$msg = __( 'Akismet cleared this comment during an automatic retry.' );
|
||||
}
|
||||
|
||||
// If we got back a legit response then update the comment history
|
||||
// other wise just bail now and try again later. No point in
|
||||
// re-trying all the comments once we hit one failure.
|
||||
if ( !empty( $msg ) ) {
|
||||
delete_comment_meta( $comment_id, 'akismet_error' );
|
||||
akismet_update_comment_history( $comment_id, $msg, 'cron-retry' );
|
||||
update_comment_meta( $comment_id, 'akismet_result', $status );
|
||||
// make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.
|
||||
$comment = get_comment( $comment_id );
|
||||
if ( $comment && 'unapproved' == wp_get_comment_status( $comment_id ) ) {
|
||||
if ( $status == 'true' ) {
|
||||
wp_spam_comment( $comment_id );
|
||||
} elseif ( $status == 'false' ) {
|
||||
// comment is good, but it's still in the pending queue. depending on the moderation settings
|
||||
// we may need to change it to approved.
|
||||
if ( check_comment($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent, $comment->comment_type) )
|
||||
wp_set_comment_status( $comment_id, 1 );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
delete_comment_meta( $comment_id, 'akismet_rechecking' );
|
||||
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
||||
return;
|
||||
}
|
||||
delete_comment_meta( $comment_id, 'akismet_rechecking' );
|
||||
}
|
||||
|
||||
$remaining = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE meta_key = 'akismet_error'" );
|
||||
if ( $remaining && !wp_next_scheduled('akismet_schedule_cron_recheck') ) {
|
||||
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
||||
}
|
||||
}
|
||||
add_action( 'akismet_schedule_cron_recheck', 'akismet_cron_recheck' );
|
||||
|
||||
function akismet_add_comment_nonce( $post_id ) {
|
||||
echo '<p style="display: none;">';
|
||||
wp_nonce_field( 'akismet_comment_nonce_' . $post_id, 'akismet_comment_nonce', FALSE );
|
||||
echo '</p>';
|
||||
}
|
||||
|
||||
$akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
|
||||
|
||||
if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' )
|
||||
add_action( 'comment_form', 'akismet_add_comment_nonce' );
|
||||
|
||||
global $wp_version;
|
||||
if ( '3.0.5' == $wp_version ) {
|
||||
remove_filter( 'comment_text', 'wp_kses_data' );
|
||||
if ( is_admin() )
|
||||
add_filter( 'comment_text', 'wp_kses_post' );
|
||||
}
|
||||
|
||||
function akismet_fix_scheduled_recheck() {
|
||||
$future_check = wp_next_scheduled( 'akismet_schedule_cron_recheck' );
|
||||
if ( !$future_check ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( get_option( 'akismet_alert_code' ) > 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$check_range = time() + 1200;
|
||||
if ( $future_check > $check_range ) {
|
||||
wp_clear_scheduled_hook( 'akismet_schedule_cron_recheck' );
|
||||
wp_schedule_single_event( time() + 300, 'akismet_schedule_cron_recheck' );
|
||||
}
|
||||
}
|
2
wp-content/plugins/akismet/index.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
# Silence is golden.
|
396
wp-content/plugins/akismet/legacy.php
Normal file
@ -0,0 +1,396 @@
|
||||
<?php
|
||||
|
||||
function akismet_spam_comments( $type = false, $page = 1, $per_page = 50 ) {
|
||||
global $wpdb;
|
||||
|
||||
$page = (int) $page;
|
||||
if ( $page < 2 )
|
||||
$page = 1;
|
||||
|
||||
$per_page = (int) $per_page;
|
||||
if ( $per_page < 1 )
|
||||
$per_page = 50;
|
||||
|
||||
$start = ( $page - 1 ) * $per_page;
|
||||
$end = $start + $per_page;
|
||||
|
||||
if ( $type ) {
|
||||
if ( 'comments' == $type || 'comment' == $type )
|
||||
$type = '';
|
||||
else
|
||||
$type = $wpdb->escape( $type );
|
||||
return $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type' ORDER BY comment_date DESC LIMIT $start, $end");
|
||||
}
|
||||
|
||||
// All
|
||||
return $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT $start, $end");
|
||||
}
|
||||
|
||||
// Totals for each comment type
|
||||
// returns array( type => count, ... )
|
||||
function akismet_spam_totals() {
|
||||
global $wpdb;
|
||||
$totals = $wpdb->get_results( "SELECT comment_type, COUNT(*) AS cc FROM $wpdb->comments WHERE comment_approved = 'spam' GROUP BY comment_type" );
|
||||
$return = array();
|
||||
foreach ( $totals as $total )
|
||||
$return[$total->comment_type ? $total->comment_type : 'comment'] = $total->cc;
|
||||
return $return;
|
||||
}
|
||||
|
||||
function akismet_manage_page() {
|
||||
global $wpdb, $submenu, $wp_db_version;
|
||||
|
||||
// WP 2.7 has its own spam management page
|
||||
if ( 8645 <= $wp_db_version )
|
||||
return;
|
||||
|
||||
$count = sprintf(__('Akismet Spam (%s)'), akismet_spam_count());
|
||||
if ( isset( $submenu['edit-comments.php'] ) )
|
||||
add_submenu_page('edit-comments.php', __('Akismet Spam'), $count, 'moderate_comments', 'akismet-admin', 'akismet_caught' );
|
||||
elseif ( function_exists('add_management_page') )
|
||||
add_management_page(__('Akismet Spam'), $count, 'moderate_comments', 'akismet-admin', 'akismet_caught');
|
||||
}
|
||||
|
||||
function akismet_caught() {
|
||||
global $wpdb, $comment, $akismet_caught, $akismet_nonce;
|
||||
|
||||
akismet_recheck_queue();
|
||||
if (isset($_POST['submit']) && 'recover' == $_POST['action'] && ! empty($_POST['not_spam'])) {
|
||||
check_admin_referer( $akismet_nonce );
|
||||
if ( function_exists('current_user_can') && !current_user_can('moderate_comments') )
|
||||
die(__('You do not have sufficient permission to moderate comments.'));
|
||||
|
||||
$i = 0;
|
||||
foreach ($_POST['not_spam'] as $comment):
|
||||
$comment = (int) $comment;
|
||||
if ( function_exists('wp_set_comment_status') )
|
||||
wp_set_comment_status($comment, 'approve');
|
||||
else
|
||||
$wpdb->query("UPDATE $wpdb->comments SET comment_approved = '1' WHERE comment_ID = '$comment'");
|
||||
akismet_submit_nonspam_comment($comment);
|
||||
++$i;
|
||||
endforeach;
|
||||
$to = add_query_arg( 'recovered', $i, $_SERVER['HTTP_REFERER'] );
|
||||
wp_safe_redirect( $to );
|
||||
exit;
|
||||
}
|
||||
if ('delete' == $_POST['action']) {
|
||||
check_admin_referer( $akismet_nonce );
|
||||
if ( function_exists('current_user_can') && !current_user_can('moderate_comments') )
|
||||
die(__('You do not have sufficient permission to moderate comments.'));
|
||||
|
||||
$delete_time = $wpdb->escape( $_POST['display_time'] );
|
||||
$comment_ids = $wpdb->get_col( "SELECT comment_id FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" );
|
||||
if ( !empty( $comment_ids ) ) {
|
||||
do_action( 'delete_comment', $comment_ids );
|
||||
$wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_id IN ( " . implode( ', ', $comment_ids ) . " )");
|
||||
wp_cache_delete( 'akismet_spam_count', 'widget' );
|
||||
}
|
||||
$to = add_query_arg( 'deleted', 'all', $_SERVER['HTTP_REFERER'] );
|
||||
wp_safe_redirect( $to );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( isset( $_GET['recovered'] ) ) {
|
||||
$i = (int) $_GET['recovered'];
|
||||
echo '<div class="updated"><p>' . sprintf(__('%1$s comments recovered.'), $i) . "</p></div>";
|
||||
}
|
||||
|
||||
if (isset( $_GET['deleted'] ) )
|
||||
echo '<div class="updated"><p>' . __('All spam deleted.') . '</p></div>';
|
||||
|
||||
if ( isset( $GLOBALS['submenu']['edit-comments.php'] ) )
|
||||
$link = 'edit-comments.php';
|
||||
else
|
||||
$link = 'edit.php';
|
||||
?>
|
||||
<style type="text/css">
|
||||
.akismet-tabs {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
clear: both;
|
||||
border-bottom: 1px solid #ccc;
|
||||
height: 31px;
|
||||
margin-bottom: 20px;
|
||||
background: #ddd;
|
||||
border-top: 1px solid #bdbdbd;
|
||||
}
|
||||
.akismet-tabs li {
|
||||
float: left;
|
||||
margin: 5px 0 0 20px;
|
||||
}
|
||||
.akismet-tabs a {
|
||||
display: block;
|
||||
padding: 4px .5em 3px;
|
||||
border-bottom: none;
|
||||
color: #036;
|
||||
}
|
||||
.akismet-tabs .active a {
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom: none;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
#akismetsearch {
|
||||
float: right;
|
||||
margin-top: -.5em;
|
||||
}
|
||||
|
||||
#akismetsearch p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
<div class="wrap">
|
||||
<h2><?php _e('Caught Spam') ?></h2>
|
||||
<?php
|
||||
$count = get_option( 'akismet_spam_count' );
|
||||
if ( $count ) {
|
||||
?>
|
||||
<p><?php printf(__('Akismet has caught <strong>%1$s spam</strong> for you since you first installed it.'), number_format_i18n($count) ); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
$spam_count = akismet_spam_count();
|
||||
|
||||
if ( 0 == $spam_count ) {
|
||||
echo '<p>'.__('You have no spam currently in the queue. Must be your lucky day. :)').'</p>';
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<p>'.__('You can delete all of the spam from your database with a single click. This operation cannot be undone, so you may wish to check to ensure that no legitimate comments got through first. Spam is automatically deleted after 15 days, so don’t sweat it.').'</p>';
|
||||
?>
|
||||
<?php if ( !isset( $_POST['s'] ) ) { ?>
|
||||
<form method="post" action="<?php echo attribute_escape( add_query_arg( 'noheader', 'true' ) ); ?>">
|
||||
<?php akismet_nonce_field($akismet_nonce) ?>
|
||||
<input type="hidden" name="action" value="delete" />
|
||||
<?php printf(__('There are currently %1$s comments identified as spam.'), $spam_count); ?> <input type="submit" class="button delete" name="Submit" value="<?php _e('Delete all'); ?>" />
|
||||
<input type="hidden" name="display_time" value="<?php echo current_time('mysql', 1); ?>" />
|
||||
</form>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="wrap">
|
||||
<?php if ( isset( $_POST['s'] ) ) { ?>
|
||||
<h2><?php _e('Search'); ?></h2>
|
||||
<?php } else { ?>
|
||||
<?php echo '<p>'.__('These are the latest comments identified as spam by Akismet. If you see any mistakes, simply mark the comment as "not spam" and Akismet will learn from the submission. If you wish to recover a comment from spam, simply select the comment, and click Not Spam. After 15 days we clean out the junk for you.').'</p>'; ?>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if ( isset( $_POST['s'] ) ) {
|
||||
$s = $wpdb->escape($_POST['s']);
|
||||
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE
|
||||
(comment_author LIKE '%$s%' OR
|
||||
comment_author_email LIKE '%$s%' OR
|
||||
comment_author_url LIKE ('%$s%') OR
|
||||
comment_author_IP LIKE ('%$s%') OR
|
||||
comment_content LIKE ('%$s%') ) AND
|
||||
comment_approved = 'spam'
|
||||
ORDER BY comment_date DESC");
|
||||
} else {
|
||||
if ( isset( $_GET['apage'] ) )
|
||||
$page = (int) $_GET['apage'];
|
||||
else
|
||||
$page = 1;
|
||||
|
||||
if ( $page < 2 )
|
||||
$page = 1;
|
||||
|
||||
$current_type = false;
|
||||
if ( isset( $_GET['ctype'] ) )
|
||||
$current_type = preg_replace( '|[^a-z]|', '', $_GET['ctype'] );
|
||||
|
||||
$comments = akismet_spam_comments( $current_type, $page );
|
||||
$total = akismet_spam_count( $current_type );
|
||||
$totals = akismet_spam_totals();
|
||||
?>
|
||||
<ul class="akismet-tabs">
|
||||
<li <?php if ( !isset( $_GET['ctype'] ) ) echo ' class="active"'; ?>><a href="edit-comments.php?page=akismet-admin"><?php _e('All'); ?></a></li>
|
||||
<?php
|
||||
foreach ( $totals as $type => $type_count ) {
|
||||
if ( 'comment' == $type ) {
|
||||
$type = 'comments';
|
||||
$show = __('Comments');
|
||||
} else {
|
||||
$show = ucwords( $type );
|
||||
}
|
||||
$type_count = number_format_i18n( $type_count );
|
||||
$extra = $current_type === $type ? ' class="active"' : '';
|
||||
echo "<li $extra><a href='edit-comments.php?page=akismet-admin&ctype=$type'>$show ($type_count)</a></li>";
|
||||
}
|
||||
do_action( 'akismet_tabs' ); // so plugins can add more tabs easily
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($comments) {
|
||||
?>
|
||||
<form method="post" action="<?php echo attribute_escape("$link?page=akismet-admin"); ?>" id="akismetsearch">
|
||||
<p> <input type="text" name="s" value="<?php if (isset($_POST['s'])) echo attribute_escape($_POST['s']); ?>" size="17" />
|
||||
<input type="submit" class="button" name="submit" value="<?php echo attribute_escape(__('Search Spam »')) ?>" /> </p>
|
||||
</form>
|
||||
<?php if ( $total > 50 ) {
|
||||
$total_pages = ceil( $total / 50 );
|
||||
$r = '';
|
||||
if ( 1 < $page ) {
|
||||
$args['apage'] = ( 1 == $page - 1 ) ? '' : $page - 1;
|
||||
$r .= '<a class="prev" href="' . clean_url(add_query_arg( $args )) . '">'. __('« Previous Page') .'</a>' . "\n";
|
||||
}
|
||||
if ( ( $total_pages = ceil( $total / 50 ) ) > 1 ) {
|
||||
for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) :
|
||||
if ( $page == $page_num ) :
|
||||
$r .= "<strong>$page_num</strong>\n";
|
||||
else :
|
||||
$p = false;
|
||||
if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) :
|
||||
$args['apage'] = ( 1 == $page_num ) ? '' : $page_num;
|
||||
$r .= '<a class="page-numbers" href="' . clean_url(add_query_arg($args)) . '">' . ( $page_num ) . "</a>\n";
|
||||
$in = true;
|
||||
elseif ( $in == true ) :
|
||||
$r .= "...\n";
|
||||
$in = false;
|
||||
endif;
|
||||
endif;
|
||||
endfor;
|
||||
}
|
||||
if ( ( $page ) * 50 < $total || -1 == $total ) {
|
||||
$args['apage'] = $page + 1;
|
||||
$r .= '<a class="next" href="' . clean_url(add_query_arg($args)) . '">'. __('Next Page »') .'</a>' . "\n";
|
||||
}
|
||||
echo "<p>$r</p>";
|
||||
?>
|
||||
|
||||
<?php } ?>
|
||||
<form style="clear: both;" method="post" action="<?php echo attribute_escape( add_query_arg( 'noheader', 'true' ) ); ?>">
|
||||
<?php akismet_nonce_field($akismet_nonce) ?>
|
||||
<input type="hidden" name="action" value="recover" />
|
||||
<ul id="spam-list" class="commentlist" style="list-style: none; margin: 0; padding: 0;">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach($comments as $comment) {
|
||||
$i++;
|
||||
$comment_date = mysql2date(get_option("date_format") . " @ " . get_option("time_format"), $comment->comment_date);
|
||||
$post = get_post($comment->comment_post_ID);
|
||||
$post_title = $post->post_title;
|
||||
if ($i % 2) $class = 'class="alternate"';
|
||||
else $class = '';
|
||||
echo "\n\t<li id='comment-$comment->comment_ID' $class>";
|
||||
?>
|
||||
|
||||
<p><strong><?php comment_author() ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
|
||||
|
||||
<?php comment_text() ?>
|
||||
|
||||
<p><label for="spam-<?php echo $comment->comment_ID; ?>">
|
||||
<input type="checkbox" id="spam-<?php echo $comment->comment_ID; ?>" name="not_spam[]" value="<?php echo $comment->comment_ID; ?>" />
|
||||
<?php _e('Not Spam') ?></label> — <?php comment_date('M j, g:i A'); ?> — [
|
||||
<?php
|
||||
$post = get_post($comment->comment_post_ID);
|
||||
$post_title = wp_specialchars( $post->post_title, 'double' );
|
||||
$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
|
||||
?>
|
||||
<a href="<?php echo get_permalink($comment->comment_post_ID); ?>" title="<?php echo $post_title; ?>"><?php _e('View Post') ?></a> ] </p>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php if ( $total > 50 ) {
|
||||
$total_pages = ceil( $total / 50 );
|
||||
$r = '';
|
||||
if ( 1 < $page ) {
|
||||
$args['apage'] = ( 1 == $page - 1 ) ? '' : $page - 1;
|
||||
$r .= '<a class="prev" href="' . clean_url(add_query_arg( $args )) . '">'. __('« Previous Page') .'</a>' . "\n";
|
||||
}
|
||||
if ( ( $total_pages = ceil( $total / 50 ) ) > 1 ) {
|
||||
for ( $page_num = 1; $page_num <= $total_pages; $page_num++ ) :
|
||||
if ( $page == $page_num ) :
|
||||
$r .= "<strong>$page_num</strong>\n";
|
||||
else :
|
||||
$p = false;
|
||||
if ( $page_num < 3 || ( $page_num >= $page - 3 && $page_num <= $page + 3 ) || $page_num > $total_pages - 3 ) :
|
||||
$args['apage'] = ( 1 == $page_num ) ? '' : $page_num;
|
||||
$r .= '<a class="page-numbers" href="' . clean_url(add_query_arg($args)) . '">' . ( $page_num ) . "</a>\n";
|
||||
$in = true;
|
||||
elseif ( $in == true ) :
|
||||
$r .= "...\n";
|
||||
$in = false;
|
||||
endif;
|
||||
endif;
|
||||
endfor;
|
||||
}
|
||||
if ( ( $page ) * 50 < $total || -1 == $total ) {
|
||||
$args['apage'] = $page + 1;
|
||||
$r .= '<a class="next" href="' . clean_url(add_query_arg($args)) . '">'. __('Next Page »') .'</a>' . "\n";
|
||||
}
|
||||
echo "<p>$r</p>";
|
||||
}
|
||||
?>
|
||||
<p class="submit">
|
||||
<input type="submit" name="submit" value="<?php echo attribute_escape(__('De-spam marked comments »')); ?>" />
|
||||
</p>
|
||||
<p><?php _e('Comments you de-spam will be submitted to Akismet as mistakes so it can learn and get better.'); ?></p>
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<p><?php _e('No results found.'); ?></p>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( !isset( $_POST['s'] ) ) { ?>
|
||||
<form method="post" action="<?php echo attribute_escape( add_query_arg( 'noheader', 'true' ) ); ?>">
|
||||
<?php akismet_nonce_field($akismet_nonce) ?>
|
||||
<p><input type="hidden" name="action" value="delete" />
|
||||
<?php printf(__('There are currently %1$s comments identified as spam.'), $spam_count); ?> <input type="submit" name="Submit" class="button" value="<?php echo attribute_escape(__('Delete all')); ?>" />
|
||||
<input type="hidden" name="display_time" value="<?php echo current_time('mysql', 1); ?>" /></p>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
add_action('admin_menu', 'akismet_manage_page');
|
||||
|
||||
function redirect_old_akismet_urls( ) {
|
||||
global $wp_db_version;
|
||||
$script_name = array_pop( split( '/', $_SERVER['PHP_SELF'] ) );
|
||||
|
||||
$page = '';
|
||||
if ( !empty( $_GET['page'] ) )
|
||||
$page = $_GET['page'];
|
||||
|
||||
// 2.7 redirect for people who might have bookmarked the old page
|
||||
if ( 8204 < $wp_db_version && ( 'edit-comments.php' == $script_name || 'edit.php' == $script_name ) && 'akismet-admin' == $page ) {
|
||||
$new_url = esc_url( 'edit-comments.php?comment_status=spam' );
|
||||
wp_safe_redirect( $new_url, 301 );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
add_action( 'admin_init', 'redirect_old_akismet_urls' );
|
||||
|
||||
// For WP <= 2.3.x
|
||||
global $pagenow;
|
||||
|
||||
if ( 'moderation.php' == $pagenow ) {
|
||||
function akismet_recheck_button( $page ) {
|
||||
global $submenu;
|
||||
if ( isset( $submenu['edit-comments.php'] ) )
|
||||
$link = 'edit-comments.php';
|
||||
else
|
||||
$link = 'edit.php';
|
||||
$button = "<a href='$link?page=akismet-admin&recheckqueue=true&noheader=true' style='display: block; width: 100px; position: absolute; right: 7%; padding: 5px; font-size: 14px; text-decoration: underline; background: #fff; border: 1px solid #ccc;'>" . __('Recheck Queue for Spam') . "</a>";
|
||||
$page = str_replace( '<div class="wrap">', '<div class="wrap">' . $button, $page );
|
||||
return $page;
|
||||
}
|
||||
|
||||
if ( $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'" ) )
|
||||
ob_start( 'akismet_recheck_button' );
|
||||
}
|
||||
|
||||
// This option causes tons of FPs, was removed in 2.1
|
||||
function akismet_kill_proxy_check( $option ) { return 0; }
|
||||
add_filter('option_open_proxy_check', 'akismet_kill_proxy_check');
|
167
wp-content/plugins/akismet/readme.txt
Normal file
@ -0,0 +1,167 @@
|
||||
=== Akismet ===
|
||||
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, automattic
|
||||
Tags: akismet, comments, spam
|
||||
Requires at least: 3.0
|
||||
Tested up to: 3.6
|
||||
Stable tag: 2.5.8
|
||||
License: GPLv2 or later
|
||||
|
||||
Akismet checks your comments against the Akismet web service to see if they look like spam or not.
|
||||
|
||||
== Description ==
|
||||
|
||||
Akismet checks your comments against the Akismet web service to see if they look like spam or not and lets you
|
||||
review the spam it catches under your blog's "Comments" admin screen.
|
||||
|
||||
Major new features in Akismet 2.5 include:
|
||||
|
||||
* A comment status history, so you can easily see which comments were caught or cleared by Akismet, and which were spammed or unspammed by a moderator
|
||||
* Links are highlighted in the comment body, to reveal hidden or misleading links
|
||||
* If your web host is unable to reach Akismet's servers, the plugin will automatically retry when your connection is back up
|
||||
* Moderators can see the number of approved comments for each user
|
||||
* Spam and Unspam reports now include more information, to help improve accuracy
|
||||
|
||||
PS: You'll need an [Akismet.com API key](http://akismet.com/get/) to use it. Keys are free for personal blogs, with paid subscriptions available for businesses and commercial sites.
|
||||
|
||||
== Installation ==
|
||||
|
||||
Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.com API key](http://akismet.com/get/).
|
||||
|
||||
1, 2, 3: You're done!
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.5.8 =
|
||||
* Simplify the activation process for new users
|
||||
* Remove the reporter_ip parameter
|
||||
* Minor preventative security improvements
|
||||
|
||||
= 2.5.7 =
|
||||
* FireFox Stats iframe preview bug
|
||||
* Fix mshots preview when using https
|
||||
* Add .htaccess to block direct access to files
|
||||
* Prevent some PHP notices
|
||||
* Fix Check For Spam return location when referrer is empty
|
||||
* Fix Settings links for network admins
|
||||
* Fix prepare() warnings in WP 3.5
|
||||
|
||||
= 2.5.6 =
|
||||
* Prevent retry scheduling problems on sites where wp_cron is misbehaving
|
||||
* Preload mshot previews
|
||||
* Modernize the widget code
|
||||
* Fix a bug where comments were not held for moderation during an error condition
|
||||
* Improve the UX and display when comments are temporarily held due to an error
|
||||
* Make the Check For Spam button force a retry when comments are held due to an error
|
||||
* Handle errors caused by an invalid key
|
||||
* Don't retry comments that are too old
|
||||
* Improve error messages when verifying an API key
|
||||
|
||||
= 2.5.5 =
|
||||
* Add nonce check for comment author URL remove action
|
||||
* Fix the settings link
|
||||
|
||||
= 2.5.4 =
|
||||
* Limit Akismet CSS and Javascript loading in wp-admin to just the pages that need it
|
||||
* Added author URL quick removal functionality
|
||||
* Added mShot preview on Author URL hover
|
||||
* Added empty index.php to prevent directory listing
|
||||
* Move wp-admin menu items under Jetpack, if it is installed
|
||||
* Purge old Akismet comment meta data, default of 15 days
|
||||
|
||||
= 2.5.3 =
|
||||
* Specify the license is GPL v2 or later
|
||||
* Fix a bug that could result in orphaned commentmeta entries
|
||||
* Include hotfix for WordPress 3.0.5 filter issue
|
||||
|
||||
= 2.5.2 =
|
||||
|
||||
* Properly format the comment count for author counts
|
||||
* Look for super admins on multisite installs when looking up user roles
|
||||
* Increase the HTTP request timeout
|
||||
* Removed padding for author approved count
|
||||
* Fix typo in function name
|
||||
* Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
|
||||
|
||||
= 2.5.1 =
|
||||
|
||||
* Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
|
||||
* Remove the comment nonce form field from the 'Akismet Configuration' page in favor of using a filter, akismet_comment_nonce
|
||||
* Fixed padding bug in "author" column of posts screen
|
||||
* Added margin-top to "cleared by ..." badges on dashboard
|
||||
* Fix possible error when calling akismet_cron_recheck()
|
||||
* Fix more PHP warnings
|
||||
* Clean up XHTML warnings for comment nonce
|
||||
* Fix for possible condition where scheduled comment re-checks could get stuck
|
||||
* Clean up the comment meta details after deleting a comment
|
||||
* Only show the status badge if the comment status has been changed by someone/something other than Akismet
|
||||
* Show a 'History' link in the row-actions
|
||||
* Translation fixes
|
||||
* Reduced font-size on author name
|
||||
* Moved "flagged by..." notification to top right corner of comment container and removed heavy styling
|
||||
* Hid "flagged by..." notification while on dashboard
|
||||
|
||||
= 2.5.0 =
|
||||
|
||||
* Track comment actions under 'Akismet Status' on the edit comment screen
|
||||
* Fix a few remaining deprecated function calls ( props Mike Glendinning )
|
||||
* Use HTTPS for the stats IFRAME when wp-admin is using HTTPS
|
||||
* Use the WordPress HTTP class if available
|
||||
* Move the admin UI code to a separate file, only loaded when needed
|
||||
* Add cron retry feature, to replace the old connectivity check
|
||||
* Display Akismet status badge beside each comment
|
||||
* Record history for each comment, and display it on the edit page
|
||||
* Record the complete comment as originally submitted in comment_meta, to use when reporting spam and ham
|
||||
* Highlight links in comment content
|
||||
* New option, "Show the number of comments you've approved beside each comment author."
|
||||
* New option, "Use a nonce on the comment form."
|
||||
|
||||
= 2.4.0 =
|
||||
|
||||
* Spell out that the license is GPLv2
|
||||
* Fix PHP warnings
|
||||
* Fix WordPress deprecated function calls
|
||||
* Fire the delete_comment action when deleting comments
|
||||
* Move code specific for older WP versions to legacy.php
|
||||
* General code clean up
|
||||
|
||||
= 2.3.0 =
|
||||
|
||||
* Fix "Are you sure" nonce message on config screen in WPMU
|
||||
* Fix XHTML compliance issue in sidebar widget
|
||||
* Change author link; remove some old references to WordPress.com accounts
|
||||
* Localize the widget title (core ticket #13879)
|
||||
|
||||
= 2.2.9 =
|
||||
|
||||
* Eliminate a potential conflict with some plugins that may cause spurious reports
|
||||
|
||||
= 2.2.8 =
|
||||
|
||||
* Fix bug in initial comment check for ipv6 addresses
|
||||
* Report comments as ham when they are moved from spam to moderation
|
||||
* Report comments as ham when clicking undo after spam
|
||||
* Use transition_comment_status action when available instead of older actions for spam/ham submissions
|
||||
* Better diagnostic messages when PHP network functions are unavailable
|
||||
* Better handling of comments by logged-in users
|
||||
|
||||
= 2.2.7 =
|
||||
|
||||
* Add a new AKISMET_VERSION constant
|
||||
* Reduce the possibility of over-counting spam when another spam filter plugin is in use
|
||||
* Disable the connectivity check when the API key is hard-coded for WPMU
|
||||
|
||||
= 2.2.6 =
|
||||
|
||||
* Fix a global warning introduced in 2.2.5
|
||||
* Add changelog and additional readme.txt tags
|
||||
* Fix an array conversion warning in some versions of PHP
|
||||
* Support a new WPCOM_API_KEY constant for easier use with WordPress MU
|
||||
|
||||
= 2.2.5 =
|
||||
|
||||
* Include a new Server Connectivity diagnostic check, to detect problems caused by firewalls
|
||||
|
||||
= 2.2.4 =
|
||||
|
||||
* Fixed a key problem affecting the stats feature in WordPress MU
|
||||
* Provide additional blog information in Akismet API calls
|
108
wp-content/plugins/akismet/widget.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Akismet
|
||||
*/
|
||||
class Akismet_Widget extends WP_Widget {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct(
|
||||
'akismet_widget',
|
||||
__( 'Akismet Widget' ),
|
||||
array( 'description' => __( 'Display the number of spam comments Akismet has caught' ) )
|
||||
);
|
||||
|
||||
if ( is_active_widget( false, false, $this->id_base ) ) {
|
||||
add_action( 'wp_head', array( $this, 'css' ) );
|
||||
}
|
||||
}
|
||||
|
||||
function css() {
|
||||
?>
|
||||
|
||||
<style type="text/css">
|
||||
.a-stats {
|
||||
width: auto;
|
||||
}
|
||||
.a-stats a {
|
||||
background: #7CA821;
|
||||
background-image:-moz-linear-gradient(0% 100% 90deg,#5F8E14,#7CA821);
|
||||
background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#7CA821),to(#5F8E14));
|
||||
border: 1px solid #5F8E14;
|
||||
border-radius:3px;
|
||||
color: #CFEA93;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-weight: normal;
|
||||
height: 100%;
|
||||
-moz-border-radius:3px;
|
||||
padding: 7px 0 8px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
-webkit-border-radius:3px;
|
||||
width: 100%;
|
||||
}
|
||||
.a-stats a:hover {
|
||||
text-decoration: none;
|
||||
background-image:-moz-linear-gradient(0% 100% 90deg,#6F9C1B,#659417);
|
||||
background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#659417),to(#6F9C1B));
|
||||
}
|
||||
.a-stats .count {
|
||||
color: #FFF;
|
||||
display: block;
|
||||
font-size: 15px;
|
||||
line-height: 16px;
|
||||
padding: 0 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function form( $instance ) {
|
||||
if ( $instance ) {
|
||||
$title = esc_attr( $instance['title'] );
|
||||
}
|
||||
else {
|
||||
$title = __( 'Spam Blocked' );
|
||||
}
|
||||
?>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />
|
||||
</p>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
function update( $new_instance, $old_instance ) {
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
return $instance;
|
||||
}
|
||||
|
||||
function widget( $args, $instance ) {
|
||||
$count = get_option( 'akismet_spam_count' );
|
||||
|
||||
echo $args['before_widget'];
|
||||
if ( ! empty( $instance['title'] ) ) {
|
||||
echo $args['before_title'];
|
||||
echo esc_html( $instance['title'] );
|
||||
echo $args['after_title'];
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="a-stats">
|
||||
<a href="http://akismet.com" target="_blank" title=""><?php printf( _n( '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count ), number_format_i18n( $count ) ); ?></a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
echo $args['after_widget'];
|
||||
}
|
||||
}
|
||||
|
||||
function akismet_register_widgets() {
|
||||
register_widget( 'Akismet_Widget' );
|
||||
}
|
||||
|
||||
add_action( 'widgets_init', 'akismet_register_widgets' );
|
82
wp-content/plugins/hello.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Hello_Dolly
|
||||
* @version 1.6
|
||||
*/
|
||||
/*
|
||||
Plugin Name: Hello Dolly
|
||||
Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/
|
||||
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
|
||||
Author: Matt Mullenweg
|
||||
Version: 1.6
|
||||
Author URI: http://ma.tt/
|
||||
*/
|
||||
|
||||
function hello_dolly_get_lyric() {
|
||||
/** These are the lyrics to Hello Dolly */
|
||||
$lyrics = "Hello, Dolly
|
||||
Well, hello, Dolly
|
||||
It's so nice to have you back where you belong
|
||||
You're lookin' swell, Dolly
|
||||
I can tell, Dolly
|
||||
You're still glowin', you're still crowin'
|
||||
You're still goin' strong
|
||||
We feel the room swayin'
|
||||
While the band's playin'
|
||||
One of your old favourite songs from way back when
|
||||
So, take her wrap, fellas
|
||||
Find her an empty lap, fellas
|
||||
Dolly'll never go away again
|
||||
Hello, Dolly
|
||||
Well, hello, Dolly
|
||||
It's so nice to have you back where you belong
|
||||
You're lookin' swell, Dolly
|
||||
I can tell, Dolly
|
||||
You're still glowin', you're still crowin'
|
||||
You're still goin' strong
|
||||
We feel the room swayin'
|
||||
While the band's playin'
|
||||
One of your old favourite songs from way back when
|
||||
Golly, gee, fellas
|
||||
Find her a vacant knee, fellas
|
||||
Dolly'll never go away
|
||||
Dolly'll never go away
|
||||
Dolly'll never go away again";
|
||||
|
||||
// Here we split it into lines
|
||||
$lyrics = explode( "\n", $lyrics );
|
||||
|
||||
// And then randomly choose a line
|
||||
return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
|
||||
}
|
||||
|
||||
// This just echoes the chosen line, we'll position it later
|
||||
function hello_dolly() {
|
||||
$chosen = hello_dolly_get_lyric();
|
||||
echo "<p id='dolly'>$chosen</p>";
|
||||
}
|
||||
|
||||
// Now we set that function up to execute when the admin_notices action is called
|
||||
add_action( 'admin_notices', 'hello_dolly' );
|
||||
|
||||
// We need some CSS to position the paragraph
|
||||
function dolly_css() {
|
||||
// This makes sure that the positioning is also good for right-to-left languages
|
||||
$x = is_rtl() ? 'left' : 'right';
|
||||
|
||||
echo "
|
||||
<style type='text/css'>
|
||||
#dolly {
|
||||
float: $x;
|
||||
padding-$x: 15px;
|
||||
padding-top: 5px;
|
||||
margin: 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
";
|
||||
}
|
||||
|
||||
add_action( 'admin_head', 'dolly_css' );
|
||||
|
||||
?>
|
3
wp-content/plugins/index.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
?>
|
BIN
wp-content/plugins/revslider/.DS_Store
vendored
Normal file
BIN
wp-content/plugins/revslider/cache/slide11_100x50_exact_uploads-2012-11.jpg
vendored
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
wp-content/plugins/revslider/cache/slide11_200x100_exact_uploads-2012-11.jpg
vendored
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
wp-content/plugins/revslider/cache/slide2_200x100_exact_uploads-2012-11.jpg
vendored
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
wp-content/plugins/revslider/cache/slide3_100x50_exact_uploads-2012-11.jpg
vendored
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
wp-content/plugins/revslider/cache/slide3_200x100_exact_uploads-2012-11.jpg
vendored
Normal file
After Width: | Height: | Size: 3.3 KiB |
1300
wp-content/plugins/revslider/css/admin.css
Normal file
615
wp-content/plugins/revslider/css/edit_layers.css
Normal file
@ -0,0 +1,615 @@
|
||||
|
||||
.edit_slide_wrapper .timeline {
|
||||
width:410px;
|
||||
height:10px;
|
||||
background:url(../images/timeline.png) repeat-x 0px 0px;
|
||||
position:relative;
|
||||
|
||||
margin:20px 20px 40px;
|
||||
|
||||
z-index:10;
|
||||
}
|
||||
|
||||
.slide_layer .icon_cross{
|
||||
background-image:url(../images/cross.png);
|
||||
width:24px;
|
||||
height:24px;
|
||||
background-repeat:no-repeat;
|
||||
position:absolute;
|
||||
top:0px;
|
||||
left:0px;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||
filter: alpha(opacity=0);
|
||||
-moz-opacity: 0.0;
|
||||
-khtml-opacity: 0.0;
|
||||
opacity: 0.0;
|
||||
|
||||
}
|
||||
|
||||
.layer_selected .icon_cross {
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=8)";
|
||||
filter: alpha(opacity=8);
|
||||
-moz-opacity: 0.8;
|
||||
-khtml-opacity: 0.8;
|
||||
opacity: 0.8;
|
||||
|
||||
}
|
||||
|
||||
.edit_slide_wrapper .timeline .mintime {
|
||||
font-color:#777;
|
||||
font-size:10px;
|
||||
position:absolute;
|
||||
top:20px;
|
||||
left:-20px;
|
||||
white-space:no-wrap;
|
||||
width:40px; text-align:center;
|
||||
}
|
||||
|
||||
.edit_slide_wrapper .layertime {
|
||||
position:absolute;
|
||||
top:1px;
|
||||
height:9px;
|
||||
background:rgba(60,147,154,0.4);
|
||||
xwidth:300px;left:10px;
|
||||
display:none;
|
||||
}
|
||||
|
||||
.edit_slide_wrapper .layertime.layertime-error{
|
||||
background:rgba(157,23,23,0.4);
|
||||
}
|
||||
|
||||
|
||||
.edit_slide_wrapper .timeline .maxtime {
|
||||
font-color:#777;
|
||||
font-size:10px;
|
||||
position:absolute;
|
||||
top:20px;
|
||||
white-space:no-wrap;
|
||||
width:40px; text-align:center;
|
||||
right:-20px;
|
||||
}
|
||||
|
||||
.list-settings hr { width:100%;
|
||||
clear:both;
|
||||
border-top: 1px solid #DDD;
|
||||
border-bottom: 1px solid white;
|
||||
margin-bottom:0px;
|
||||
}
|
||||
|
||||
span.setting_text { line-height:24px;}
|
||||
|
||||
span.setting_text_2 { color:#ACA899;
|
||||
line-height: 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.edit_slide_wrapper .attribute_title {
|
||||
clear:both;padding-bottom:0px !important;
|
||||
}
|
||||
|
||||
/************************************************************/
|
||||
|
||||
.edit_layers_left{
|
||||
width:450px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.edit_layers_right{
|
||||
width:450px;
|
||||
float:left;
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
#link_slider_settings{
|
||||
font-size:18px;
|
||||
padding-left:50px;
|
||||
}
|
||||
|
||||
.edit_slide_wrapper .slide_layers{
|
||||
border:1px solid black;
|
||||
overflow:hidden;
|
||||
background-position:center center;
|
||||
background-repeat:no-repeat;
|
||||
position:relative;
|
||||
float:left;
|
||||
background-size:cover;
|
||||
}
|
||||
|
||||
.slide_layers.trans_bg{
|
||||
background-image:url(../images/trans_tile2.png) !important;
|
||||
background-repeat:repeat !important;
|
||||
background-size:cover;
|
||||
background-size:auto !important;
|
||||
}
|
||||
|
||||
|
||||
.edit_slide_wrapper .caption{
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.slide_layers .slide_layer{
|
||||
position:absolute;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
/* video layer */
|
||||
|
||||
.slide_layer .slide_layer_video{
|
||||
background-color:black;
|
||||
position:relative;
|
||||
background-repeat:no-repeat;
|
||||
background-position:center center;
|
||||
}
|
||||
|
||||
.slide_layer .video-layer-inner{
|
||||
height:100%;
|
||||
width:100%;
|
||||
background-repeat:no-repeat;
|
||||
background-position:right bottom;
|
||||
}
|
||||
|
||||
.slide_layer .video-icon-youtube{
|
||||
background-image:url(../images/icon_youtube.png);
|
||||
}
|
||||
|
||||
.slide_layer .video-icon-vimeo{
|
||||
background-image:url(../images/icon_vimeo.png);
|
||||
}
|
||||
|
||||
.slide_layer .video-icon-html5{
|
||||
background-image:url(../images/icon_html5.png);
|
||||
}
|
||||
|
||||
.slide_layer_video .layer-video-title{
|
||||
color:white;
|
||||
padding:10px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
|
||||
.ui-draggable{
|
||||
cursor:move;
|
||||
}
|
||||
|
||||
|
||||
.edit_layers_left .area-layer-params{
|
||||
width:415px;
|
||||
height:80px;
|
||||
}
|
||||
|
||||
.edit_layers_left .textbox-caption{
|
||||
width:170px;
|
||||
}
|
||||
|
||||
#layer_captions_down{
|
||||
margin-top:1px;
|
||||
width:26px;
|
||||
height:21px;
|
||||
float:left;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
#layer_captions_down span{
|
||||
margin-top:2px;
|
||||
margin-left:5px;
|
||||
}
|
||||
|
||||
#button_edit_css{
|
||||
float:right;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
|
||||
.edit_layers_left .setting_text{
|
||||
min-width:60px;
|
||||
}
|
||||
|
||||
.edit_layers_left .text-disabled{
|
||||
color:#ACA899;
|
||||
}
|
||||
|
||||
#divLayers .layer_selected{
|
||||
/* glow on selected */
|
||||
box-shadow: 0 0 8px #DDE573;
|
||||
-webkit-box-shadow: 0 0 8px #DDE573;
|
||||
-moz-box-shadow: 0 0 8px #DDE573;
|
||||
}
|
||||
|
||||
.layer_sortbox{
|
||||
width:460px;
|
||||
min-height:266px;
|
||||
}
|
||||
|
||||
.layer_sortbox input.sortbox_time, /* sortbox inputboxes */
|
||||
.layer_sortbox input.sortbox_depth
|
||||
{
|
||||
float:right;
|
||||
width:40px;
|
||||
background-color:#EBEBEB;
|
||||
border:1px solid #E0E0E0;
|
||||
color:#04076A;
|
||||
}
|
||||
|
||||
.layer_sortbox input.sortbox_depth{
|
||||
width:28px;
|
||||
cursor:default;
|
||||
}
|
||||
|
||||
.layer_sortbox .sortbox_eye{
|
||||
width:20px;
|
||||
height:14px;
|
||||
background:url(../images/eyes.png) no-repeat;
|
||||
float:right;
|
||||
margin-top:5px;
|
||||
margin-left:3px;
|
||||
margin-right:3px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.sortlist li.sortitem-hidden .sortbox_eye{
|
||||
/* IE 8 */
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
|
||||
/* IE 5-7 */
|
||||
filter: alpha(opacity=50);
|
||||
|
||||
/* Netscape */
|
||||
-moz-opacity: 0.5;
|
||||
|
||||
/* Safari 1.x */
|
||||
-khtml-opacity: 0.5;
|
||||
|
||||
/* Good browsers */
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.sortlist li.sortitem-hidden .sortbox_text{
|
||||
color:#B9A8B9;
|
||||
}
|
||||
|
||||
.sortlist li.sortitem-hidden{
|
||||
background-image:none;
|
||||
background-color:#FFF0E6;
|
||||
}
|
||||
|
||||
.sortlist{
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
.sortlist li span.ui-icon{
|
||||
float:right;
|
||||
margin-top:4px;
|
||||
}
|
||||
|
||||
.sortlist li{
|
||||
padding-left:4px;
|
||||
cursor:move;
|
||||
min-height:17px;
|
||||
}
|
||||
|
||||
.sortlist li .sortbox_text{
|
||||
display:block;
|
||||
float:left;
|
||||
padding-top:4px;
|
||||
padding-bottom:4px;
|
||||
}
|
||||
|
||||
/* ------ Layer Sorting Button ---- */
|
||||
|
||||
#button_sort_visibility{
|
||||
width:20px;
|
||||
height:14px;
|
||||
background:url(../images/eyes.png) no-repeat;
|
||||
cursor:pointer;
|
||||
float:right;
|
||||
margin-top:5px;
|
||||
margin-right:5px;
|
||||
margin-left:3px;
|
||||
}
|
||||
|
||||
#button_sort_visibility.e-disabled {
|
||||
/* IE 8 */
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
|
||||
/* IE 5-7 */
|
||||
filter: alpha(opacity=50);
|
||||
|
||||
/* Netscape */
|
||||
-moz-opacity: 0.5;
|
||||
|
||||
/* Safari 1.x */
|
||||
-khtml-opacity: 0.5;
|
||||
|
||||
/* Good browsers */
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
|
||||
.layer_sortbox .button_sorttype{
|
||||
width:70px;
|
||||
float:right;
|
||||
height:20px;
|
||||
text-align:center;
|
||||
margin-right:10px;
|
||||
margin-top:2px;
|
||||
}
|
||||
|
||||
.layer_sortbox .button_sorttype.ui-state-hover{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.layer_sortbox .button_sorttype.ui-state-active{
|
||||
cursor:default;
|
||||
}
|
||||
|
||||
.layer_sortbox .button_sorttype span{
|
||||
display:block;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
float:none;
|
||||
margin-top:3px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.slide_update_button_wrapper{
|
||||
float:left;
|
||||
width:110px;
|
||||
}
|
||||
|
||||
.slider_update_button_wrapper{
|
||||
float:left;
|
||||
width:115px;
|
||||
margin-top:2px;
|
||||
}
|
||||
|
||||
.slide_update_button_wrapper div{
|
||||
float:left;
|
||||
}
|
||||
|
||||
#button_save_slide{
|
||||
display:block;
|
||||
width:73px;
|
||||
margin:0px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
#button_close_slide{
|
||||
display:block;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.edit_layers_left .list_settings li .setting_text{
|
||||
min-width:70px;
|
||||
}
|
||||
|
||||
.setting-disabled{
|
||||
color:#B9A8B9;
|
||||
}
|
||||
|
||||
#layer_caption.setting-disabled{
|
||||
color:#B9A8B9;
|
||||
}
|
||||
|
||||
|
||||
/* ============================================= */
|
||||
/* Layer Form Position */
|
||||
/* ============================================= */
|
||||
|
||||
#layer_left_row{
|
||||
float:left;
|
||||
}
|
||||
|
||||
#layer_left_row .setting_text,
|
||||
#layer_top_row .setting_text{
|
||||
min-width:10px;
|
||||
width:10px;
|
||||
}
|
||||
|
||||
#layer_top_row{
|
||||
float:left;
|
||||
margin-left:15px;
|
||||
}
|
||||
|
||||
#button_edit_video_row{
|
||||
float:left;
|
||||
margin-right:10px;
|
||||
clear:left;
|
||||
}
|
||||
|
||||
#button_change_image_source_row{
|
||||
float:left;
|
||||
margin-right:10px;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
#button_edit_video{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
#layer_animation_row{
|
||||
clear:both;
|
||||
float:left;
|
||||
}
|
||||
|
||||
|
||||
#layer_easing_row{
|
||||
float:right;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
#layer_easing_row .setting_text{
|
||||
min-width:50px;
|
||||
width:50px;
|
||||
}
|
||||
|
||||
#layer_hidden_row{
|
||||
float:left;
|
||||
margin-left:0px;
|
||||
}
|
||||
|
||||
#layer_speed_row{
|
||||
clear:left;
|
||||
float:left;
|
||||
}
|
||||
|
||||
#layer_slide_link_row{
|
||||
clear:both;
|
||||
}
|
||||
|
||||
#linkInsertButton{
|
||||
float:right;
|
||||
margin-right:8px;
|
||||
padding:0px;
|
||||
padding-bottom:2px;
|
||||
font-size:11px;
|
||||
text-decoration:none;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
#linkInsertButton.disabled{
|
||||
color:#ACA899;
|
||||
cursor:default;
|
||||
}
|
||||
|
||||
.list-buttons li{
|
||||
float:left;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
/* ============================================= */
|
||||
/* End Params Layer Form Part */
|
||||
/* ============================================= */
|
||||
|
||||
.link_show_params{
|
||||
margin-left:70px;
|
||||
}
|
||||
|
||||
.link_show_advanced_params{
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
.link_show_params.button-selected{
|
||||
color:green;
|
||||
}
|
||||
|
||||
#layer_endtime_row{
|
||||
|
||||
}
|
||||
|
||||
#layer_endanimation_row{
|
||||
float:left;
|
||||
}
|
||||
|
||||
#layer_endeasing_row{
|
||||
float:right;
|
||||
xmargin-right:10px;
|
||||
}
|
||||
|
||||
#layer_endeasing_row .setting_text{
|
||||
width:50px;
|
||||
min-width:50px;
|
||||
}
|
||||
|
||||
#layer_endtime_row{
|
||||
float:left;
|
||||
margin-left: 78px;
|
||||
|
||||
}
|
||||
|
||||
#layer_endspeed_row{
|
||||
float:left;
|
||||
clear:left;
|
||||
}
|
||||
|
||||
#layer_cornerleft_row{
|
||||
float:left;
|
||||
}
|
||||
|
||||
#layer_cornerright_row{
|
||||
float:right;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
/* ============================================= */
|
||||
/* Align Table */
|
||||
/* ============================================= */
|
||||
|
||||
.align_table_wrapper{
|
||||
clear:both;
|
||||
float:left;
|
||||
margin-right:20px;
|
||||
}
|
||||
|
||||
.align_table{
|
||||
table-collapse:collapse;
|
||||
}
|
||||
|
||||
.align_table td{
|
||||
border:1px solid black;
|
||||
padding:2px;
|
||||
}
|
||||
|
||||
.align_table td a{
|
||||
text-decoration:none;
|
||||
display:block;
|
||||
width:20px;
|
||||
height:20px;
|
||||
background-color:#888;
|
||||
}
|
||||
|
||||
.align_table td a:hover{
|
||||
background-color:#cfcfcf;
|
||||
}
|
||||
|
||||
.align_table td a.selected{
|
||||
background-color:#cfcfcf;
|
||||
cursor:default;
|
||||
}
|
||||
|
||||
.align_table td a.selected:hover{
|
||||
cursor:default;
|
||||
background-color:#cfcfcf;
|
||||
}
|
||||
|
||||
|
||||
.align_table.table_disabled td{
|
||||
border:1px solid #ACACAC;
|
||||
}
|
||||
|
||||
.align_table.table_disabled td a{
|
||||
background-color:#ACACAC;
|
||||
cursor:default;
|
||||
}
|
||||
|
||||
.align_table.table_disabled td a:hover{
|
||||
background-color:#ACACAC;
|
||||
}
|
||||
|
||||
|
||||
/******************************
|
||||
- SPECIALS -
|
||||
********************************/
|
||||
|
||||
.tp-closedatstart { display:none;}
|
||||
|
||||
#layer_link_open_in_row { float:left;}
|
||||
|
||||
|
||||
.depthselected .sortbox_time { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
filter: alpha(opacity=50);
|
||||
-moz-opacity: 0.5;
|
||||
-khtml-opacity: 0.5;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.timeselected .sortbox_depth { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
filter: alpha(opacity=50);
|
||||
-moz-opacity: 0.5;
|
||||
-khtml-opacity: 0.5;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.timeselected .sortbox_time,
|
||||
.depthselected .sortbox_depth { background:#fff !important;}
|
||||
|
After Width: | Height: | Size: 180 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 120 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 111 B |
After Width: | Height: | Size: 110 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 101 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
462
wp-content/plugins/revslider/css/jui/new/jquery-ui-1.9.2.custom.css
vendored
Normal file
@ -0,0 +1,462 @@
|
||||
/*! jQuery UI - v1.9.2 - 2012-12-05
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden { display: none; }
|
||||
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
||||
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
||||
.ui-helper-clearfix:after { clear: both; }
|
||||
.ui-helper-clearfix { zoom: 1; }
|
||||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
|
||||
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
|
||||
.ui-autocomplete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* workarounds */
|
||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
||||
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.ui-buttonset { margin-right: 7px; }
|
||||
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
|
||||
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
|
||||
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
|
||||
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
|
||||
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
|
||||
.ui-menu .ui-menu-item a.ui-state-focus,
|
||||
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
|
||||
|
||||
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
|
||||
.ui-menu .ui-state-disabled a { cursor: default; }
|
||||
|
||||
/* icon support */
|
||||
.ui-menu-icons { position: relative; }
|
||||
.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
|
||||
|
||||
/* left-aligned */
|
||||
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
||||
|
||||
/* right-aligned */
|
||||
.ui-menu .ui-menu-icon { position: static; float: right; }
|
||||
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
|
||||
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
|
||||
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
|
||||
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
|
||||
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
|
||||
.ui-spinner-up { top: 0; }
|
||||
.ui-spinner-down { bottom: 0; }
|
||||
|
||||
/* TR overrides */
|
||||
.ui-spinner .ui-icon-triangle-1-s {
|
||||
/* need to fix icons sprite */
|
||||
background-position:-65px -16px;
|
||||
}
|
||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
.ui-tooltip {
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 300px;
|
||||
-webkit-box-shadow: 0 0 5px #aaa;
|
||||
box-shadow: 0 0 5px #aaa;
|
||||
}
|
||||
/* Fades and background-images don't work well together in IE6, drop the image */
|
||||
* html .ui-tooltip {
|
||||
background-image: none;
|
||||
}
|
||||
body .ui-tooltip { border-width: 2px; }
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
|
||||
.ui-widget .ui-widget { font-size: 1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
|
||||
.ui-widget-content a { color: #222222; }
|
||||
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
|
||||
.ui-widget-header a { color: #222222; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
|
||||
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
||||
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
|
||||
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
||||
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
||||
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
|
||||
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
||||
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
||||
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
|
||||
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); }
|
||||
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
|
5
wp-content/plugins/revslider/css/jui/new/jquery-ui-1.9.2.custom.min.css
vendored
Normal file
BIN
wp-content/plugins/revslider/css/jui/old/images/grain.png
Normal file
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 180 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 120 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 111 B |
After Width: | Height: | Size: 110 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 101 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
565
wp-content/plugins/revslider/css/jui/old/jquery-ui-1.8.18.custom.css
vendored
Normal file
@ -0,0 +1,565 @@
|
||||
/*
|
||||
* jQuery UI CSS Framework 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Theming/API
|
||||
*/
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden { display: none; }
|
||||
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
|
||||
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
||||
.ui-helper-clearfix:after { clear: both; }
|
||||
.ui-helper-clearfix { zoom: 1; }
|
||||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
|
||||
|
||||
/*
|
||||
* jQuery UI CSS Framework 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Theming/API
|
||||
*
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
|
||||
*/
|
||||
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
|
||||
.ui-widget .ui-widget { font-size: 1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
|
||||
.ui-widget-content a { color: #222222; }
|
||||
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
|
||||
.ui-widget-header a { color: #222222; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
||||
.ui-widget :active { outline: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
|
||||
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
||||
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
|
||||
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
||||
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
||||
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
|
||||
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
|
||||
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
||||
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
|
||||
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
|
||||
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-off { background-position: -96px -144px; }
|
||||
.ui-icon-radio-on { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
||||
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
|
||||
* jQuery UI Resizable 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Resizable#theming
|
||||
*/
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
|
||||
* jQuery UI Selectable 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Selectable#theming
|
||||
*/
|
||||
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
/*
|
||||
* jQuery UI Accordion 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Accordion#theming
|
||||
*/
|
||||
/* IE/Win - Fix animation bug - #4615 */
|
||||
.ui-accordion { width: 100%; }
|
||||
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-li-fix { display: inline; }
|
||||
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
|
||||
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
|
||||
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-content-active { display: block; }
|
||||
/*
|
||||
* jQuery UI Autocomplete 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Autocomplete#theming
|
||||
*/
|
||||
.ui-autocomplete { position: absolute; cursor: default; }
|
||||
|
||||
/* workarounds */
|
||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
|
||||
/*
|
||||
* jQuery UI Menu 1.8.18
|
||||
*
|
||||
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Menu#theming
|
||||
*/
|
||||
.ui-menu {
|
||||
list-style:none;
|
||||
padding: 2px;
|
||||
margin: 0;
|
||||
display:block;
|
||||
float: left;
|
||||
}
|
||||
.ui-menu .ui-menu {
|
||||
margin-top: -3px;
|
||||
}
|
||||
.ui-menu .ui-menu-item {
|
||||
margin:0;
|
||||
padding: 0;
|
||||
zoom: 1;
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
}
|
||||
.ui-menu .ui-menu-item a {
|
||||
text-decoration:none;
|
||||
display:block;
|
||||
padding:.2em .4em;
|
||||
line-height:1.5;
|
||||
zoom:1;
|
||||
}
|
||||
.ui-menu .ui-menu-item a.ui-state-hover,
|
||||
.ui-menu .ui-menu-item a.ui-state-active {
|
||||
font-weight: normal;
|
||||
margin: -1px;
|
||||
}
|
||||
/*
|
||||
* jQuery UI Button 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Button#theming
|
||||
*/
|
||||
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: hidden; *overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
||||
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.ui-buttonset { margin-right: 7px; }
|
||||
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
/*
|
||||
* jQuery UI Dialog 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Dialog#theming
|
||||
*/
|
||||
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
/*
|
||||
* jQuery UI Slider 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Slider#theming
|
||||
*/
|
||||
.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
|
||||
* jQuery UI Tabs 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tabs#theming
|
||||
*/
|
||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
.ui-tabs .ui-tabs-hide { display: none !important; }
|
||||
/*
|
||||
* jQuery UI Datepicker 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Datepicker#theming
|
||||
*/
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
display: none; /*sorry for IE5*/
|
||||
display/**/: block; /*sorry for IE5*/
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}/*
|
||||
* jQuery UI Progressbar 1.8.18
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Progressbar#theming
|
||||
*/
|
||||
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
12
wp-content/plugins/revslider/css/tipsy.css
Normal file
@ -0,0 +1,12 @@
|
||||
.tipsy { padding: 5px; font-size: 10px; position: absolute; z-index: 100000; }
|
||||
.tipsy-inner { padding: 5px 8px 4px 8px; background-color: black; color: white; max-width: 200px; text-align: center; }
|
||||
.tipsy-inner { border-radius: 3px; -moz-border-radius:3px; -webkit-border-radius:3px; }
|
||||
.tipsy-arrow { position: absolute; background: url('../images/tipsy.gif') no-repeat top left; width: 9px; height: 5px; }
|
||||
.tipsy-n .tipsy-arrow { top: 0; left: 50%; margin-left: -4px; }
|
||||
.tipsy-nw .tipsy-arrow { top: 0; left: 10px; }
|
||||
.tipsy-ne .tipsy-arrow { top: 0; right: 10px; }
|
||||
.tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -4px; background-position: bottom left; }
|
||||
.tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; background-position: bottom left; }
|
||||
.tipsy-se .tipsy-arrow { bottom: 0; right: 10px; background-position: bottom left; }
|
||||
.tipsy-e .tipsy-arrow { top: 50%; margin-top: -4px; right: 0; width: 5px; height: 9px; background-position: top right; }
|
||||
.tipsy-w .tipsy-arrow { top: 50%; margin-top: -4px; left: 0; width: 5px; height: 9px; }
|
BIN
wp-content/plugins/revslider/images/close.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
wp-content/plugins/revslider/images/cross.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
wp-content/plugins/revslider/images/delete.png
Normal file
After Width: | Height: | Size: 359 B |
BIN
wp-content/plugins/revslider/images/dropdown.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
wp-content/plugins/revslider/images/dropdown_hover.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
wp-content/plugins/revslider/images/dummy.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
wp-content/plugins/revslider/images/duplicate.png
Normal file
After Width: | Height: | Size: 376 B |
BIN
wp-content/plugins/revslider/images/edit.png
Normal file
After Width: | Height: | Size: 438 B |
BIN
wp-content/plugins/revslider/images/eye.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
wp-content/plugins/revslider/images/eyes.png
Normal file
After Width: | Height: | Size: 622 B |
BIN
wp-content/plugins/revslider/images/grain.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
wp-content/plugins/revslider/images/icon-general.png
Normal file
After Width: | Height: | Size: 323 B |
BIN
wp-content/plugins/revslider/images/icon-jump-disabled.png
Normal file
After Width: | Height: | Size: 746 B |
BIN
wp-content/plugins/revslider/images/icon-jump.png
Normal file
After Width: | Height: | Size: 690 B |
BIN
wp-content/plugins/revslider/images/icon-position.png
Normal file
After Width: | Height: | Size: 310 B |
BIN
wp-content/plugins/revslider/images/icon-preview.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
wp-content/plugins/revslider/images/icon-published.png
Normal file
After Width: | Height: | Size: 563 B |
BIN
wp-content/plugins/revslider/images/icon-unpublished.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
wp-content/plugins/revslider/images/icon_html5.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
wp-content/plugins/revslider/images/icon_vimeo.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
wp-content/plugins/revslider/images/icon_youtube.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
wp-content/plugins/revslider/images/loader.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
wp-content/plugins/revslider/images/preview.png
Normal file
After Width: | Height: | Size: 691 B |
BIN
wp-content/plugins/revslider/images/red-grad.png
Normal file
After Width: | Height: | Size: 142 B |
BIN
wp-content/plugins/revslider/images/timeline.png
Normal file
After Width: | Height: | Size: 261 B |
BIN
wp-content/plugins/revslider/images/timerdot.png
Normal file
After Width: | Height: | Size: 772 B |
BIN
wp-content/plugins/revslider/images/tipsy.gif
Normal file
After Width: | Height: | Size: 58 B |
BIN
wp-content/plugins/revslider/images/trans_tile.png
Normal file
After Width: | Height: | Size: 951 B |
BIN
wp-content/plugins/revslider/images/trans_tile2.png
Normal file
After Width: | Height: | Size: 279 B |
BIN
wp-content/plugins/revslider/images/transparent.jpg
Normal file
After Width: | Height: | Size: 287 B |
BIN
wp-content/plugins/revslider/images/transparent.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
wp-content/plugins/revslider/images/transtiled.png
Normal file
After Width: | Height: | Size: 294 B |
BIN
wp-content/plugins/revslider/images/update.png
Normal file
After Width: | Height: | Size: 534 B |
BIN
wp-content/plugins/revslider/images/white-grad.png
Normal file
After Width: | Height: | Size: 210 B |
BIN
wp-content/plugins/revslider/images/wp-arrows.png
Normal file
After Width: | Height: | Size: 494 B |
308
wp-content/plugins/revslider/inc_php/framework/base.class.php
Normal file
@ -0,0 +1,308 @@
|
||||
<?php
|
||||
|
||||
class UniteBaseClassRev{
|
||||
|
||||
protected static $wpdb;
|
||||
protected static $table_prefix;
|
||||
protected static $mainFile;
|
||||
protected static $t;
|
||||
|
||||
protected static $dir_plugin;
|
||||
protected static $dir_languages;
|
||||
public static $url_plugin;
|
||||
protected static $url_ajax;
|
||||
public static $url_ajax_actions;
|
||||
protected static $url_ajax_showimage;
|
||||
protected static $path_settings;
|
||||
protected static $path_plugin;
|
||||
protected static $path_languages;
|
||||
protected static $path_temp;
|
||||
protected static $path_views;
|
||||
protected static $path_templates;
|
||||
protected static $path_cache;
|
||||
protected static $path_base;
|
||||
protected static $is_multisite;
|
||||
protected static $debugMode = false;
|
||||
|
||||
/**
|
||||
*
|
||||
* the constructor
|
||||
*/
|
||||
public function __construct($mainFile,$t){
|
||||
global $wpdb;
|
||||
|
||||
self::$is_multisite = UniteFunctionsWPRev::isMultisite();
|
||||
|
||||
self::$wpdb = $wpdb;
|
||||
self::$table_prefix = self::$wpdb->base_prefix;
|
||||
if(UniteFunctionsWPRev::isMultisite()){
|
||||
$blogID = UniteFunctionsWPRev::getBlogID();
|
||||
if($blogID != 1){
|
||||
self::$table_prefix .= $blogID."_";
|
||||
}
|
||||
}
|
||||
|
||||
self::$mainFile = $mainFile;
|
||||
self::$t = $t;
|
||||
|
||||
//set plugin dirname (as the main filename)
|
||||
$info = pathinfo($mainFile);
|
||||
$baseName = $info["basename"];
|
||||
$filename = str_replace(".php","",$baseName);
|
||||
|
||||
self::$dir_plugin = $filename;
|
||||
|
||||
self::$url_plugin = plugins_url(self::$dir_plugin)."/";
|
||||
self::$url_ajax = admin_url("admin-ajax.php");
|
||||
self::$url_ajax_actions = self::$url_ajax . "?action=".self::$dir_plugin."_ajax_action";
|
||||
self::$url_ajax_showimage = self::$url_ajax . "?action=".self::$dir_plugin."_show_image";
|
||||
self::$path_plugin = dirname(self::$mainFile)."/";
|
||||
self::$path_settings = self::$path_plugin."settings/";
|
||||
self::$path_temp = self::$path_plugin."temp/";
|
||||
|
||||
//set cache path:
|
||||
self::setPathCache();
|
||||
|
||||
self::$path_views = self::$path_plugin."views/";
|
||||
self::$path_templates = self::$path_views."/templates/";
|
||||
self::$path_base = ABSPATH;
|
||||
self::$path_languages = self::$path_plugin."languages/";
|
||||
self::$dir_languages = self::$dir_plugin."/languages/";
|
||||
|
||||
load_plugin_textdomain(self::$dir_plugin,false,self::$dir_languages);
|
||||
|
||||
//update globals oldversion flag
|
||||
GlobalsRevSlider::$isNewVersion = false;
|
||||
$version = get_bloginfo("version");
|
||||
$version = (double)$version;
|
||||
if($version >= 3.5)
|
||||
GlobalsRevSlider::$isNewVersion = true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* set cache path for images. for multisite it will be current blog content folder
|
||||
*/
|
||||
private static function setPathCache(){
|
||||
|
||||
self::$path_cache = self::$path_plugin."cache/";
|
||||
if(self::$is_multisite){
|
||||
|
||||
if(!defined("BLOGUPLOADDIR") || !is_dir(BLOGUPLOADDIR))
|
||||
return(false);
|
||||
|
||||
$path = BLOGUPLOADDIR.self::$dir_plugin."-cache/";
|
||||
|
||||
if(!is_dir($path))
|
||||
mkdir($path);
|
||||
if(is_dir($path))
|
||||
self::$path_cache = $path;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* set debug mode.
|
||||
*/
|
||||
public static function setDebugMode(){
|
||||
self::$debugMode = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* add some wordpress action
|
||||
*/
|
||||
protected static function addAction($action,$eventFunction){
|
||||
|
||||
add_action( $action, array(self::$t, $eventFunction) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* register script helper function
|
||||
* @param $scriptFilename
|
||||
*/
|
||||
protected static function addScriptAbsoluteUrl($scriptPath,$handle){
|
||||
|
||||
wp_register_script($handle , $scriptPath);
|
||||
wp_enqueue_script($handle);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* register script helper function
|
||||
* @param $scriptFilename
|
||||
*/
|
||||
protected static function addScript($scriptName,$folder="js",$handle=null){
|
||||
if($handle == null)
|
||||
$handle = self::$dir_plugin."-".$scriptName;
|
||||
|
||||
wp_register_script($handle , self::$url_plugin .$folder."/".$scriptName.".js" );
|
||||
wp_enqueue_script($handle);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* register common script helper function
|
||||
* the handle for the common script is coming without plugin name
|
||||
*/
|
||||
protected static function addScriptCommon($scriptName,$handle=null, $folder="js"){
|
||||
if($handle == null)
|
||||
$handle = $scriptName;
|
||||
|
||||
self::addScript($scriptName,$folder,$handle);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* simple enqueue script
|
||||
*/
|
||||
protected static function addWPScript($scriptName){
|
||||
wp_enqueue_script($scriptName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* register style helper function
|
||||
* @param $styleFilename
|
||||
*/
|
||||
protected static function addStyle($styleName,$handle=null,$folder="css"){
|
||||
if($handle == null)
|
||||
$handle = self::$dir_plugin."-".$styleName;
|
||||
|
||||
wp_register_style($handle , self::$url_plugin .$folder."/".$styleName.".css" );
|
||||
wp_enqueue_style($handle);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* register common script helper function
|
||||
* the handle for the common script is coming without plugin name
|
||||
*/
|
||||
protected static function addStyleCommon($styleName,$handle=null,$folder="css"){
|
||||
if($handle == null)
|
||||
$handle = $styleName;
|
||||
self::addStyle($styleName,$handle,$folder);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* register style absolute url helper function
|
||||
*/
|
||||
protected static function addStyleAbsoluteUrl($styleUrl,$handle){
|
||||
|
||||
wp_register_style($handle , $styleUrl);
|
||||
wp_enqueue_style($handle);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* simple enqueue style
|
||||
*/
|
||||
protected static function addWPStyle($styleName){
|
||||
wp_enqueue_style($styleName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get image url to be shown via thumb making script.
|
||||
*/
|
||||
public static function getImageUrl($filepath, $width=null,$height=null,$exact=false,$effect=null,$effect_param=null){
|
||||
|
||||
$urlImage = UniteImageViewRev::getUrlThumb(self::$url_ajax_showimage, $filepath,$width ,$height ,$exact ,$effect ,$effect_param);
|
||||
|
||||
return($urlImage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* on show image ajax event. outputs image with parameters
|
||||
*/
|
||||
public static function onShowImage(){
|
||||
|
||||
$pathImages = UniteFunctionsWPRev::getPathContent();
|
||||
$urlImages = UniteFunctionsWPRev::getUrlContent();
|
||||
|
||||
try{
|
||||
|
||||
$imageView = new UniteImageViewRev(self::$path_cache,$pathImages,$urlImages);
|
||||
$imageView->showImageFromGet();
|
||||
|
||||
}catch (Exception $e){
|
||||
header("status: 500");
|
||||
echo $e->getMessage();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get POST var
|
||||
*/
|
||||
protected static function getPostVar($key,$defaultValue = ""){
|
||||
$val = self::getVar($_POST, $key, $defaultValue);
|
||||
return($val);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get GET var
|
||||
*/
|
||||
protected static function getGetVar($key,$defaultValue = ""){
|
||||
$val = self::getVar($_GET, $key, $defaultValue);
|
||||
return($val);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get post or get variable
|
||||
*/
|
||||
protected static function getPostGetVar($key,$defaultValue = ""){
|
||||
|
||||
if(array_key_exists($key, $_POST))
|
||||
$val = self::getVar($_POST, $key, $defaultValue);
|
||||
else
|
||||
$val = self::getVar($_GET, $key, $defaultValue);
|
||||
|
||||
return($val);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get some var from array
|
||||
*/
|
||||
protected static function getVar($arr,$key,$defaultValue = ""){
|
||||
$val = $defaultValue;
|
||||
if(isset($arr[$key])) $val = $arr[$key];
|
||||
return($val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* make config file of all the text in the settings for the .mo and .po creation
|
||||
*/
|
||||
protected static function updateSettingsText(){
|
||||
|
||||
$filelist = UniteFunctionsRev::getFileList(self::$path_settings,"xml");
|
||||
foreach($filelist as $file){
|
||||
$filepath = self::$path_settings.$file;
|
||||
UniteFunctionsWPRev::writeSettingLanguageFile($filepath);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,526 @@
|
||||
<?php
|
||||
|
||||
class UniteBaseAdminClassRev extends UniteBaseClassRev{
|
||||
|
||||
const ACTION_ADMIN_MENU = "admin_menu";
|
||||
const ACTION_ADMIN_INIT = "admin_init";
|
||||
const ACTION_ADD_SCRIPTS = "admin_enqueue_scripts";
|
||||
|
||||
const ROLE_ADMIN = "admin";
|
||||
const ROLE_EDITOR = "editor";
|
||||
const ROLE_AUTHOR = "author";
|
||||
|
||||
protected static $master_view;
|
||||
protected static $view;
|
||||
|
||||
private static $arrSettings = array();
|
||||
private static $arrMenuPages = array();
|
||||
private static $tempVars = array();
|
||||
private static $startupError = "";
|
||||
private static $menuRole = self::ROLE_ADMIN;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* main constructor
|
||||
*/
|
||||
public function __construct($mainFile,$t,$defaultView){
|
||||
|
||||
parent::__construct($mainFile,$t);
|
||||
|
||||
//set view
|
||||
self::$view = self::getGetVar("view");
|
||||
if(empty(self::$view))
|
||||
self::$view = $defaultView;
|
||||
|
||||
//add internal hook for adding a menu in arrMenus
|
||||
self::addAction(self::ACTION_ADMIN_MENU, "addAdminMenu");
|
||||
|
||||
//if not inside plugin don't continue
|
||||
if($this->isInsidePlugin() == true){
|
||||
self::addAction(self::ACTION_ADD_SCRIPTS, "addCommonScripts");
|
||||
self::addAction(self::ACTION_ADD_SCRIPTS, "onAddScripts");
|
||||
}
|
||||
|
||||
//a must event for any admin. call onActivate function.
|
||||
$this->addEvent_onActivate();
|
||||
self::addActionAjax("show_image", "onShowImage");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* set the menu role - for viewing menus
|
||||
*/
|
||||
public static function setMenuRole($menuRole){
|
||||
self::$menuRole = $menuRole;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* set startup error to be shown in master view
|
||||
*/
|
||||
public static function setStartupError($errorMessage){
|
||||
self::$startupError = $errorMessage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* tells if the the current plugin opened is this plugin or not
|
||||
* in the admin side.
|
||||
*/
|
||||
private function isInsidePlugin(){
|
||||
$page = self::getGetVar("page");
|
||||
if($page == self::$dir_plugin)
|
||||
return(true);
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* add common used scripts
|
||||
*/
|
||||
public static function addCommonScripts(){
|
||||
|
||||
//include jquery ui
|
||||
if(GlobalsRevSlider::$isNewVersion){ //load new jquery ui library
|
||||
|
||||
$urlJqueryUI = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js";
|
||||
self::addScriptAbsoluteUrl($urlJqueryUI,"jquery-ui");
|
||||
self::addStyle("jquery-ui-1.9.2.custom.min","jui-smoothness","css/jui/new");
|
||||
|
||||
if(function_exists("wp_enqueue_media"))
|
||||
wp_enqueue_media();
|
||||
|
||||
}else{ //load old jquery ui library
|
||||
|
||||
$urlJqueryUI = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js";
|
||||
self::addScriptAbsoluteUrl($urlJqueryUI,"jquery-ui");
|
||||
self::addStyle("jquery-ui-1.8.18.custom","jui-smoothness","css/jui/old");
|
||||
|
||||
}
|
||||
|
||||
self::addScriptCommon("settings","unite_settings");
|
||||
self::addScriptCommon("admin","unite_admin");
|
||||
self::addScriptCommon("jquery.tipsy","tipsy");
|
||||
|
||||
//--- add styles
|
||||
|
||||
self::addStyleCommon("admin","unite_admin");
|
||||
|
||||
//add tipsy
|
||||
self::addStyleCommon("tipsy","tipsy");
|
||||
|
||||
//include farbtastic
|
||||
self::addScriptCommon("my-farbtastic","my-farbtastic","js/farbtastic");
|
||||
self::addStyleCommon("farbtastic","farbtastic","js/farbtastic");
|
||||
|
||||
//include codemirror
|
||||
self::addScriptCommon("codemirror","codemirror_js","js/codemirror");
|
||||
self::addScriptCommon("css","codemirror_js_css","js/codemirror");
|
||||
self::addStyleCommon("codemirror","codemirror_css","js/codemirror");
|
||||
|
||||
//include dropdown checklist
|
||||
self::addScriptCommon("ui.dropdownchecklist-1.4-min","dropdownchecklist_js","js/dropdownchecklist");
|
||||
//self::addScriptCommon("ui.dropdownchecklist","dropdownchecklist_js","js/dropdownchecklist");
|
||||
//self::addStyleCommon("ui.dropdownchecklist.standalone","dropdownchecklist_css","js/dropdownchecklist");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* admin pages parent, includes all the admin files by default
|
||||
*/
|
||||
public static function adminPages(){
|
||||
self::validateAdminPermissions();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* validate permission that the user is admin, and can manage options.
|
||||
*/
|
||||
protected static function isAdminPermissions(){
|
||||
|
||||
if( is_admin() && current_user_can("manage_options") )
|
||||
return(true);
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* validate admin permissions, if no pemissions - exit
|
||||
*/
|
||||
protected static function validateAdminPermissions(){
|
||||
if(!self::isAdminPermissions()){
|
||||
echo "access denied";
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* set view that will be the master
|
||||
*/
|
||||
protected static function setMasterView($masterView){
|
||||
self::$master_view = $masterView;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* inlcude some view file
|
||||
*/
|
||||
protected static function requireView($view){
|
||||
try{
|
||||
//require master view file, and
|
||||
if(!empty(self::$master_view) && !isset(self::$tempVars["is_masterView"]) ){
|
||||
$masterViewFilepath = self::$path_views.self::$master_view.".php";
|
||||
UniteFunctionsRev::validateFilepath($masterViewFilepath,"Master View");
|
||||
|
||||
self::$tempVars["is_masterView"] = true;
|
||||
require $masterViewFilepath;
|
||||
}
|
||||
else{ //simple require the view file.
|
||||
$viewFilepath = self::$path_views.$view.".php";
|
||||
|
||||
UniteFunctionsRev::validateFilepath($viewFilepath,"View");
|
||||
require $viewFilepath;
|
||||
}
|
||||
|
||||
}catch (Exception $e){
|
||||
echo "<br><br>View ($view) Error: <b>".$e->getMessage()."</b>";
|
||||
|
||||
if(self::$debugMode == true)
|
||||
dmp($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* require some template from "templates" folder
|
||||
*/
|
||||
protected static function getPathTemplate($templateName){
|
||||
|
||||
$pathTemplate = self::$path_templates.$templateName.".php";
|
||||
UniteFunctionsRev::validateFilepath($pathTemplate,"Template");
|
||||
|
||||
return($pathTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* require settings file, the filename without .php
|
||||
*/
|
||||
protected static function requireSettings($settingsFile){
|
||||
|
||||
try{
|
||||
require self::$path_plugin."settings/$settingsFile.php";
|
||||
}catch (Exception $e){
|
||||
echo "<br><br>Settings ($settingsFile) Error: <b>".$e->getMessage()."</b>";
|
||||
dmp($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get path to settings file
|
||||
* @param $settingsFile
|
||||
*/
|
||||
protected static function getSettingsFilePath($settingsFile){
|
||||
|
||||
$filepath = self::$path_plugin."settings/$settingsFile.php";
|
||||
return($filepath);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* add all js and css needed for media upload
|
||||
*/
|
||||
protected static function addMediaUploadIncludes(){
|
||||
|
||||
self::addWPScript("thickbox");
|
||||
self::addWPStyle("thickbox");
|
||||
self::addWPScript("media-upload");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add admin menus from the list.
|
||||
*/
|
||||
public static function addAdminMenu(){
|
||||
|
||||
$role = "manage_options";
|
||||
|
||||
switch(self::$menuRole){
|
||||
case self::ROLE_AUTHOR:
|
||||
$role = "edit_published_posts";
|
||||
break;
|
||||
case self::ROLE_EDITOR:
|
||||
$role = "edit_pages";
|
||||
break;
|
||||
default:
|
||||
case self::ROLE_ADMIN:
|
||||
$role = "manage_options";
|
||||
break;
|
||||
}
|
||||
|
||||
foreach(self::$arrMenuPages as $menu){
|
||||
$title = $menu["title"];
|
||||
$pageFunctionName = $menu["pageFunction"];
|
||||
add_menu_page( $title, $title, $role, self::$dir_plugin, array(self::$t, $pageFunctionName) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* add menu page
|
||||
*/
|
||||
protected static function addMenuPage($title,$pageFunctionName){
|
||||
|
||||
self::$arrMenuPages[] = array("title"=>$title,"pageFunction"=>$pageFunctionName);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get url to some view.
|
||||
*/
|
||||
public static function getViewUrl($viewName,$urlParams=""){
|
||||
$params = "&view=".$viewName;
|
||||
if(!empty($urlParams))
|
||||
$params .= "&".$urlParams;
|
||||
|
||||
$link = admin_url( "admin.php?page=".self::$dir_plugin.$params);
|
||||
return($link);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* register the "onActivate" event
|
||||
*/
|
||||
protected function addEvent_onActivate($eventFunc = "onActivate"){
|
||||
register_activation_hook( self::$mainFile, array(self::$t, $eventFunc) );
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* store settings in the object
|
||||
*/
|
||||
protected static function storeSettings($key,$settings){
|
||||
self::$arrSettings[$key] = $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get settings object
|
||||
*/
|
||||
protected static function getSettings($key){
|
||||
if(!isset(self::$arrSettings[$key]))
|
||||
UniteFunctionsRev::throwError("Settings $key not found");
|
||||
$settings = self::$arrSettings[$key];
|
||||
return($settings);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* add ajax back end callback, on some action to some function.
|
||||
*/
|
||||
protected static function addActionAjax($ajaxAction,$eventFunction){
|
||||
self::addAction('wp_ajax_'.self::$dir_plugin."_".$ajaxAction, $eventFunction);
|
||||
self::addAction('wp_ajax_nopriv_'.self::$dir_plugin."_".$ajaxAction, $eventFunction);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* echo json ajax response
|
||||
*/
|
||||
private static function ajaxResponse($success,$message,$arrData = null){
|
||||
|
||||
$response = array();
|
||||
$response["success"] = $success;
|
||||
$response["message"] = $message;
|
||||
|
||||
if(!empty($arrData)){
|
||||
|
||||
if(gettype($arrData) == "string")
|
||||
$arrData = array("data"=>$arrData);
|
||||
|
||||
$response = array_merge($response,$arrData);
|
||||
}
|
||||
|
||||
$json = json_encode($response);
|
||||
|
||||
echo $json;
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* echo json ajax response, without message, only data
|
||||
*/
|
||||
protected static function ajaxResponseData($arrData){
|
||||
if(gettype($arrData) == "string")
|
||||
$arrData = array("data"=>$arrData);
|
||||
|
||||
self::ajaxResponse(true,"",$arrData);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* echo json ajax response
|
||||
*/
|
||||
protected static function ajaxResponseError($message,$arrData = null){
|
||||
|
||||
self::ajaxResponse(false,$message,$arrData,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* echo ajax success response
|
||||
*/
|
||||
protected static function ajaxResponseSuccess($message,$arrData = null){
|
||||
|
||||
self::ajaxResponse(true,$message,$arrData,true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* echo ajax success response
|
||||
*/
|
||||
protected static function ajaxResponseSuccessRedirect($message,$url){
|
||||
$arrData = array("is_redirect"=>true,"redirect_url"=>$url);
|
||||
|
||||
self::ajaxResponse(true,$message,$arrData,true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
protected static function updatePlugin($viewBack = false){
|
||||
$linkBack = self::getViewUrl($viewBack);
|
||||
$htmlLinkBack = UniteFunctionsRev::getHtmlLink($linkBack, "Go Back");
|
||||
|
||||
$zip = new UniteZipRev();
|
||||
|
||||
try{
|
||||
|
||||
if(function_exists("unzip_file") == false){
|
||||
if( UniteZipRev::isZipExists() == false)
|
||||
UniteFunctionsRev::throwError("The ZipArchive php extension not exists, can't extract the update file. Please turn it on in php ini.");
|
||||
}
|
||||
|
||||
dmp("Update in progress...");
|
||||
|
||||
$arrFiles = UniteFunctionsRev::getVal($_FILES, "update_file");
|
||||
if(empty($arrFiles))
|
||||
UniteFunctionsRev::throwError("Update file don't found.");
|
||||
|
||||
$filename = UniteFunctionsRev::getVal($arrFiles, "name");
|
||||
|
||||
if(empty($filename))
|
||||
UniteFunctionsRev::throwError("Update filename not found.");
|
||||
|
||||
$fileType = UniteFunctionsRev::getVal($arrFiles, "type");
|
||||
|
||||
/*
|
||||
$fileType = strtolower($fileType);
|
||||
|
||||
if($fileType != "application/zip")
|
||||
UniteFunctionsRev::throwError("The file uploaded is not zip.");
|
||||
*/
|
||||
|
||||
$filepathTemp = UniteFunctionsRev::getVal($arrFiles, "tmp_name");
|
||||
if(file_exists($filepathTemp) == false)
|
||||
UniteFunctionsRev::throwError("Can't find the uploaded file.");
|
||||
|
||||
//crate temp folder
|
||||
UniteFunctionsRev::checkCreateDir(self::$path_temp);
|
||||
|
||||
//create the update folder
|
||||
$pathUpdate = self::$path_temp."update_extract/";
|
||||
UniteFunctionsRev::checkCreateDir($pathUpdate);
|
||||
|
||||
//remove all files in the update folder
|
||||
if(is_dir($pathUpdate)){
|
||||
$arrNotDeleted = UniteFunctionsRev::deleteDir($pathUpdate,false);
|
||||
if(!empty($arrNotDeleted)){
|
||||
$strNotDeleted = print_r($arrNotDeleted,true);
|
||||
UniteFunctionsRev::throwError("Could not delete those files from the update folder: $strNotDeleted");
|
||||
}
|
||||
}
|
||||
|
||||
//copy the zip file.
|
||||
$filepathZip = $pathUpdate.$filename;
|
||||
|
||||
$success = move_uploaded_file($filepathTemp, $filepathZip);
|
||||
if($success == false)
|
||||
UniteFunctionsRev::throwError("Can't move the uploaded file here: {$filepathZip}.");
|
||||
|
||||
if(function_exists("unzip_file") == true){
|
||||
WP_Filesystem();
|
||||
$response = unzip_file($filepathZip, $pathUpdate);
|
||||
}
|
||||
else
|
||||
$zip->extract($filepathZip, $pathUpdate);
|
||||
|
||||
//get extracted folder
|
||||
$arrFolders = UniteFunctionsRev::getFoldersList($pathUpdate);
|
||||
if(empty($arrFolders))
|
||||
UniteFunctionsRev::throwError("The update folder is not extracted");
|
||||
|
||||
if(count($arrFolders) > 1)
|
||||
UniteFunctionsRev::throwError("Extracted folders are more then 1. Please check the update file.");
|
||||
|
||||
//get product folder
|
||||
$productFolder = $arrFolders[0];
|
||||
if(empty($productFolder))
|
||||
UniteFunctionsRev::throwError("Wrong product folder.");
|
||||
|
||||
if($productFolder != self::$dir_plugin)
|
||||
UniteFunctionsRev::throwError("The update folder don't match the product folder, please check the update file.");
|
||||
|
||||
$pathUpdateProduct = $pathUpdate.$productFolder."/";
|
||||
|
||||
//check some file in folder to validate it's the real one:
|
||||
$checkFilepath = $pathUpdateProduct.$productFolder.".php";
|
||||
if(file_exists($checkFilepath) == false)
|
||||
UniteFunctionsRev::throwError("Wrong update extracted folder. The file: {$checkFilepath} not found.");
|
||||
|
||||
//copy the plugin without the captions file.
|
||||
//$pathOriginalPlugin = $pathUpdate."copy/";
|
||||
$pathOriginalPlugin = self::$path_plugin;
|
||||
|
||||
$arrBlackList = array();
|
||||
$arrBlackList[] = "rs-plugin/css/captions.css";
|
||||
|
||||
UniteFunctionsRev::copyDir($pathUpdateProduct, $pathOriginalPlugin,"",$arrBlackList);
|
||||
|
||||
//delete the update
|
||||
UniteFunctionsRev::deleteDir($pathUpdate);
|
||||
|
||||
dmp("Updated Successfully, redirecting...");
|
||||
echo "<script>location.href='$linkBack'</script>";
|
||||
|
||||
}catch(Exception $e){
|
||||
$message = $e->getMessage();
|
||||
$message .= " <br> Please update the plugin manually via the ftp";
|
||||
echo "<div style='color:#B80A0A;font-size:18px;'><b>Update Error: </b> $message</div><br>";
|
||||
echo $htmlLinkBack;
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class UniteBaseFrontClassRev extends UniteBaseClassRev{
|
||||
|
||||
const ACTION_ENQUEUE_SCRIPTS = "wp_enqueue_scripts";
|
||||
|
||||
/**
|
||||
*
|
||||
* main constructor
|
||||
*/
|
||||
public function __construct($mainFile,$t){
|
||||
|
||||
parent::__construct($mainFile,$t);
|
||||
|
||||
self::addAction(self::ACTION_ENQUEUE_SCRIPTS, "onAddScripts");
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
class UniteCssParserRev{
|
||||
|
||||
private $cssContent;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* init the parser, set css content
|
||||
*/
|
||||
public function initContent($cssContent){
|
||||
$this->cssContent = $cssContent;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get array of slide classes, between two sections.
|
||||
*/
|
||||
public function getArrClasses($startText = "",$endText=""){
|
||||
|
||||
$content = $this->cssContent;
|
||||
|
||||
//trim from top
|
||||
if(!empty($startText)){
|
||||
$posStart = strpos($content, $startText);
|
||||
if($posStart !== false)
|
||||
$content = substr($content, $posStart,strlen($content)-$posStart);
|
||||
}
|
||||
|
||||
//trim from bottom
|
||||
if(!empty($endText)){
|
||||
$posEnd = strpos($content, $endText);
|
||||
if($posEnd !== false)
|
||||
$content = substr($content,0,$posEnd);
|
||||
}
|
||||
|
||||
//get styles
|
||||
$lines = explode("\n",$content);
|
||||
$arrClasses = array();
|
||||
foreach($lines as $key=>$line){
|
||||
$line = trim($line);
|
||||
|
||||
if(strpos($line, "{") === false)
|
||||
continue;
|
||||
|
||||
//skip unnessasary links
|
||||
if(strpos($line, ".caption a") !== false)
|
||||
continue;
|
||||
|
||||
if(strpos($line, ".tp-caption a") !== false)
|
||||
continue;
|
||||
|
||||
//get style out of the line
|
||||
$class = str_replace("{", "", $line);
|
||||
$class = trim($class);
|
||||
|
||||
//skip captions like this: .tp-caption.imageclass img
|
||||
if(strpos($class," ") !== false)
|
||||
continue;
|
||||
|
||||
$class = str_replace(".caption.", ".", $class);
|
||||
$class = str_replace(".tp-caption.", ".", $class);
|
||||
|
||||
$class = str_replace(".", "", $class);
|
||||
$class = trim($class);
|
||||
$arrWords = explode(" ", $class);
|
||||
$class = $arrWords[count($arrWords)-1];
|
||||
$class = trim($class);
|
||||
|
||||
$arrClasses[] = $class;
|
||||
}
|
||||
|
||||
return($arrClasses);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
151
wp-content/plugins/revslider/inc_php/framework/db.class.php
Normal file
@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
class UniteDBRev{
|
||||
|
||||
private $wpdb;
|
||||
private $lastRowID;
|
||||
|
||||
/**
|
||||
*
|
||||
* constructor - set database object
|
||||
*/
|
||||
public function __construct(){
|
||||
global $wpdb;
|
||||
$this->wpdb = $wpdb;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* throw error
|
||||
*/
|
||||
private function throwError($message,$code=-1){
|
||||
UniteFunctionsRev::throwError($message,$code);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// validate for errors
|
||||
private function checkForErrors($prefix = ""){
|
||||
|
||||
if(mysql_error()){
|
||||
$query = $this->wpdb->last_query;
|
||||
$message = $this->wpdb->last_error;
|
||||
|
||||
if($prefix) $message = $prefix.' - <b>'.$message.'</b>';
|
||||
if($query) $message .= '<br>---<br> Query: ' . $query;
|
||||
|
||||
$this->throwError($message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* insert variables to some table
|
||||
*/
|
||||
public function insert($table,$arrItems){
|
||||
|
||||
$this->wpdb->insert($table, $arrItems);
|
||||
$this->checkForErrors("Insert query error");
|
||||
|
||||
$this->lastRowID = mysql_insert_id();
|
||||
|
||||
return($this->lastRowID);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get last insert id
|
||||
*/
|
||||
public function getLastInsertID(){
|
||||
$this->lastRowID = mysql_insert_id();
|
||||
return($this->lastRowID);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* delete rows
|
||||
*/
|
||||
public function delete($table,$where){
|
||||
|
||||
UniteFunctionsRev::validateNotEmpty($table,"table name");
|
||||
UniteFunctionsRev::validateNotEmpty($where,"where");
|
||||
|
||||
$query = "delete from $table where $where";
|
||||
|
||||
$this->wpdb->query($query);
|
||||
|
||||
$this->checkForErrors("Delete query error");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* run some sql query
|
||||
*/
|
||||
public function runSql($query){
|
||||
|
||||
$this->wpdb->query($query);
|
||||
$this->checkForErrors("Regular query error");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* insert variables to some table
|
||||
*/
|
||||
public function update($table,$arrItems,$where){
|
||||
|
||||
$response = $this->wpdb->update($table, $arrItems, $where);
|
||||
if($response === false)
|
||||
UniteFunctionsRev::throwError("no update action taken!");
|
||||
|
||||
$this->checkForErrors("Update query error");
|
||||
|
||||
return($this->wpdb->num_rows);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get data array from the database
|
||||
*
|
||||
*/
|
||||
public function fetch($tableName,$where="",$orderField="",$groupByField="",$sqlAddon=""){
|
||||
|
||||
$query = "select * from $tableName";
|
||||
if($where) $query .= " where $where";
|
||||
if($orderField) $query .= " order by $orderField";
|
||||
if($groupByField) $query .= " group by $groupByField";
|
||||
if($sqlAddon) $query .= " ".$sqlAddon;
|
||||
|
||||
$response = $this->wpdb->get_results($query,ARRAY_A);
|
||||
|
||||
$this->checkForErrors("fetch");
|
||||
|
||||
return($response);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* fetch only one item. if not found - throw error
|
||||
*/
|
||||
public function fetchSingle($tableName,$where="",$orderField="",$groupByField="",$sqlAddon=""){
|
||||
$response = $this->fetch($tableName, $where, $orderField, $groupByField, $sqlAddon);
|
||||
if(empty($response))
|
||||
$this->throwError("Record not found");
|
||||
$record = $response[0];
|
||||
return($record);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* escape data to avoid sql errors and injections.
|
||||
*/
|
||||
public function escape($string){
|
||||
return($this->wpdb->escape($string));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
class UniteElementsBaseRev{
|
||||
|
||||
protected $db;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
$this->db = new UniteDBRev();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,770 @@
|
||||
<?php
|
||||
|
||||
class UniteFunctionsRev{
|
||||
|
||||
public static function throwError($message,$code=null){
|
||||
if(!empty($code))
|
||||
throw new Exception($message,$code);
|
||||
else
|
||||
throw new Exception($message);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* set output for download
|
||||
*/
|
||||
public static function downloadFile($str,$filename="output.txt"){
|
||||
|
||||
//output for download
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
header("Content-Disposition: attachment; filename=".$filename.";");
|
||||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-Length: ".strlen($str));
|
||||
echo $str;
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* turn boolean to string
|
||||
*/
|
||||
public static function boolToStr($bool){
|
||||
if(gettype($bool) == "string")
|
||||
return($bool);
|
||||
if($bool == true)
|
||||
return("true");
|
||||
else
|
||||
return("false");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* convert string to boolean
|
||||
*/
|
||||
public static function strToBool($str){
|
||||
if(is_bool($str))
|
||||
return($str);
|
||||
|
||||
if(empty($str))
|
||||
return(false);
|
||||
|
||||
if(is_numeric($str))
|
||||
return($str != 0);
|
||||
|
||||
$str = strtolower($str);
|
||||
if($str == "true")
|
||||
return(true);
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// get black value from rgb value
|
||||
public static function yiq($r,$g,$b){
|
||||
return (($r*0.299)+($g*0.587)+($b*0.114));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// convert colors to rgb
|
||||
public static function html2rgb($color){
|
||||
if ($color[0] == '#')
|
||||
$color = substr($color, 1);
|
||||
if (strlen($color) == 6)
|
||||
list($r, $g, $b) = array($color[0].$color[1],
|
||||
$color[2].$color[3],
|
||||
$color[4].$color[5]);
|
||||
elseif (strlen($color) == 3)
|
||||
list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
|
||||
else
|
||||
return false;
|
||||
$r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
|
||||
return array($r, $g, $b);
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
// convert timestamp to time string
|
||||
public static function timestamp2Time($stamp){
|
||||
$strTime = date("H:i",$stamp);
|
||||
return($strTime);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
// convert timestamp to date and time string
|
||||
public static function timestamp2DateTime($stamp){
|
||||
$strDateTime = date("d M Y, H:i",$stamp);
|
||||
return($strDateTime);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
// convert timestamp to date string
|
||||
public static function timestamp2Date($stamp){
|
||||
$strDate = date("d M Y",$stamp); //27 Jun 2009
|
||||
return($strDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* get value from array. if not - return alternative
|
||||
*/
|
||||
public static function getVal($arr,$key,$altVal=""){
|
||||
if(isset($arr[$key])) return($arr[$key]);
|
||||
return($altVal);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* convert object to string.
|
||||
*/
|
||||
public static function toString($obj){
|
||||
return(trim((string)$obj));
|
||||
}
|
||||
|
||||
/**
|
||||
* remove utf8 bom sign
|
||||
*/
|
||||
public static function remove_utf8_bom($content){
|
||||
$content = str_replace(chr(239),"",$content);
|
||||
$content = str_replace(chr(187),"",$content);
|
||||
$content = str_replace(chr(191),"",$content);
|
||||
$content = trim($content);
|
||||
return($content);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// get variable from post or from get. get wins.
|
||||
public static function getPostGetVariable($name,$initVar = ""){
|
||||
$var = $initVar;
|
||||
if(isset($_POST[$name])) $var = $_POST[$name];
|
||||
else if(isset($_GET[$name])) $var = $_GET[$name];
|
||||
return($var);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
public static function getPostVariable($name,$initVar = ""){
|
||||
$var = $initVar;
|
||||
if(isset($_POST[$name])) $var = $_POST[$name];
|
||||
return($var);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
public static function getGetVar($name,$initVar = ""){
|
||||
$var = $initVar;
|
||||
if(isset($_GET[$name])) $var = $_GET[$name];
|
||||
return($var);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* validate that some file exists, if not - throw error
|
||||
*/
|
||||
public static function validateFilepath($filepath,$errorPrefix=null){
|
||||
if(file_exists($filepath) == true)
|
||||
return(false);
|
||||
if($errorPrefix == null)
|
||||
$errorPrefix = "File";
|
||||
$message = $errorPrefix." $filepath not exists!";
|
||||
self::throwError($message);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* validate that some value is numeric
|
||||
*/
|
||||
public static function validateNumeric($val,$fieldName=""){
|
||||
self::validateNotEmpty($val,$fieldName);
|
||||
|
||||
if(empty($fieldName))
|
||||
$fieldName = "Field";
|
||||
|
||||
if(!is_numeric($val))
|
||||
self::throwError("$fieldName should be numeric ");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* validate that some variable not empty
|
||||
*/
|
||||
public static function validateNotEmpty($val,$fieldName=""){
|
||||
|
||||
if(empty($fieldName))
|
||||
$fieldName = "Field";
|
||||
|
||||
if(empty($val) && is_numeric($val) == false)
|
||||
self::throwError("Field <b>$fieldName</b> should not be empty");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* if directory not exists - create it
|
||||
* @param $dir
|
||||
*/
|
||||
public static function checkCreateDir($dir){
|
||||
if(!is_dir($dir))
|
||||
mkdir($dir);
|
||||
|
||||
if(!is_dir($dir))
|
||||
self::throwError("Could not create directory: $dir");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* delete file, validate if deleted
|
||||
*/
|
||||
public static function checkDeleteFile($filepath){
|
||||
if(file_exists($filepath) == false)
|
||||
return(false);
|
||||
|
||||
$success = @unlink($filepath);
|
||||
if($success == false)
|
||||
self::throwError("Failed to delete the file: $filepath");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
//filter array, leaving only needed fields - also array
|
||||
public static function filterArrFields($arr,$fields){
|
||||
$arrNew = array();
|
||||
foreach($fields as $field){
|
||||
if(isset($arr[$field]))
|
||||
$arrNew[$field] = $arr[$field];
|
||||
}
|
||||
return($arrNew);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
//get path info of certain path with all needed fields
|
||||
public static function getPathInfo($filepath){
|
||||
$info = pathinfo($filepath);
|
||||
|
||||
//fix the filename problem
|
||||
if(!isset($info["filename"])){
|
||||
$filename = $info["basename"];
|
||||
if(isset($info["extension"]))
|
||||
$filename = substr($info["basename"],0,(-strlen($info["extension"])-1));
|
||||
$info["filename"] = $filename;
|
||||
}
|
||||
|
||||
return($info);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert std class to array, with all sons
|
||||
* @param unknown_type $arr
|
||||
*/
|
||||
public static function convertStdClassToArray($arr){
|
||||
$arr = (array)$arr;
|
||||
|
||||
$arrNew = array();
|
||||
|
||||
foreach($arr as $key=>$item){
|
||||
$item = (array)$item;
|
||||
$arrNew[$key] = $item;
|
||||
}
|
||||
|
||||
return($arrNew);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
//save some file to the filesystem with some text
|
||||
public static function writeFile($str,$filepath){
|
||||
$fp = fopen($filepath,"w+");
|
||||
fwrite($fp,$str);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
//save some file to the filesystem with some text
|
||||
public static function writeDebug($str,$filepath="debug.txt",$showInputs = true){
|
||||
$post = print_r($_POST,true);
|
||||
$server = print_r($_SERVER,true);
|
||||
|
||||
if(getType($str) == "array")
|
||||
$str = print_r($str,true);
|
||||
|
||||
if($showInputs == true){
|
||||
$output = "--------------------"."\n";
|
||||
$output .= $str."\n";
|
||||
$output .= "Post: ".$post."\n";
|
||||
}else{
|
||||
$output = "---"."\n";
|
||||
$output .= $str . "\n";
|
||||
}
|
||||
|
||||
if(!empty($_GET)){
|
||||
$get = print_r($_GET,true);
|
||||
$output .= "Get: ".$get."\n";
|
||||
}
|
||||
|
||||
//$output .= "Server: ".$server."\n";
|
||||
|
||||
$fp = fopen($filepath,"a+");
|
||||
fwrite($fp,$output);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* clear debug file
|
||||
*/
|
||||
public static function clearDebug($filepath = "debug.txt"){
|
||||
|
||||
if(file_exists($filepath))
|
||||
unlink($filepath);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* save to filesystem the error
|
||||
*/
|
||||
public static function writeDebugError(Exception $e,$filepath = "debug.txt"){
|
||||
$message = $e->getMessage();
|
||||
$trace = $e->getTraceAsString();
|
||||
|
||||
$output = $message."\n";
|
||||
$output .= $trace."\n";
|
||||
|
||||
$fp = fopen($filepath,"a+");
|
||||
fwrite($fp,$output);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
//save some file to the filesystem with some text
|
||||
public static function addToFile($str,$filepath){
|
||||
$fp = fopen($filepath,"a+");
|
||||
fwrite($fp,"---------------------\n");
|
||||
fwrite($fp,$str."\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
//check the php version. throw exception if the version beneath 5
|
||||
private static function checkPHPVersion(){
|
||||
$strVersion = phpversion();
|
||||
$version = (float)$strVersion;
|
||||
if($version < 5) throw new Exception("You must have php5 and higher in order to run the application. Your php version is: $version");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// valiadte if gd exists. if not - throw exception
|
||||
private static function validateGD(){
|
||||
if(function_exists('gd_info') == false)
|
||||
throw new Exception("You need GD library to be available in order to run this application. Please turn it on in php.ini");
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------
|
||||
//return if the json library is activated
|
||||
public static function isJsonActivated(){
|
||||
return(function_exists('json_encode'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* encode array into json for client side
|
||||
*/
|
||||
public static function jsonEncodeForClientSide($arr){
|
||||
$json = "";
|
||||
if(!empty($arr)){
|
||||
$json = json_encode($arr);
|
||||
$json = addslashes($json);
|
||||
}
|
||||
|
||||
$json = "'".$json."'";
|
||||
|
||||
return($json);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* decode json from the client side
|
||||
*/
|
||||
public static function jsonDecodeFromClientSide($data){
|
||||
|
||||
$data = stripslashes($data);
|
||||
$data = str_replace('\"','\"',$data);
|
||||
$data = json_decode($data);
|
||||
$data = (array)$data;
|
||||
|
||||
return($data);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------
|
||||
//validate if some directory is writable, if not - throw a exception
|
||||
private static function validateWritable($name,$path,$strList,$validateExists = true){
|
||||
|
||||
if($validateExists == true){
|
||||
//if the file/directory doesn't exists - throw an error.
|
||||
if(file_exists($path) == false)
|
||||
throw new Exception("$name doesn't exists");
|
||||
}
|
||||
else{
|
||||
//if the file not exists - don't check. it will be created.
|
||||
if(file_exists($path) == false) return(false);
|
||||
}
|
||||
|
||||
if(is_writable($path) == false){
|
||||
chmod($path,0755); //try to change the permissions
|
||||
if(is_writable($path) == false){
|
||||
$strType = "Folder";
|
||||
if(is_file($path)) $strType = "File";
|
||||
$message = "$strType $name is doesn't have a write permissions. Those folders/files must have a write permissions in order that this application will work properly: $strList";
|
||||
throw new Exception($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
//validate presets for identical keys
|
||||
public static function validatePresets(){
|
||||
global $g_presets;
|
||||
if(empty($g_presets)) return(false);
|
||||
//check for duplicates
|
||||
$assoc = array();
|
||||
foreach($g_presets as $preset){
|
||||
$id = $preset["id"];
|
||||
if(isset($assoc[$id]))
|
||||
throw new Exception("Double preset ID detected: $id");
|
||||
$assoc[$id] = true;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
//Get url of image for output
|
||||
public static function getImageOutputUrl($filename,$width=0,$height=0,$exact=false){
|
||||
//exact validation:
|
||||
if($exact == "true" && (empty($width) || empty($height) ))
|
||||
self::throwError("Exact must have both - width and height");
|
||||
|
||||
$url = CMGlobals::$URL_GALLERY."?img=".$filename;
|
||||
if(!empty($width))
|
||||
$url .= "&w=".$width;
|
||||
|
||||
if(!empty($height))
|
||||
$url .= "&h=".$height;
|
||||
|
||||
if($exact == true)
|
||||
$url .= "&t=exact";
|
||||
|
||||
return($url);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get list of all files in the directory
|
||||
* ext - filter by his extension only
|
||||
*/
|
||||
public static function getFileList($path,$ext=""){
|
||||
$dir = scandir($path);
|
||||
$arrFiles = array();
|
||||
foreach($dir as $file){
|
||||
if($file == "." || $file == "..") continue;
|
||||
if(!empty($ext)){
|
||||
$info = pathinfo($file);
|
||||
$extension = UniteFunctionsRev::getVal($info, "extension");
|
||||
if($ext != strtolower($extension))
|
||||
continue;
|
||||
}
|
||||
$filepath = $path . "/" . $file;
|
||||
if(is_file($filepath)) $arrFiles[] = $file;
|
||||
}
|
||||
return($arrFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get list of all files in the directory
|
||||
*/
|
||||
public static function getFoldersList($path){
|
||||
$dir = scandir($path);
|
||||
$arrFiles = array();
|
||||
foreach($dir as $file){
|
||||
if($file == "." || $file == "..") continue;
|
||||
$filepath = $path . "/" . $file;
|
||||
if(is_dir($filepath)) $arrFiles[] = $file;
|
||||
}
|
||||
return($arrFiles);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* do "trim" operation on all array items.
|
||||
*/
|
||||
public static function trimArrayItems($arr){
|
||||
if(gettype($arr) != "array")
|
||||
UniteFunctionsRev::throwError("trimArrayItems error: The type must be array");
|
||||
|
||||
foreach ($arr as $key=>$item)
|
||||
$arr[$key] = trim($item);
|
||||
|
||||
return($arr);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get url contents
|
||||
*/
|
||||
public static function getUrlContents($url,$arrPost=array(),$method = "post",$debug=false){
|
||||
$ch = curl_init();
|
||||
$timeout = 0;
|
||||
|
||||
$strPost = '';
|
||||
foreach($arrPost as $key=>$value){
|
||||
if(!empty($strPost))
|
||||
$strPost .= "&";
|
||||
$value = urlencode($value);
|
||||
$strPost .= "$key=$value";
|
||||
}
|
||||
|
||||
|
||||
//set curl options
|
||||
if(strtolower($method) == "post"){
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS,$strPost);
|
||||
}
|
||||
else //get
|
||||
$url .= "?".$strPost;
|
||||
|
||||
//remove me
|
||||
//Functions::addToLogFile(SERVICE_LOG_SERVICE, "url", $url);
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
|
||||
|
||||
$headers = array();
|
||||
$headers[] = "User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8";
|
||||
$headers[] = "Accept-Charset:utf-8;q=0.7,*;q=0.7";
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
|
||||
if($debug == true){
|
||||
dmp($url);
|
||||
dmp($response);
|
||||
exit();
|
||||
}
|
||||
|
||||
if($response == false)
|
||||
throw new Exception("getUrlContents Request failed");
|
||||
|
||||
curl_close($ch);
|
||||
return($response);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get link html
|
||||
*/
|
||||
public static function getHtmlLink($link,$text,$id="",$class=""){
|
||||
|
||||
if(!empty($class))
|
||||
$class = " class='$class'";
|
||||
|
||||
if(!empty($id))
|
||||
$id = " id='$id'";
|
||||
|
||||
$html = "<a href=\"$link\"".$id.$class.">$text</a>";
|
||||
return($html);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get select from array
|
||||
*/
|
||||
public static function getHTMLSelect($arr,$default="",$htmlParams="",$assoc = false){
|
||||
|
||||
$html = "<select $htmlParams>";
|
||||
foreach($arr as $key=>$item){
|
||||
$selected = "";
|
||||
|
||||
if($assoc == false){
|
||||
if($item == $default) $selected = " selected ";
|
||||
}
|
||||
else{
|
||||
if(trim($key) == trim($default))
|
||||
$selected = " selected ";
|
||||
}
|
||||
|
||||
|
||||
if($assoc == true)
|
||||
$html .= "<option $selected value='$key'>$item</option>";
|
||||
else
|
||||
$html .= "<option $selected value='$item'>$item</option>";
|
||||
}
|
||||
$html.= "</select>";
|
||||
return($html);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Convert array to assoc array by some field
|
||||
*/
|
||||
public static function arrayToAssoc($arr,$field=null){
|
||||
$arrAssoc = array();
|
||||
|
||||
foreach($arr as $item){
|
||||
if(empty($field))
|
||||
$arrAssoc[$item] = $item;
|
||||
else
|
||||
$arrAssoc[$item[$field]] = $item;
|
||||
}
|
||||
|
||||
return($arrAssoc);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* convert assoc array to array
|
||||
*/
|
||||
public static function assocToArray($assoc){
|
||||
$arr = array();
|
||||
foreach($assoc as $item)
|
||||
$arr[] = $item;
|
||||
|
||||
return($arr);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* strip slashes from textarea content after ajax request to server
|
||||
*/
|
||||
public static function normalizeTextareaContent($content){
|
||||
if(empty($content))
|
||||
return($content);
|
||||
$content = stripslashes($content);
|
||||
$content = trim($content);
|
||||
return($content);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get random array item
|
||||
*/
|
||||
public static function getRandomArrayItem($arr){
|
||||
$numItems = count($arr);
|
||||
$rand = rand(0, $numItems-1);
|
||||
$item = $arr[$rand];
|
||||
return($item);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* recursive delete directory or file
|
||||
*/
|
||||
public static function deleteDir($path,$deleteOriginal = true, $arrNotDeleted = array(),$originalPath = ""){
|
||||
|
||||
if(empty($originalPath))
|
||||
$originalPath = $path;
|
||||
|
||||
//in case of paths array
|
||||
if(getType($path) == "array"){
|
||||
$arrPaths = $path;
|
||||
foreach($path as $singlePath)
|
||||
$arrNotDeleted = self::deleteDir($singlePath,$deleteOriginal,$arrNotDeleted,$originalPath);
|
||||
return($arrNotDeleted);
|
||||
}
|
||||
|
||||
if(!file_exists($path))
|
||||
return($arrNotDeleted);
|
||||
|
||||
if(is_file($path)){ // delete file
|
||||
$deleted = unlink($path);
|
||||
if(!$deleted)
|
||||
$arrNotDeleted[] = $path;
|
||||
}
|
||||
else{ //delete directory
|
||||
$arrPaths = scandir($path);
|
||||
foreach($arrPaths as $file){
|
||||
if($file == "." || $file == "..")
|
||||
continue;
|
||||
$filepath = realpath($path."/".$file);
|
||||
$arrNotDeleted = self::deleteDir($filepath,$deleteOriginal,$arrNotDeleted,$originalPath);
|
||||
}
|
||||
|
||||
if($deleteOriginal == true || $originalPath != $path){
|
||||
$deleted = @rmdir($path);
|
||||
if(!$deleted)
|
||||
$arrNotDeleted[] = $path;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return($arrNotDeleted);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* copy folder to another location.
|
||||
*
|
||||
*/
|
||||
public static function copyDir($source,$dest,$rel_path = "",$blackList = null){
|
||||
|
||||
$full_source = $source;
|
||||
if(!empty($rel_path))
|
||||
$full_source = $source."/".$rel_path;
|
||||
|
||||
$full_dest = $dest;
|
||||
if(!empty($full_dest))
|
||||
$full_dest = $dest."/".$rel_path;
|
||||
|
||||
if(!is_dir($full_source))
|
||||
self::throwError("The source directroy: '$full_source' not exists.");
|
||||
|
||||
if(!is_dir($full_dest))
|
||||
mkdir($full_dest);
|
||||
|
||||
$files = scandir($full_source);
|
||||
foreach($files as $file){
|
||||
if($file == "." || $file == "..")
|
||||
continue;
|
||||
|
||||
$path_source = $full_source."/".$file;
|
||||
$path_dest = $full_dest."/".$file;
|
||||
|
||||
//validate black list
|
||||
$rel_path_file = $file;
|
||||
if(!empty($rel_path))
|
||||
$rel_path_file = $rel_path."/".$file;
|
||||
|
||||
//if the file or folder is in black list - pass it
|
||||
if(array_search($rel_path_file, $blackList) !== false)
|
||||
continue;
|
||||
|
||||
//if file - copy file
|
||||
if(is_file($path_source)){
|
||||
copy($path_source,$path_dest);
|
||||
}
|
||||
else{ //if directory - recursive copy directory
|
||||
if(empty($rel_path))
|
||||
$rel_path_new = $file;
|
||||
else
|
||||
$rel_path_new = $rel_path."/".$file;
|
||||
|
||||
self::copyDir($source,$dest,$rel_path_new,$blackList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
17
wp-content/plugins/revslider/inc_php/framework/functions.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
if(!function_exists("dmp")){
|
||||
function dmp($str){
|
||||
echo "<div align='left'>";
|
||||
echo "<pre>";
|
||||
print_r($str);
|
||||
echo "</pre>";
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
@ -0,0 +1,256 @@
|
||||
<?php
|
||||
|
||||
class UniteFunctionsWPRev{
|
||||
|
||||
const THUMB_SMALL = "thumbnail";
|
||||
const THUMB_MEDIUM = "medium";
|
||||
const THUMB_LARGE = "large";
|
||||
const THUMB_FULL = "full";
|
||||
|
||||
|
||||
/**
|
||||
* get blog id
|
||||
*/
|
||||
public static function getBlogID(){
|
||||
global $blog_id;
|
||||
return($blog_id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get blog id
|
||||
*/
|
||||
public static function isMultisite(){
|
||||
$isMultisite = is_multisite();
|
||||
return($isMultisite);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* check if some db table exists
|
||||
*/
|
||||
public static function isDBTableExists($tableName){
|
||||
global $wpdb;
|
||||
|
||||
if(empty($tableName))
|
||||
UniteFunctionsRev::throwError("Empty table name!!!");
|
||||
|
||||
$sql = "show tables like '$tableName'";
|
||||
|
||||
$table = $wpdb->get_var($sql);
|
||||
|
||||
if($table == $tableName)
|
||||
return(true);
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get wordpress base path
|
||||
*/
|
||||
public static function getPathBase(){
|
||||
return ABSPATH;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get wp-content path
|
||||
*/
|
||||
public static function getPathContent(){
|
||||
if(self::isMultisite()){
|
||||
if(!defined("BLOGUPLOADDIR")){
|
||||
$pathBase = self::getPathBase();
|
||||
$pathContent = $pathBase."wp-content/";
|
||||
}else
|
||||
$pathContent = BLOGUPLOADDIR;
|
||||
}else{
|
||||
$pathContent = WP_CONTENT_DIR;
|
||||
if(!empty($pathContent)){
|
||||
$pathContent .= "/";
|
||||
}
|
||||
else{
|
||||
$pathBase = self::getPathBase();
|
||||
$pathContent = $pathBase."wp-content/";
|
||||
}
|
||||
}
|
||||
|
||||
return($pathContent);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get content url
|
||||
*/
|
||||
public static function getUrlContent(){
|
||||
|
||||
if(self::isMultisite() == false){ //without multisite
|
||||
$baseUrl = content_url()."/";
|
||||
}
|
||||
else{ //for multisite
|
||||
$arrUploadData = wp_upload_dir();
|
||||
$baseUrl = $arrUploadData["baseurl"]."/";
|
||||
}
|
||||
|
||||
return($baseUrl);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* register widget (must be class)
|
||||
*/
|
||||
public static function registerWidget($widgetName){
|
||||
add_action('widgets_init', create_function('', 'return register_widget("'.$widgetName.'");'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get image relative path from image url (from upload)
|
||||
*/
|
||||
public static function getImagePathFromURL($urlImage){
|
||||
|
||||
$baseUrl = self::getUrlContent();
|
||||
$pathImage = str_replace($baseUrl, "", $urlImage);
|
||||
|
||||
return($pathImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* get image real path phisical on disk from url
|
||||
*/
|
||||
public static function getImageRealPathFromUrl($urlImage){
|
||||
$filepath = self::getImagePathFromURL($urlImage);
|
||||
$realPath = UniteFunctionsWPRev::getPathContent().$filepath;
|
||||
return($realPath);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get image url from image path.
|
||||
*/
|
||||
public static function getImageUrlFromPath($pathImage){
|
||||
//protect from absolute url
|
||||
$pathLower = strtolower($pathImage);
|
||||
if(strpos($pathLower, "http://") !== false || strpos($pathLower, "www.") === 0)
|
||||
return($pathImage);
|
||||
|
||||
$urlImage = self::getUrlContent().$pathImage;
|
||||
return($urlImage);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* write settings language file for wp automatic scanning
|
||||
*/
|
||||
public static function writeSettingLanguageFile($filepath){
|
||||
$info = pathinfo($filepath);
|
||||
$path = UniteFunctionsRev::getVal($info, "dirname")."/";
|
||||
$filename = UniteFunctionsRev::getVal($info, "filename");
|
||||
$ext = UniteFunctionsRev::getVal($info, "extension");
|
||||
$filenameOutput = "{$filename}_{$ext}_lang.php";
|
||||
$filepathOutput = $path.$filenameOutput;
|
||||
|
||||
//load settings
|
||||
$settings = new UniteSettingsAdvancedRev();
|
||||
$settings->loadXMLFile($filepath);
|
||||
$arrText = $settings->getArrTextFromAllSettings();
|
||||
|
||||
$str = "";
|
||||
$str .= "<?php \n";
|
||||
foreach($arrText as $text){
|
||||
$text = str_replace('"', '\\"', $text);
|
||||
$str .= "_e(\"$text\",\"".REVSLIDER_TEXTDOMAIN."\"); \n";
|
||||
}
|
||||
$str .= "?>";
|
||||
|
||||
UniteFunctionsRev::writeFile($str, $filepathOutput);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* check the current post for the existence of a short code
|
||||
*/
|
||||
public static function hasShortcode($shortcode = '') {
|
||||
|
||||
$post = get_post(get_the_ID());
|
||||
|
||||
if (empty($shortcode))
|
||||
return $found;
|
||||
|
||||
$found = false;
|
||||
|
||||
if (stripos($post->post_content, '[' . $shortcode) !== false )
|
||||
$found = true;
|
||||
|
||||
return $found;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get attachment image url
|
||||
*/
|
||||
public static function getUrlAttachmentImage($thumbID,$size = self::THUMB_FULL){
|
||||
$arrImage = wp_get_attachment_image_src($thumbID,$size);
|
||||
if(empty($arrImage))
|
||||
return(false);
|
||||
$url = UniteFunctionsRev::getVal($arrImage, 0);
|
||||
return($url);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get attachment image array by id and size
|
||||
*/
|
||||
public static function getAttachmentImage($thumbID,$size = self::THUMB_FULL){
|
||||
|
||||
$arrImage = wp_get_attachment_image_src($thumbID,$size);
|
||||
if(empty($arrImage))
|
||||
return(false);
|
||||
|
||||
$output = array();
|
||||
$output["url"] = UniteFunctionsRev::getVal($arrImage, 0);
|
||||
$output["width"] = UniteFunctionsRev::getVal($arrImage, 1);
|
||||
$output["height"] = UniteFunctionsRev::getVal($arrImage, 2);
|
||||
|
||||
return($output);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get post thumb id from post id
|
||||
*/
|
||||
public static function getPostThumbID($postID){
|
||||
$thumbID = get_post_thumbnail_id( $postID );
|
||||
return($thumbID);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get url of post thumbnail
|
||||
*/
|
||||
public static function getUrlPostImage($postID,$size = self::THUMB_FULL){
|
||||
|
||||
$post_thumbnail_id = get_post_thumbnail_id( $postID );
|
||||
if(empty($post_thumbnail_id))
|
||||
return("");
|
||||
|
||||
$arrImage = wp_get_attachment_image_src($post_thumbnail_id,$size);
|
||||
if(empty($arrImage))
|
||||
return("");
|
||||
|
||||
$urlImage = $arrImage[0];
|
||||
return($urlImage);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,610 @@
|
||||
<?php
|
||||
|
||||
class UniteImageViewRev{
|
||||
|
||||
private $pathCache;
|
||||
private $pathImages;
|
||||
private $urlImages;
|
||||
|
||||
private $filename = null;
|
||||
private $maxWidth = null;
|
||||
private $maxHeight = null;
|
||||
private $type = null;
|
||||
private $effect = null;
|
||||
private $effect_arg1 = null;
|
||||
private $effect_arg2 = null;
|
||||
|
||||
const EFFECT_BW = "bw";
|
||||
const EFFECT_BRIGHTNESS = "bright";
|
||||
const EFFECT_CONTRAST = "contrast";
|
||||
const EFFECT_EDGE = "edge";
|
||||
const EFFECT_EMBOSS = "emboss";
|
||||
const EFFECT_BLUR = "blur";
|
||||
const EFFECT_BLUR3 = "blur3";
|
||||
const EFFECT_MEAN = "mean";
|
||||
const EFFECT_SMOOTH = "smooth";
|
||||
const EFFECT_DARK = "dark";
|
||||
|
||||
const TYPE_EXACT = "exact";
|
||||
const TYPE_EXACT_TOP = "exacttop";
|
||||
|
||||
private $jpg_quality = 81;
|
||||
|
||||
public function __construct($pathCache,$pathImages,$urlImages){
|
||||
|
||||
$this->pathCache = $pathCache;
|
||||
$this->pathImages = $pathImages;
|
||||
$this->urlImages = $urlImages;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* set jpg quality output
|
||||
*/
|
||||
public function setJPGQuality($quality){
|
||||
$this->jpg_quality = $quality;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get thumb url
|
||||
*/
|
||||
public static function getUrlThumb($urlBase, $filename,$width=null,$height=null,$exact=false,$effect=null,$effect_param=null){
|
||||
|
||||
$filename = urlencode($filename);
|
||||
|
||||
$url = $urlBase."&img=$filename";
|
||||
if(!empty($width))
|
||||
$url .= "&w=".$width;
|
||||
if(!empty($height))
|
||||
$url .= "&h=".$height;
|
||||
|
||||
if($exact == true){
|
||||
$url .= "&t=".self::TYPE_EXACT;
|
||||
}
|
||||
|
||||
if(!empty($effect)){
|
||||
$url .= "&e=".$effect;
|
||||
if(!empty($effect_param))
|
||||
$url .= "&ea1=".$effect_param;
|
||||
}
|
||||
|
||||
return($url);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* throw error
|
||||
*/
|
||||
private function throwError($message,$code=null){
|
||||
UniteFunctionsRev::throwError($message,$code);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get filename for thumbnail save / retrieve
|
||||
* TODO: do input validations - security measures
|
||||
*/
|
||||
private function getThumbFilename(){
|
||||
$info = pathInfo($this->filename);
|
||||
|
||||
//add dirname as postfix (if exists)
|
||||
$postfix = "";
|
||||
|
||||
$dirname = UniteFunctionsRev::getVal($info, "dirname");
|
||||
if(!empty($dirname)){
|
||||
$postfix = str_replace("/", "-", $dirname);
|
||||
}
|
||||
|
||||
|
||||
$ext = $info["extension"];
|
||||
$name = $info["filename"];
|
||||
$width = ceil($this->maxWidth);
|
||||
$height = ceil($this->maxHeight);
|
||||
$thumbFilename = $name."_".$width."x".$height;
|
||||
|
||||
if(!empty($this->type))
|
||||
$thumbFilename .= "_" . $this->type;
|
||||
|
||||
if(!empty($this->effect)){
|
||||
$thumbFilename .= "_e" . $this->effect;
|
||||
if(!empty($this->effect_arg1)){
|
||||
$thumbFilename .= "x" . $this->effect_arg1;
|
||||
}
|
||||
}
|
||||
|
||||
//add postfix
|
||||
if(!empty($postfix))
|
||||
$thumbFilename .= "_".$postfix;
|
||||
|
||||
$thumbFilename .= ".".$ext;
|
||||
|
||||
return($thumbFilename);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// get thumbnail fielpath by parameters.
|
||||
private function getThumbFilepath(){
|
||||
$filename = $this->getThumbFilename();
|
||||
$filepath = $this->pathCache .$filename;
|
||||
return($filepath);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// ouptput emtpy image code.
|
||||
private function outputEmptyImageCode(){
|
||||
echo "empty image";
|
||||
exit();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// outputs image and exit.
|
||||
private function outputImage($filepath){
|
||||
|
||||
$info = UniteFunctionsRev::getPathInfo($filepath);
|
||||
$ext = $info["extension"];
|
||||
$filetime = filemtime($filepath);
|
||||
|
||||
$ext = strtolower($ext);
|
||||
if($ext == "jpg")
|
||||
$ext = "jpeg";
|
||||
|
||||
$numExpires = 31536000; //one year
|
||||
$strExpires = @date('D, d M Y H:i:s',time()+$numExpires);
|
||||
$strModified = @date('D, d M Y H:i:s',$filetime);
|
||||
|
||||
$contents = file_get_contents($filepath);
|
||||
$filesize = strlen($contents);
|
||||
header("Last-Modified: $strModified GMT");
|
||||
header("Expires: $strExpires GMT");
|
||||
header("Cache-Control: public");
|
||||
header("Content-Type: image/$ext");
|
||||
header("Content-Length: $filesize");
|
||||
|
||||
echo $contents;
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// get src image from filepath according the image type
|
||||
private function getGdSrcImage($filepath,$type){
|
||||
// create the image
|
||||
$src_img = false;
|
||||
switch($type){
|
||||
case IMAGETYPE_JPEG:
|
||||
$src_img = @imagecreatefromjpeg($filepath);
|
||||
break;
|
||||
case IMAGETYPE_PNG:
|
||||
$src_img = @imagecreatefrompng($filepath);
|
||||
break;
|
||||
case IMAGETYPE_GIF:
|
||||
$src_img = @imagecreatefromgif($filepath);
|
||||
break;
|
||||
case IMAGETYPE_BMP:
|
||||
$src_img = @imagecreatefromwbmp($filepath);
|
||||
break;
|
||||
default:
|
||||
$this->throwError("wrong image format, can't resize");
|
||||
break;
|
||||
}
|
||||
|
||||
if($src_img == false){
|
||||
$this->throwError("Can't resize image");
|
||||
}
|
||||
|
||||
return($src_img);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// save gd image to some filepath. return if success or not
|
||||
private function saveGdImage($dst_img,$filepath,$type){
|
||||
$successSaving = false;
|
||||
switch($type){
|
||||
case IMAGETYPE_JPEG:
|
||||
$successSaving = imagejpeg($dst_img,$filepath,$this->jpg_quality);
|
||||
break;
|
||||
case IMAGETYPE_PNG:
|
||||
$successSaving = imagepng($dst_img,$filepath);
|
||||
break;
|
||||
case IMAGETYPE_GIF:
|
||||
$successSaving = imagegif($dst_img,$filepath);
|
||||
break;
|
||||
case IMAGETYPE_BMP:
|
||||
$successSaving = imagewbmp($dst_img,$filepath);
|
||||
break;
|
||||
}
|
||||
|
||||
return($successSaving);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// crop image to specifix height and width , and save it to new path
|
||||
private function cropImageSaveNew($filepath,$filepathNew){
|
||||
|
||||
$imgInfo = getimagesize($filepath);
|
||||
$imgType = $imgInfo[2];
|
||||
|
||||
$src_img = $this->getGdSrcImage($filepath,$imgType);
|
||||
|
||||
$width = imageSX($src_img);
|
||||
$height = imageSY($src_img);
|
||||
|
||||
//crop the image from the top
|
||||
$startx = 0;
|
||||
$starty = 0;
|
||||
|
||||
//find precrop width and height:
|
||||
$percent = $this->maxWidth / $width;
|
||||
$newWidth = $this->maxWidth;
|
||||
$newHeight = ceil($percent * $height);
|
||||
|
||||
if($this->type == "exact"){ //crop the image from the middle
|
||||
$startx = 0;
|
||||
$starty = ($newHeight-$this->maxHeight)/2 / $percent;
|
||||
}
|
||||
|
||||
if($newHeight < $this->maxHeight){ //by width
|
||||
$percent = $this->maxHeight / $height;
|
||||
$newHeight = $this->maxHeight;
|
||||
$newWidth = ceil($percent * $width);
|
||||
|
||||
if($this->type == "exact"){ //crop the image from the middle
|
||||
$startx = ($newWidth - $this->maxWidth) /2 / $percent; //the startx is related to big image
|
||||
$starty = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//resize the picture:
|
||||
$tmp_img = ImageCreateTrueColor($newWidth,$newHeight);
|
||||
|
||||
$this->handleTransparency($tmp_img,$imgType,$newWidth,$newHeight);
|
||||
|
||||
imagecopyresampled($tmp_img,$src_img,0,0,$startx,$starty,$newWidth,$newHeight,$width,$height);
|
||||
|
||||
$this->handleImageEffects($tmp_img);
|
||||
|
||||
//crop the picture:
|
||||
$dst_img = ImageCreateTrueColor($this->maxWidth,$this->maxHeight);
|
||||
|
||||
$this->handleTransparency($dst_img,$imgType,$this->maxWidth,$this->maxHeight);
|
||||
|
||||
imagecopy($dst_img, $tmp_img, 0, 0, 0, 0, $newWidth, $newHeight);
|
||||
|
||||
//save the picture
|
||||
$is_saved = $this->saveGdImage($dst_img,$filepathNew,$imgType);
|
||||
|
||||
imagedestroy($dst_img);
|
||||
imagedestroy($src_img);
|
||||
imagedestroy($tmp_img);
|
||||
|
||||
return($is_saved);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// if the images are png or gif - handle image transparency
|
||||
private function handleTransparency(&$dst_img,$imgType,$newWidth,$newHeight){
|
||||
//handle transparency:
|
||||
if($imgType == IMAGETYPE_PNG || $imgType == IMAGETYPE_GIF){
|
||||
imagealphablending($dst_img, false);
|
||||
imagesavealpha($dst_img,true);
|
||||
$transparent = imagecolorallocatealpha($dst_img, 255, 255, 255, 127);
|
||||
imagefilledrectangle($dst_img, 0, 0, $newWidth, $newHeight, $transparent);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// handle image effects
|
||||
private function handleImageEffects(&$imgHandle){
|
||||
if(empty($this->effect))
|
||||
return(false);
|
||||
|
||||
switch($this->effect){
|
||||
case self::EFFECT_BW:
|
||||
if(defined("IMG_FILTER_GRAYSCALE"))
|
||||
imagefilter($imgHandle,IMG_FILTER_GRAYSCALE);
|
||||
break;
|
||||
case self::EFFECT_BRIGHTNESS:
|
||||
if(defined("IMG_FILTER_BRIGHTNESS")){
|
||||
if(!is_numeric($this->effect_arg1))
|
||||
$this->effect_arg1 = 50; //set default value
|
||||
UniteFunctionsRev::validateNumeric($this->effect_arg1,"'ea1' argument");
|
||||
imagefilter($imgHandle,IMG_FILTER_BRIGHTNESS,$this->effect_arg1);
|
||||
}
|
||||
break;
|
||||
case self::EFFECT_DARK:
|
||||
if(defined("IMG_FILTER_BRIGHTNESS")){
|
||||
if(!is_numeric($this->effect_arg1))
|
||||
$this->effect_arg1 = -50; //set default value
|
||||
UniteFunctionsRev::validateNumeric($this->effect_arg1,"'ea1' argument");
|
||||
imagefilter($imgHandle,IMG_FILTER_BRIGHTNESS,$this->effect_arg1);
|
||||
}
|
||||
break;
|
||||
case self::EFFECT_CONTRAST:
|
||||
if(defined("IMG_FILTER_CONTRAST")){
|
||||
if(!is_numeric($this->effect_arg1))
|
||||
$this->effect_arg1 = -5; //set default value
|
||||
imagefilter($imgHandle,IMG_FILTER_CONTRAST,$this->effect_arg1);
|
||||
}
|
||||
break;
|
||||
case self::EFFECT_EDGE:
|
||||
if(defined("IMG_FILTER_EDGEDETECT"))
|
||||
imagefilter($imgHandle,IMG_FILTER_EDGEDETECT);
|
||||
break;
|
||||
case self::EFFECT_EMBOSS:
|
||||
if(defined("IMG_FILTER_EMBOSS"))
|
||||
imagefilter($imgHandle,IMG_FILTER_EMBOSS);
|
||||
break;
|
||||
case self::EFFECT_BLUR:
|
||||
$this->effect_Blur($imgHandle,5);
|
||||
/*
|
||||
if(defined("IMG_FILTER_GAUSSIAN_BLUR"))
|
||||
imagefilter($imgHandle,IMG_FILTER_GAUSSIAN_BLUR);
|
||||
*/
|
||||
break;
|
||||
case self::EFFECT_MEAN:
|
||||
if(defined("IMG_FILTER_MEAN_REMOVAL"))
|
||||
imagefilter($imgHandle,IMG_FILTER_MEAN_REMOVAL);
|
||||
break;
|
||||
case self::EFFECT_SMOOTH:
|
||||
if(defined("IMG_FILTER_SMOOTH")){
|
||||
if(!is_numeric($this->effect_arg1))
|
||||
$this->effect_arg1 = 15; //set default value
|
||||
imagefilter($imgHandle,IMG_FILTER_SMOOTH,$this->effect_arg1);
|
||||
}
|
||||
break;
|
||||
case self::EFFECT_BLUR3:
|
||||
$this->effect_Blur($imgHandle,5);
|
||||
break;
|
||||
default:
|
||||
$this->throwError("Effect not supported: <b>{$this->effect}</b>");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function effect_Blur(&$gdimg, $radius=0.5) {
|
||||
// Taken from Torstein Hרnsi's phpUnsharpMask (see phpthumb.unsharp.php)
|
||||
|
||||
$radius = round(max(0, min($radius, 50)) * 2);
|
||||
if (!$radius) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$w = ImageSX($gdimg);
|
||||
$h = ImageSY($gdimg);
|
||||
if ($imgBlur = ImageCreateTrueColor($w, $h)) {
|
||||
// Gaussian blur matrix:
|
||||
// 1 2 1
|
||||
// 2 4 2
|
||||
// 1 2 1
|
||||
|
||||
// Move copies of the image around one pixel at the time and merge them with weight
|
||||
// according to the matrix. The same matrix is simply repeated for higher radii.
|
||||
for ($i = 0; $i < $radius; $i++) {
|
||||
ImageCopy ($imgBlur, $gdimg, 0, 0, 1, 1, $w - 1, $h - 1); // up left
|
||||
ImageCopyMerge($imgBlur, $gdimg, 1, 1, 0, 0, $w, $h, 50.00000); // down right
|
||||
ImageCopyMerge($imgBlur, $gdimg, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left
|
||||
ImageCopyMerge($imgBlur, $gdimg, 1, 0, 0, 1, $w, $h - 1, 25.00000); // up right
|
||||
ImageCopyMerge($imgBlur, $gdimg, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left
|
||||
ImageCopyMerge($imgBlur, $gdimg, 1, 0, 0, 0, $w, $h, 25.00000); // right
|
||||
ImageCopyMerge($imgBlur, $gdimg, 0, 0, 0, 1, $w, $h - 1, 20.00000); // up
|
||||
ImageCopyMerge($imgBlur, $gdimg, 0, 1, 0, 0, $w, $h, 16.666667); // down
|
||||
ImageCopyMerge($imgBlur, $gdimg, 0, 0, 0, 0, $w, $h, 50.000000); // center
|
||||
ImageCopy ($gdimg, $imgBlur, 0, 0, 0, 0, $w, $h);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// resize image and save it to new path
|
||||
private function resizeImageSaveNew($filepath,$filepathNew){
|
||||
|
||||
$imgInfo = getimagesize($filepath);
|
||||
$imgType = $imgInfo[2];
|
||||
|
||||
$src_img = $this->getGdSrcImage($filepath,$imgType);
|
||||
|
||||
$width = imageSX($src_img);
|
||||
$height = imageSY($src_img);
|
||||
|
||||
$newWidth = $width;
|
||||
$newHeight = $height;
|
||||
|
||||
//find new width
|
||||
if($height > $this->maxHeight){
|
||||
$procent = $this->maxHeight / $height;
|
||||
$newWidth = ceil($width * $procent);
|
||||
$newHeight = $this->maxHeight;
|
||||
}
|
||||
|
||||
//if the new width is grater than max width, find new height, and remain the width.
|
||||
if($newWidth > $this->maxWidth){
|
||||
$procent = $this->maxWidth / $newWidth;
|
||||
$newHeight = ceil($newHeight * $procent);
|
||||
$newWidth = $this->maxWidth;
|
||||
}
|
||||
|
||||
//if the image don't need to be resized, just copy it from source to destanation.
|
||||
if($newWidth == $width && $newHeight == $height && empty($this->effect)){
|
||||
$success = copy($filepath,$filepathNew);
|
||||
if($success == false)
|
||||
$this->throwError("can't copy the image from one path to another");
|
||||
}
|
||||
else{ //else create the resized image, and save it to new path:
|
||||
$dst_img = ImageCreateTrueColor($newWidth,$newHeight);
|
||||
|
||||
$this->handleTransparency($dst_img,$imgType,$newWidth,$newHeight);
|
||||
|
||||
//copy the new resampled image:
|
||||
imagecopyresampled($dst_img,$src_img,0,0,0,0,$newWidth,$newHeight,$width,$height);
|
||||
|
||||
$this->handleImageEffects($dst_img);
|
||||
|
||||
$is_saved = $this->saveGdImage($dst_img,$filepathNew,$imgType);
|
||||
imagedestroy($dst_img);
|
||||
}
|
||||
|
||||
imagedestroy($src_img);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* set image effect
|
||||
*/
|
||||
public function setEffect($effect,$arg1 = ""){
|
||||
$this->effect = $effect;
|
||||
$this->effect_arg1 = $arg1;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
//return image
|
||||
private function showImage($filename,$maxWidth=-1,$maxHeight=-1,$type=""){
|
||||
|
||||
if(empty($filename))
|
||||
$this->throwError("image filename not found");
|
||||
|
||||
//validate input
|
||||
if($type == self::TYPE_EXACT || $type == self::TYPE_EXACT_TOP){
|
||||
if($maxHeight == -1)
|
||||
$this->throwError("image with exact type must have height!");
|
||||
if($maxWidth == -1)
|
||||
$this->throwError("image with exact type must have width!");
|
||||
}
|
||||
|
||||
$filepath = $this->pathImages.$filename;
|
||||
|
||||
|
||||
if(!is_file($filepath)) $this->outputEmptyImageCode();
|
||||
|
||||
//if gd library doesn't exists - output normal image without resizing.
|
||||
if(function_exists("gd_info") == false)
|
||||
$this->throwError("php must support GD Library");
|
||||
|
||||
//check conditions for output original image
|
||||
if(empty($this->effect)){
|
||||
if((is_numeric($maxWidth) == false || is_numeric($maxHeight) == false)) outputImage($filepath);
|
||||
|
||||
if($maxWidth == -1 && $maxHeight == -1)
|
||||
$this->outputImage($filepath);
|
||||
}
|
||||
|
||||
if($maxWidth == -1) $maxWidth = 1000000;
|
||||
if($maxHeight == -1) $maxHeight = 100000;
|
||||
|
||||
//init variables
|
||||
$this->filename = $filename;
|
||||
$this->maxWidth = $maxWidth;
|
||||
$this->maxHeight = $maxHeight;
|
||||
$this->type = $type;
|
||||
|
||||
$filepathNew = $this->getThumbFilepath();
|
||||
|
||||
if(is_file($filepathNew)){
|
||||
$this->outputImage($filepathNew);
|
||||
exit();
|
||||
}
|
||||
|
||||
try{
|
||||
if($type == self::TYPE_EXACT || $type == self::TYPE_EXACT_TOP){
|
||||
$isSaved = $this->cropImageSaveNew($filepath,$filepathNew);
|
||||
}
|
||||
else
|
||||
$isSaved = $this->resizeImageSaveNew($filepath,$filepathNew);
|
||||
|
||||
if($isSaved == false){
|
||||
$this->outputImage($filepath);
|
||||
exit();
|
||||
}
|
||||
|
||||
}catch(Exception $e){
|
||||
$this->outputImage($filepath);
|
||||
}
|
||||
|
||||
if(is_file($filepathNew))
|
||||
$this->outputImage($filepathNew);
|
||||
else
|
||||
$this->outputImage($filepath);
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* show image from get params
|
||||
*/
|
||||
public function showImageFromGet(){
|
||||
|
||||
$imageFilename = UniteFunctionsRev::getGetVar("img");
|
||||
$maxWidth = UniteFunctionsRev::getGetVar("w",-1);
|
||||
$maxHeight = UniteFunctionsRev::getGetVar("h",-1);
|
||||
$type = UniteFunctionsRev::getGetVar("t","");
|
||||
|
||||
//set effect
|
||||
$effect = UniteFunctionsRev::getGetVar("e");
|
||||
$effectArgument1 = UniteFunctionsRev::getGetVar("ea1");
|
||||
|
||||
if(!empty($effect))
|
||||
$this->setEffect($effect,$effectArgument1);
|
||||
|
||||
$this->showImage($imageFilename,$maxWidth,$maxHeight,$type);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// download image, change size and name if needed.
|
||||
public function downloadImage($filename){
|
||||
$filepath = $this->urlImages."/".$filename;
|
||||
if(!is_file($filepath)) {
|
||||
echo "file doesn't exists";
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->outputImageForDownload($filepath,$filename);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
// output image for downloading
|
||||
private function outputImageForDownload($filepath,$filename,$mimeType=""){
|
||||
$contents = file_get_contents($filepath);
|
||||
$filesize = strlen($contents);
|
||||
|
||||
if($mimeType == ""){
|
||||
$info = UniteFunctionsRev::getPathInfo($filepath);
|
||||
$ext = $info["extension"];
|
||||
$mimeType = "image/$ext";
|
||||
}
|
||||
|
||||
header("Content-Type: $mimeType");
|
||||
header("Content-Disposition: attachment; filename=\"$filename\"");
|
||||
header("Content-Length: $filesize");
|
||||
echo $contents;
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* validate type
|
||||
* @param unknown_type $type
|
||||
*/
|
||||
public function validateType($type){
|
||||
switch($type){
|
||||
case self::TYPE_EXACT:
|
||||
case self::TYPE_EXACT_TOP:
|
||||
break;
|
||||
default:
|
||||
$this->throwError("Wrong image type: ".$type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
$folderIncludes = dirname(__FILE__)."/";
|
||||
|
||||
require_once $folderIncludes . 'functions.php';
|
||||
require_once $folderIncludes . 'functions.class.php';
|
||||
require_once $folderIncludes . 'functions_wordpress.class.php';
|
||||
require_once $folderIncludes . 'db.class.php';
|
||||
require_once $folderIncludes . 'settings.class.php';
|
||||
require_once $folderIncludes . 'cssparser.class.php';
|
||||
require_once $folderIncludes . 'settings_advances.class.php';
|
||||
require_once $folderIncludes . 'settings_output.class.php';
|
||||
require_once $folderIncludes . 'settings_product.class.php';
|
||||
require_once $folderIncludes . 'settings_product_sidebar.class.php';
|
||||
require_once $folderIncludes . 'image_view.class.php';
|
||||
require_once $folderIncludes . 'zip.class.php';
|
||||
|
||||
?>
|
@ -0,0 +1,961 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* unite settings class.
|
||||
* @version 1.1
|
||||
*
|
||||
*/
|
||||
|
||||
class UniteSettingsRev{
|
||||
|
||||
const COLOR_OUTPUT_FLASH = "flash";
|
||||
const COLOR_OUTPUT_HTML = "html";
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
const RELATED_NONE = "";
|
||||
const TYPE_TEXT = "text";
|
||||
const TYPE_COLOR = "color";
|
||||
const TYPE_SELECT = "list";
|
||||
const TYPE_CHECKBOX = "checkbox";
|
||||
const TYPE_RADIO = "radio";
|
||||
const TYPE_TEXTAREA = "textarea";
|
||||
const TYPE_STATIC_TEXT = "statictext";
|
||||
const TYPE_HR = "hr";
|
||||
const TYPE_CUSTOM = "custom";
|
||||
const ID_PREFIX = "";
|
||||
const TYPE_CONTROL = "control";
|
||||
const TYPE_BUTTON = "button";
|
||||
const TYPE_IMAGE = "image";
|
||||
const TYPE_CHECKLIST = "checklist";
|
||||
|
||||
//------------------------------------------------------------
|
||||
//set data types
|
||||
const DATATYPE_NUMBER = "number";
|
||||
const DATATYPE_STRING = "string";
|
||||
const DATATYPE_BOOLEAN = "boolean";
|
||||
|
||||
const CONTROL_TYPE_ENABLE = "enable";
|
||||
const CONTROL_TYPE_DISABLE = "disable";
|
||||
const CONTROL_TYPE_SHOW = "show";
|
||||
const CONTROL_TYPE_HIDE = "hide";
|
||||
|
||||
//additional parameters that can be added to settings.
|
||||
const PARAM_TEXTSTYLE = "textStyle";
|
||||
const PARAM_ADDPARAMS = "addparams"; //additional text after the field
|
||||
const PARAM_ADDTEXT = "addtext"; //additional text after the field
|
||||
const PARAM_ADDTEXT_BEFORE_ELEMENT = "addtext_before_element"; //additional text after the field
|
||||
const PARAM_CELLSTYLE = "cellStyle"; //additional text after the field
|
||||
|
||||
//view defaults:
|
||||
protected $defaultText = "Enter value";
|
||||
protected $sap_size = 5;
|
||||
|
||||
//other variables:
|
||||
protected $HRIdCounter = 0; //counter of hr id
|
||||
|
||||
protected $arrSettings = array();
|
||||
protected $arrSections = array();
|
||||
protected $arrIndex = array(); //index of name->index of the settings.
|
||||
protected $arrSaps = array();
|
||||
|
||||
//controls:
|
||||
protected $arrControls = array(); //array of items that controlling others (hide/show or enabled/disabled)
|
||||
protected $arrBulkControl = array(); //bulk cotnrol array. if not empty, every settings will be connected with control.
|
||||
|
||||
//custom functions:
|
||||
protected $customFunction_afterSections = null;
|
||||
protected $colorOutputType = self::COLOR_OUTPUT_HTML;
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// constructor
|
||||
public function __construct(){
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// get where query according relatedTo and relatedID.
|
||||
private function getWhereQuery(){
|
||||
$where = "relatedTo='".$this->relatedTo."' and relatedID='".$this->relatedID."'";
|
||||
return($where);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//set type of color output
|
||||
public function setColorOutputType($type){
|
||||
$this->colorOutputType = $type;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//set the related to/id for saving/restoring settings.
|
||||
public function setRelated($relatedTo,$relatedID){
|
||||
$this->relatedTo = $relatedTo;
|
||||
$this->relatedID = $relatedID;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//modify the data before save
|
||||
private function modifySettingsData($arrSettings){
|
||||
|
||||
foreach($arrSettings as $key=>$content){
|
||||
switch(getType($content)){
|
||||
case "string":
|
||||
//replace the unicode line break (sometimes left after json)
|
||||
$content = str_replace("u000a","\n",$content);
|
||||
$content = str_replace("u000d","",$content);
|
||||
break;
|
||||
case "object":
|
||||
case "array":
|
||||
$content = UniteFunctionsRev::convertStdClassToArray($content);
|
||||
break;
|
||||
}
|
||||
|
||||
$arrSettings[$key] = $content;
|
||||
}
|
||||
|
||||
return($arrSettings);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// add the section value to the setting
|
||||
private function checkAndAddSectionAndSap($setting){
|
||||
//add section
|
||||
if(!empty($this->arrSections)){
|
||||
$sectionKey = count($this->arrSections)-1;
|
||||
$setting["section"] = $sectionKey;
|
||||
$section = $this->arrSections[$sectionKey];
|
||||
$sapKey = count($section["arrSaps"])-1;
|
||||
$setting["sap"] = $sapKey;
|
||||
}
|
||||
else{
|
||||
//please impliment add sap normal!!! - without sections
|
||||
}
|
||||
return($setting);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// validate items parameter. throw exception on error
|
||||
private function validateParamItems($arrParams){
|
||||
if(!isset($arrParams["items"])) throw new Exception("no select items presented");
|
||||
if(!is_array($arrParams["items"])) throw new Exception("the items parameter should be array");
|
||||
if(empty($arrParams["items"])) throw new Exception("the items array should not be empty");
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add this setting to index
|
||||
private function addSettingToIndex($name){
|
||||
$this->arrIndex[$name] = count($this->arrSettings)-1;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//get types array from all the settings:
|
||||
protected function getArrTypes(){
|
||||
$arrTypesAssoc = array();
|
||||
$arrTypes = array();
|
||||
foreach($this->arrSettings as $setting){
|
||||
$type = $setting["type"];
|
||||
if(!isset($arrTypesAssoc[$type])) $arrTypes[] = $type;
|
||||
$arrTypesAssoc[$type] = "";
|
||||
}
|
||||
return($arrTypes);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// get json client object for javascript
|
||||
public function getJsonClientString(){
|
||||
$arrSettingTypes = array();
|
||||
foreach($this->arrSettings as $setting){
|
||||
if(isset($setting["name"]))
|
||||
$arrSettingTypes[$setting["name"]] = $setting["datatype"];
|
||||
}
|
||||
$strJson = json_encode($arrSettingTypes);
|
||||
return($strJson);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get settings array
|
||||
*/
|
||||
public function getArrSettings(){
|
||||
return($this->arrSettings);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get sections
|
||||
*/
|
||||
public function getArrSections(){
|
||||
return($this->arrSections);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get controls
|
||||
*/
|
||||
public function getArrControls(){
|
||||
return($this->arrControls);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* set settings array
|
||||
*/
|
||||
public function setArrSettings($arrSettings){
|
||||
$this->arrSettings = $arrSettings;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//get number of settings
|
||||
public function getNumSettings(){
|
||||
$counter = 0;
|
||||
foreach($this->arrSettings as $setting){
|
||||
switch($setting["type"]){
|
||||
case self::TYPE_HR:
|
||||
case self::TYPE_STATIC_TEXT:
|
||||
break;
|
||||
default:
|
||||
$counter++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return($counter);
|
||||
}
|
||||
|
||||
//private function
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// add radio group
|
||||
public function addRadio($name,$arrItems,$text = "",$defaultItem="",$arrParams = array()){
|
||||
$params = array("items"=>$arrItems);
|
||||
$params = array_merge($params,$arrParams);
|
||||
$this->add($name,$defaultItem,$text,self::TYPE_RADIO,$params);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add text area control
|
||||
public function addTextArea($name,$defaultValue,$text,$arrParams = array()){
|
||||
$this->add($name,$defaultValue,$text,self::TYPE_TEXTAREA,$arrParams);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add button control
|
||||
public function addButton($name,$value,$arrParams = array()){
|
||||
$this->add($name,$value,"",self::TYPE_BUTTON,$arrParams);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// add checkbox element
|
||||
public function addCheckbox($name,$defaultValue = false,$text = "",$arrParams = array()){
|
||||
$this->add($name,$defaultValue,$text,self::TYPE_CHECKBOX,$arrParams);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add text box element
|
||||
public function addTextBox($name,$defaultValue = "",$text = "",$arrParams = array()){
|
||||
$this->add($name,$defaultValue,$text,self::TYPE_TEXT,$arrParams);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add image selector
|
||||
public function addImage($name,$defaultValue = "",$text = "",$arrParams = array()){
|
||||
$this->add($name,$defaultValue,$text,self::TYPE_IMAGE,$arrParams);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add color picker setting
|
||||
public function addColorPicker($name,$defaultValue = "",$text = "",$arrParams = array()){
|
||||
$this->add($name,$defaultValue,$text,self::TYPE_COLOR,$arrParams);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* add custom setting
|
||||
*/
|
||||
public function addCustom($customType,$name,$defaultValue = "",$text = "",$arrParams = array()){
|
||||
$params = array();
|
||||
$params["custom_type"] = $customType;
|
||||
$params = array_merge($params,$arrParams);
|
||||
|
||||
$this->add($name,$defaultValue,$text,self::TYPE_CUSTOM,$params);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add horezontal sap
|
||||
public function addHr($name="",$params=array()){
|
||||
$setting = array();
|
||||
$setting["type"] = self::TYPE_HR;
|
||||
|
||||
//set item name
|
||||
$itemName = "";
|
||||
if($name != "") $itemName = $name;
|
||||
else{ //generate hr id
|
||||
$this->HRIdCounter++;
|
||||
$itemName = "hr".$this->HRIdCounter;
|
||||
}
|
||||
|
||||
$setting["id"] = self::ID_PREFIX.$itemName;
|
||||
$setting["id_row"] = $setting["id"]."_row";
|
||||
|
||||
//addsection and sap keys
|
||||
$setting = $this->checkAndAddSectionAndSap($setting);
|
||||
|
||||
$this->checkAddBulkControl($itemName);
|
||||
|
||||
$setting = array_merge($params,$setting);
|
||||
$this->arrSettings[] = $setting;
|
||||
|
||||
//add to settings index
|
||||
$this->addSettingToIndex($itemName);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add static text
|
||||
public function addStaticText($text,$name="",$params=array()){
|
||||
$setting = array();
|
||||
$setting["type"] = self::TYPE_STATIC_TEXT;
|
||||
|
||||
//set item name
|
||||
$itemName = "";
|
||||
if($name != "") $itemName = $name;
|
||||
else{ //generate hr id
|
||||
$this->HRIdCounter++;
|
||||
$itemName = "textitem".$this->HRIdCounter;
|
||||
}
|
||||
|
||||
$setting["id"] = self::ID_PREFIX.$itemName;
|
||||
$setting["id_row"] = $setting["id"]."_row";
|
||||
$setting["text"] = $text;
|
||||
|
||||
$this->checkAddBulkControl($itemName);
|
||||
|
||||
$params = array_merge($params,$setting);
|
||||
|
||||
//addsection and sap keys
|
||||
$setting = $this->checkAndAddSectionAndSap($setting);
|
||||
|
||||
$this->arrSettings[] = $setting;
|
||||
|
||||
//add to settings index
|
||||
$this->addSettingToIndex($itemName);
|
||||
}
|
||||
|
||||
/**
|
||||
* add select setting
|
||||
*/
|
||||
public function addSelect($name,$arrItems,$text,$defaultItem="",$arrParams=array()){
|
||||
$params = array("items"=>$arrItems);
|
||||
$params = array_merge($params,$arrParams);
|
||||
$this->add($name,$defaultItem,$text,self::TYPE_SELECT,$params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add select setting
|
||||
*/
|
||||
public function addChecklist($name,$arrItems,$text,$defaultItem="",$arrParams=array()){
|
||||
$params = array("items"=>$arrItems);
|
||||
$params = array_merge($params,$arrParams);
|
||||
$this->add($name,$defaultItem,$text,self::TYPE_CHECKLIST,$params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* add saporator
|
||||
*/
|
||||
public function addSap($text, $name="", $opened = false){
|
||||
|
||||
if(empty($text))
|
||||
UniteFunctionsRev::throwError("sap $name must have a text");
|
||||
|
||||
//create sap array
|
||||
$sap = array();
|
||||
$sap["name"] = $name;
|
||||
$sap["text"] = $text;
|
||||
|
||||
if($opened == true) $sap["opened"] = true;
|
||||
|
||||
//add sap to current section
|
||||
if(!empty($this->arrSections)){
|
||||
$lastSection = end($this->arrSections);
|
||||
$section_keys = array_keys($this->arrSections);
|
||||
$lastSectionKey = end($section_keys);
|
||||
$arrSaps = $lastSection["arrSaps"];
|
||||
$arrSaps[] = $sap;
|
||||
$this->arrSections[$lastSectionKey]["arrSaps"] = $arrSaps;
|
||||
$sap_keys = array_keys($arrSaps);
|
||||
$sapKey = end($sap_keys);
|
||||
}
|
||||
else{
|
||||
$this->arrSaps[] = $sap;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//get sap data:
|
||||
public function getSap($sapKey,$sectionKey=-1){
|
||||
//get sap without sections:
|
||||
if($sectionKey == -1) return($this->arrSaps[$sapKey]);
|
||||
if(!isset($this->arrSections[$sectionKey])) throw new Exception("Sap on section:".$sectionKey." doesn't exists");
|
||||
$arrSaps = $this->arrSections[$sectionKey]["arrSaps"];
|
||||
if(!isset($arrSaps[$sapKey])) throw new Exception("Sap with key:".$sapKey." doesn't exists");
|
||||
$sap = $arrSaps[$sapKey];
|
||||
return($sap);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// add a new section. Every settings from now on will be related to this section
|
||||
public function addSection($label,$name=""){
|
||||
|
||||
if(!empty($this->arrSettings) && empty($this->arrSections))
|
||||
UniteFunctionsRev::throwError("You should add first section before begin to add settings. (section: $text)");
|
||||
|
||||
if(empty($label))
|
||||
UniteFunctionsRev::throwError("You have some section without text");
|
||||
|
||||
$arrSection = array(
|
||||
"text"=>$label,
|
||||
"arrSaps"=>array(),
|
||||
"name"=>$name
|
||||
);
|
||||
|
||||
$this->arrSections[] = $arrSection;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add setting, may be in different type, of values
|
||||
protected function add($name,$defaultValue = "",$text = "",$type = self::TYPE_TEXT,$arrParams = array()){
|
||||
|
||||
//validation:
|
||||
if(empty($name)) throw new Exception("Every setting should have a name!");
|
||||
|
||||
switch($type){
|
||||
case self::TYPE_RADIO:
|
||||
case self::TYPE_SELECT:
|
||||
$this->validateParamItems($arrParams);
|
||||
break;
|
||||
case self::TYPE_CHECKBOX:
|
||||
if(!is_bool($defaultValue)) throw new Exception("The checkbox value should be boolean");
|
||||
break;
|
||||
}
|
||||
|
||||
//validate name:
|
||||
if(isset($this->arrIndex[$name])) throw new Exception("Duplicate setting name:".$name);
|
||||
|
||||
$this->checkAddBulkControl($name);
|
||||
|
||||
//set defaults:
|
||||
if($text == "") $text = $this->defaultText;
|
||||
|
||||
$setting = array();
|
||||
$setting["name"] = $name;
|
||||
$setting["id"] = self::ID_PREFIX.$name;
|
||||
$setting["id_service"] = $setting["id"]."_service";
|
||||
$setting["id_row"] = $setting["id"]."_row";
|
||||
$setting["type"] = $type;
|
||||
$setting["text"] = $text;
|
||||
$setting["value"] = $defaultValue;
|
||||
|
||||
//set data type:
|
||||
switch($setting["type"]){
|
||||
case self::TYPE_COLOR:
|
||||
$dataType = self::DATATYPE_STRING;
|
||||
break;
|
||||
default:
|
||||
switch(getType($defaultValue)){
|
||||
case "integer":
|
||||
case "double":
|
||||
$dataType = self::DATATYPE_NUMBER;
|
||||
break;
|
||||
case "boolean":
|
||||
$dataType = self::DATATYPE_BOOLEAN;
|
||||
break;
|
||||
case "string":
|
||||
default:
|
||||
$dataType = self::DATATYPE_STRING;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
$setting["datatype"] = $dataType;
|
||||
|
||||
$setting = array_merge($setting,$arrParams);
|
||||
|
||||
//addsection and sap keys
|
||||
$setting = $this->checkAndAddSectionAndSap($setting);
|
||||
|
||||
$this->arrSettings[] = $setting;
|
||||
|
||||
//add to settings index
|
||||
$this->addSettingToIndex($name);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//add a item that controlling visibility of enabled/disabled of other.
|
||||
public function addControl($control_item_name,$controlled_item_name,$control_type,$value){
|
||||
|
||||
UniteFunctionsRev::validateNotEmpty($control_item_name,"control parent");
|
||||
UniteFunctionsRev::validateNotEmpty($controlled_item_name,"control child");
|
||||
UniteFunctionsRev::validateNotEmpty($control_type,"control type");
|
||||
UniteFunctionsRev::validateNotEmpty($value,"control value");
|
||||
|
||||
$arrControl = array();
|
||||
if(isset($this->arrControls[$control_item_name]))
|
||||
$arrControl = $this->arrControls[$control_item_name];
|
||||
$arrControl[] = array("name"=>$controlled_item_name,"type"=>$control_type,"value"=>$value);
|
||||
$this->arrControls[$control_item_name] = $arrControl;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//start control of all settings that comes after this function (between startBulkControl and endBulkControl)
|
||||
public function startBulkControl($control_item_name,$control_type,$value){
|
||||
$this->arrBulkControl = array("control_name"=>$control_item_name,"type"=>$control_type,"value"=>$value);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//end bulk control
|
||||
public function endBulkControl(){
|
||||
$this->arrBulkControl = array();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//build name->(array index) of the settings.
|
||||
private function buildArrSettingsIndex(){
|
||||
$this->arrIndex = array();
|
||||
foreach($this->arrSettings as $key=>$value)
|
||||
if(isset($value["name"])) $this->arrIndex[$value["name"]] = $key;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// set sattes of the settings (enabled/disabled, visible/invisible) by controls
|
||||
public function setSettingsStateByControls(){
|
||||
|
||||
foreach($this->arrControls as $control_name => $arrControlled){
|
||||
//take the control value
|
||||
if(!isset($this->arrIndex[$control_name])) throw new Exception("There is not sutch control setting: '$control_name'");
|
||||
$index = $this->arrIndex[$control_name];
|
||||
$parentValue = strtolower($this->arrSettings[$index]["value"]);
|
||||
|
||||
//set child (controlled) attributes
|
||||
foreach($arrControlled as $controlled){
|
||||
if(!isset($this->arrIndex[$controlled["name"]])) throw new Exception("There is not sutch controlled setting: '".$controlled["name"]."'");
|
||||
$indexChild = $this->arrIndex[$controlled["name"]];
|
||||
$child = $this->arrSettings[$indexChild];
|
||||
$value = strtolower($controlled["value"]);
|
||||
switch($controlled["type"]){
|
||||
case self::CONTROL_TYPE_ENABLE:
|
||||
if($value != $parentValue) $child["disabled"] = true;
|
||||
break;
|
||||
case self::CONTROL_TYPE_DISABLE:
|
||||
if($value == $parentValue) $child["disabled"] = true;
|
||||
break;
|
||||
case self::CONTROL_TYPE_SHOW:
|
||||
if($value != $parentValue) $child["hidden"] = true;
|
||||
break;
|
||||
case self::CONTROL_TYPE_HIDE:
|
||||
if($value == $parentValue) $child["hidden"] = true;
|
||||
break;
|
||||
}
|
||||
$this->arrSettings[$indexChild] = $child;
|
||||
}
|
||||
}//end foreach
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//check that bulk control is available , and add some element to it.
|
||||
private function checkAddBulkControl($name){
|
||||
//add control
|
||||
if(!empty($this->arrBulkControl))
|
||||
$this->addControl($this->arrBulkControl["control_name"],$name,$this->arrBulkControl["type"],$this->arrBulkControl["value"]);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//set custom function that will be run after sections will be drawen
|
||||
public function setCustomDrawFunction_afterSections($func){
|
||||
$this->customFunction_afterSections = $func;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* parse options from xml field
|
||||
* @param $field
|
||||
*/
|
||||
private function getOptionsFromXMLField($field,$fieldName){
|
||||
$arrOptions = array();
|
||||
|
||||
$arrField = (array)$field;
|
||||
$options = UniteFunctionsRev::getVal($arrField, "option");
|
||||
|
||||
if(empty($options))
|
||||
return($arrOptions);
|
||||
|
||||
foreach($options as $option){
|
||||
|
||||
if(gettype($option) == "string")
|
||||
UniteFunctionsRev::throwError("Wrong options type: ".$option." in field: $fieldName");
|
||||
|
||||
$attribs = $option->attributes();
|
||||
|
||||
$optionValue = (string)UniteFunctionsRev::getVal($attribs, "value");
|
||||
$optionText = (string)UniteFunctionsRev::getVal($attribs, "text");
|
||||
|
||||
//validate options:
|
||||
UniteFunctionsRev::validateNotEmpty($optionValue,"option value");
|
||||
UniteFunctionsRev::validateNotEmpty($optionText,"option text");
|
||||
|
||||
$arrOptions[$optionValue] = $optionText;
|
||||
}
|
||||
|
||||
return($arrOptions);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* load settings from xml file
|
||||
*/
|
||||
public function loadXMLFile($filepath){
|
||||
|
||||
if(!file_exists($filepath))
|
||||
UniteFunctionsRev::throwError("File: '$filepath' not exists!!!");
|
||||
|
||||
$obj = simplexml_load_file($filepath);
|
||||
|
||||
if(empty($obj))
|
||||
UniteFunctionsRev::throwError("Wrong xml file format: $filepath");
|
||||
|
||||
$fieldsets = $obj->fieldset;
|
||||
if(!@count($obj->fieldset)){
|
||||
$fieldsets = array($fieldsets);
|
||||
}
|
||||
|
||||
$this->addSection("Xml Settings");
|
||||
|
||||
foreach($fieldsets as $fieldset){
|
||||
|
||||
//Add Section
|
||||
$attribs = $fieldset->attributes();
|
||||
|
||||
$sapName = (string)UniteFunctionsRev::getVal($attribs, "name");
|
||||
$sapLabel = (string)UniteFunctionsRev::getVal($attribs, "label");
|
||||
|
||||
UniteFunctionsRev::validateNotEmpty($sapName,"sapName");
|
||||
UniteFunctionsRev::validateNotEmpty($sapLabel,"sapLabel");
|
||||
|
||||
$this->addSap($sapLabel,$sapName);
|
||||
|
||||
//--- add fields
|
||||
$fieldset = (array)$fieldset;
|
||||
$fields = $fieldset["field"];
|
||||
|
||||
if(is_array($fields) == false)
|
||||
$fields = array($fields);
|
||||
|
||||
foreach($fields as $field){
|
||||
$attribs = $field->attributes();
|
||||
$fieldType = (string)UniteFunctionsRev::getVal($attribs, "type");
|
||||
$fieldName = (string)UniteFunctionsRev::getVal($attribs, "name");
|
||||
$fieldLabel = (string)UniteFunctionsRev::getVal($attribs, "label");
|
||||
$fieldDefaultValue = (string)UniteFunctionsRev::getVal($attribs, "default");
|
||||
|
||||
//all other params will be added to "params array".
|
||||
$arrMustParams = array("type","name","label","default");
|
||||
|
||||
$arrParams = array();
|
||||
|
||||
foreach($attribs as $key=>$value){
|
||||
$key = (string)$key;
|
||||
$value = (string)$value;
|
||||
|
||||
//skip must params:
|
||||
if(in_array($key, $arrMustParams))
|
||||
continue;
|
||||
|
||||
$arrParams[$key] = $value;
|
||||
}
|
||||
|
||||
$options = $this->getOptionsFromXMLField($field,$fieldName);
|
||||
|
||||
//validate must fields:
|
||||
UniteFunctionsRev::validateNotEmpty($fieldType,"type");
|
||||
|
||||
//validate name
|
||||
if($fieldType != self::TYPE_HR && $fieldType != self::TYPE_CONTROL &&
|
||||
$fieldType != "bulk_control_start" && $fieldType != "bulk_control_end")
|
||||
UniteFunctionsRev::validateNotEmpty($fieldName,"name");
|
||||
switch ($fieldType){
|
||||
case self::TYPE_CHECKBOX:
|
||||
$fieldDefaultValue = UniteFunctionsRev::strToBool($fieldDefaultValue);
|
||||
$this->addCheckbox($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
|
||||
break;
|
||||
case self::TYPE_COLOR:
|
||||
$this->addColorPicker($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
|
||||
break;
|
||||
case self::TYPE_HR:
|
||||
$this->addHr();
|
||||
break;
|
||||
case self::TYPE_TEXT:
|
||||
$this->addTextBox($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
|
||||
break;
|
||||
case self::TYPE_STATIC_TEXT:
|
||||
$this->addStaticText($fieldLabel, $fieldName, $arrParams);
|
||||
break;
|
||||
case self::TYPE_IMAGE:
|
||||
$this->addImage($fieldName,$fieldDefaultValue,$fieldLabel,$arrParams);
|
||||
break;
|
||||
case self::TYPE_SELECT:
|
||||
$this->addSelect($fieldName, $options, $fieldLabel,$fieldDefaultValue,$arrParams);
|
||||
break;
|
||||
case self::TYPE_CHECKBOX:
|
||||
$this->addChecklist($fieldName, $options, $fieldLabel,$fieldDefaultValue,$arrParams);
|
||||
break;
|
||||
case self::TYPE_RADIO:
|
||||
$this->addRadio($fieldName, $options, $fieldLabel,$fieldDefaultValue,$arrParams);
|
||||
break;
|
||||
case self::TYPE_TEXTAREA:
|
||||
$this->addTextArea($fieldName, $fieldDefaultValue, $fieldLabel, $arrParams);
|
||||
break;
|
||||
case self::TYPE_CUSTOM:
|
||||
$this->add($fieldName, $fieldDefaultValue, $fieldLabel, self::TYPE_CUSTOM, $arrParams);
|
||||
break;
|
||||
case self::TYPE_CONTROL:
|
||||
$parent = UniteFunctionsRev::getVal($arrParams, "parent");
|
||||
$child = UniteFunctionsRev::getVal($arrParams, "child");
|
||||
$ctype = UniteFunctionsRev::getVal($arrParams, "ctype");
|
||||
$value = UniteFunctionsRev::getVal($arrParams, "value");
|
||||
$this->addControl($parent, $child, $ctype, $value);
|
||||
break;
|
||||
case "bulk_control_start":
|
||||
$parent = UniteFunctionsRev::getVal($arrParams, "parent");
|
||||
$ctype = UniteFunctionsRev::getVal($arrParams, "ctype");
|
||||
$value = UniteFunctionsRev::getVal($arrParams, "value");
|
||||
|
||||
$this->startBulkControl($parent, $ctype, $value);
|
||||
break;
|
||||
case "bulk_control_end":
|
||||
$this->endBulkControl();
|
||||
break;
|
||||
default:
|
||||
UniteFunctionsRev::throwError("wrong type: $fieldType");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get titles and descriptions array
|
||||
*/
|
||||
public function getArrTextFromAllSettings(){
|
||||
$arr = array();
|
||||
$arrUnits = array();
|
||||
|
||||
//get saps array:
|
||||
foreach($this->arrSections as $section){
|
||||
$arrSaps = UniteFunctionsRev::getVal($section, "arrSaps");
|
||||
if(empty($arrSaps))
|
||||
continue;
|
||||
foreach($arrSaps as $sap){
|
||||
$text = $sap["text"];
|
||||
if(!empty($text))
|
||||
$arr[] = $text;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($this->arrSettings as $setting){
|
||||
|
||||
$text = UniteFunctionsRev::getVal($setting, "text");
|
||||
$desc = UniteFunctionsRev::getVal($setting, "description");
|
||||
$unit = UniteFunctionsRev::getVal($setting, "unit");
|
||||
|
||||
if(!empty($text))
|
||||
$arr[] = $text;
|
||||
|
||||
if(!empty($desc))
|
||||
$arr[] = $desc;
|
||||
|
||||
if(!empty($unit)){
|
||||
if(!isset($arrUnits[$unit]))
|
||||
$arr[] = $unit;
|
||||
$arrUnits[$unit] = true;
|
||||
}
|
||||
|
||||
$items = UniteFunctionsRev::getVal($setting, "items");
|
||||
if(!empty($items)){
|
||||
foreach($items as $item){
|
||||
if(!isset($arrUnits[$item]))
|
||||
$arr[] = $item;
|
||||
$arrUnits[$item] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return($arr);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get setting array by name
|
||||
*/
|
||||
public function getSettingByName($name){
|
||||
|
||||
//if index present
|
||||
if(!empty($this->arrIndex)){
|
||||
if(array_key_exists($name, $this->arrIndex) == false)
|
||||
UniteFunctionsRev::throwError("setting $name not found");
|
||||
$index = $this->arrIndex[$name];
|
||||
$setting = $this->arrSettings[$index];
|
||||
return($setting);
|
||||
}
|
||||
|
||||
//if no index
|
||||
foreach($this->arrSettings as $setting){
|
||||
$settingName = UniteFunctionsRev::getVal($setting, "name");
|
||||
if($settingName == $name)
|
||||
return($setting);
|
||||
}
|
||||
|
||||
UniteFunctionsRev::throwError("Setting with name: $name don't exists");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get value of some setting
|
||||
* @param $name
|
||||
*/
|
||||
public function getSettingValue($name,$default=""){
|
||||
$setting = $this->getSettingByName($name);
|
||||
$value = UniteFunctionsRev::getVal($setting, "value",$default);
|
||||
|
||||
return($value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* update setting array by name
|
||||
*/
|
||||
public function updateArrSettingByName($name,$setting){
|
||||
|
||||
foreach($this->arrSettings as $key => $settingExisting){
|
||||
$settingName = UniteFunctionsRev::getVal($settingExisting,"name");
|
||||
if($settingName == $name){
|
||||
$this->arrSettings[$key] = $setting;
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
|
||||
UniteFunctionsRev::throwError("Setting with name: $name don't exists");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* update default value in the setting
|
||||
*/
|
||||
public function updateSettingValue($name,$value){
|
||||
$setting = $this->getSettingByName($name);
|
||||
$setting["value"] = $value;
|
||||
|
||||
$this->updateArrSettingByName($name, $setting);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* set values from array of stored settings elsewhere.
|
||||
*/
|
||||
public function setStoredValues($arrValues){
|
||||
|
||||
foreach($this->arrSettings as $key=>$setting){
|
||||
$name = UniteFunctionsRev::getVal($setting, "name");
|
||||
|
||||
//type consolidation
|
||||
$type = UniteFunctionsRev::getVal($setting, "type");
|
||||
|
||||
$customType = UniteFunctionsRev::getVal($setting, "custom_type");
|
||||
if(!empty($customType))
|
||||
$type .= ".".$customType;
|
||||
|
||||
switch($type){
|
||||
case "custom.kenburns_position":
|
||||
$name = $setting["name"];
|
||||
if(array_key_exists($name."_hor", $arrValues)){
|
||||
$value_vert = UniteFunctionsRev::getVal($arrValues, $name."_vert","random");
|
||||
$value_hor = UniteFunctionsRev::getVal($arrValues, $name."_hor","random");
|
||||
$this->arrSettings[$key]["value"] = "$value_vert,$value_hor";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if(array_key_exists($name, $arrValues)){
|
||||
$this->arrSettings[$key]["value"] = $arrValues[$name];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* get setting values. replace from stored ones if given
|
||||
*/
|
||||
public function getArrValues(){
|
||||
|
||||
$arrSettingsOutput = array();
|
||||
|
||||
//modify settings by type
|
||||
foreach($this->arrSettings as $setting){
|
||||
if($setting["type"] == self::TYPE_HR
|
||||
||$setting["type"] == self::TYPE_STATIC_TEXT)
|
||||
continue;
|
||||
|
||||
$value = $setting["value"];
|
||||
|
||||
//modify value by type
|
||||
switch($setting["type"]){
|
||||
case self::TYPE_COLOR:
|
||||
$value = strtolower($value);
|
||||
//set color output type
|
||||
if($this->colorOutputType == self::COLOR_OUTPUT_FLASH)
|
||||
$value = str_replace("#","0x",$value);
|
||||
break;
|
||||
case self::TYPE_CHECKBOX:
|
||||
if($value == true) $value = "true";
|
||||
else $value = "false";
|
||||
break;
|
||||
}
|
||||
|
||||
//remove lf
|
||||
if(isset($setting["remove_lf"])){
|
||||
$value = str_replace("\n","",$value);
|
||||
$value = str_replace("\r\n","",$value);
|
||||
}
|
||||
|
||||
$arrSettingsOutput[$setting["name"]] = $value;
|
||||
}
|
||||
|
||||
return($arrSettingsOutput);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
// advanced settings class. adds some advanced features
|
||||
class UniteSettingsAdvancedRev extends UniteSettingsRev{
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//add boolean true/false select with custom names
|
||||
public function addSelect_boolean($name,$text,$bValue=true,$firstItem="Enable",$secondItem="Disable",$arrParams=array()){
|
||||
$arrItems = array("true"=>$firstItem,"false"=>$secondItem);
|
||||
$defaultText = "true";
|
||||
if($bValue == false) $defaultText = "false";
|
||||
$this->addSelect($name,$arrItems,$text,$defaultText,$arrParams);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//add float select
|
||||
public function addSelect_float($name,$defaultValue,$text,$arrParams=array()){
|
||||
$this->addSelect($name,array("left"=>"Left","right"=>"Right"),$text,$defaultValue,$arrParams);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//add align select
|
||||
public function addSelect_alignX($name,$defaultValue,$text,$arrParams=array()){
|
||||
$this->addSelect($name,array("left"=>"Left","center"=>"Center","right"=>"Right"),$text,$defaultValue,$arrParams);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//add align select
|
||||
public function addSelect_alignY($name,$defaultValue,$text,$arrParams=array()){
|
||||
$this->addSelect($name,array("top"=>"Top","middle"=>"Middle","bottom"=>"Bottom"),$text,$defaultValue,$arrParams);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//add transitions select
|
||||
public function addSelect_border($name,$defaultValue,$text,$arrParams=array()){
|
||||
$arrItems = array();
|
||||
$arrItems["solid"] = "Solid";
|
||||
$arrItems["dashed"] = "Dashed";
|
||||
$arrItems["dotted"] = "Dotted";
|
||||
$arrItems["double"] = "Double";
|
||||
$arrItems["groove"] = "Groove";
|
||||
$arrItems["ridge"] = "Ridge";
|
||||
$arrItems["inset"] = "Inset";
|
||||
$arrItems["outset"] = "Outset";
|
||||
$this->addSelect($name,$arrItems,$text,$defaultValue,$arrParams);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//add transitions select
|
||||
public function addSelect_textDecoration($name,$defaultValue,$text,$arrParams=array()){
|
||||
$arrItems = array();
|
||||
$arrItems["none"] = "None";
|
||||
$arrItems["underline"] = "Underline";
|
||||
$arrItems["overline"] = "Overline";
|
||||
$arrItems["line-through"] = "Line-through";
|
||||
$this->addSelect($name,$arrItems,$text,$defaultValue,$arrParams);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//add transitions select - arrExtensions may be string, and lower case
|
||||
public function addSelect_filescan($name,$path,$arrExtensions,$defaultValue,$text,$arrParams=array()){
|
||||
|
||||
if(getType($arrExtensions) == "string")
|
||||
$arrExtensions = array($arrExtensions);
|
||||
elseif(getType($arrExtensions) != "array")
|
||||
$this->throwError("The extensions array is not array and not string in setting: $name, please check.");
|
||||
|
||||
//make items array
|
||||
if(!is_dir($path))
|
||||
$this->throwError("path: $path not found");
|
||||
|
||||
$arrItems = array();
|
||||
$files = scandir($path);
|
||||
foreach($files as $file){
|
||||
//general filter
|
||||
if($file == ".." || $file == "." || $file == ".svn")
|
||||
continue;
|
||||
|
||||
$info = pathinfo($file);
|
||||
$ext = UniteFunctionsRev::getVal($info,"extension");
|
||||
$ext = strtolower($ext);
|
||||
|
||||
if(array_search($ext,$arrExtensions) === FALSE)
|
||||
continue;
|
||||
|
||||
$arrItems[$file] = $file;
|
||||
}
|
||||
|
||||
//handle add data array
|
||||
if(isset($arrParams["addData"])){
|
||||
foreach($arrParams["addData"] as $key=>$value)
|
||||
$arrItems[$key] = $value;
|
||||
}
|
||||
|
||||
if(empty($defaultValue) && !empty($arrItems))
|
||||
$defaultValue = current($arrItems);
|
||||
|
||||
$this->addSelect($name,$arrItems,$text,$defaultValue,$arrParams);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//add transitions select
|
||||
public function addSelect_transitions($name,$defaultValue,$text,$arrParams=array()){
|
||||
$arrItems = array();
|
||||
$arrItems["linear"] = "Linear";
|
||||
$arrItems["easeOutQuint"] = "EaseOut";
|
||||
$arrItems["easeInQuint"] = "EaseIn";
|
||||
$arrItems["easeInOutQuad"] = "EaseInOut";
|
||||
|
||||
$arrItems["easeOutElastic"] = "EaseIn - Elastic";
|
||||
$arrItems["easeOutBounce"] = "EaseIn - Bounce";
|
||||
$arrItems["easeOutBack"] = "EaseIn - Back";
|
||||
$arrItems["easeOutQuart"] = "EaseIn - Quart";
|
||||
$arrItems["easeOutExpo"] = "EaseIn - Expo";
|
||||
|
||||
$arrItems["easeInElastic"] = "EaseOut - Elastic";
|
||||
$arrItems["easeInBounce"] = "EaseOut - Bounce";
|
||||
$arrItems["easeInBack"] = "EaseOut - Back";
|
||||
$arrItems["easeInQuart"] = "EaseOut - Quart";
|
||||
$arrItems["easeInExpo"] = "EaseOut - Expo";
|
||||
|
||||
$arrItems["easeInOutElastic"] = "EaseInOut - Elastic";
|
||||
$arrItems["easeInOutBounce"] = "EaseInOut - Bounce";
|
||||
$arrItems["easeInOutBack"] = "EaseInOut - Back";
|
||||
$arrItems["easeInOutQuart"] = "EaseInOut - Quart";
|
||||
$arrItems["easeInOutExpo"] = "EaseInOut - Expo";
|
||||
|
||||
$this->addSelect($name,$arrItems,$text,$defaultValue,$arrParams);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,248 @@
|
||||
<?php
|
||||
|
||||
class UniteSettingsOutputRev{
|
||||
|
||||
protected $arrSettings = array();
|
||||
protected $settings;
|
||||
protected $formID;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* init the output settings
|
||||
*/
|
||||
public function init(UniteSettingsRev $settings){
|
||||
$this->settings = new UniteSettingsRev();
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* draw order box
|
||||
* @param $setting
|
||||
*/
|
||||
protected function drawOrderbox($setting){
|
||||
|
||||
$items = $setting["items"];
|
||||
|
||||
//get arrItems by saved value
|
||||
$arrItems = array();
|
||||
|
||||
if(!empty($setting["value"]) &&
|
||||
getType($setting["value"]) == "array" &&
|
||||
count($setting["value"]) == count($items)){
|
||||
|
||||
$savedItems = $setting["value"];
|
||||
|
||||
foreach($savedItems as $value){
|
||||
$text = $value;
|
||||
if(isset($items[$value]))
|
||||
$text = $items[$value];
|
||||
$arrItems[] = array("value"=>$value,"text"=>$text);
|
||||
}
|
||||
} //get arrItems only from original items
|
||||
else{
|
||||
foreach($items as $value=>$text)
|
||||
$arrItems[] = array("value"=>$value,"text"=>$text);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<ul class="orderbox" id="<?php echo $setting["id"]?>">
|
||||
<?php
|
||||
foreach($arrItems as $item){
|
||||
$itemKey = $item["value"];
|
||||
$itemText = $item["text"];
|
||||
|
||||
$value = (getType($itemKey) == "string")?$itemKey:$itemText;
|
||||
?>
|
||||
<li>
|
||||
<div class="div_value"><?php echo $value?></div>
|
||||
<div class="div_text"><?php echo $itemText?></div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
//draw advanced order box
|
||||
protected function drawOrderbox_advanced($setting){
|
||||
|
||||
$items = $setting["items"];
|
||||
if(!is_array($items))
|
||||
$this->throwError("Orderbox error - the items option must be array (items)");
|
||||
|
||||
//get arrItems modify items by saved value
|
||||
|
||||
if(!empty($setting["value"]) &&
|
||||
getType($setting["value"]) == "array" &&
|
||||
count($setting["value"]) == count($items)):
|
||||
|
||||
$savedItems = $setting["value"];
|
||||
|
||||
//make assoc array by id:
|
||||
$arrAssoc = array();
|
||||
foreach($items as $item)
|
||||
$arrAssoc[$item[0]] = $item[1];
|
||||
|
||||
foreach($savedItems as $item){
|
||||
$value = $item["id"];
|
||||
$text = $value;
|
||||
if(isset($arrAssoc[$value]))
|
||||
$text = $arrAssoc[$value];
|
||||
$arrItems[] = array($value,$text,$item["enabled"]);
|
||||
}
|
||||
else:
|
||||
$arrItems = $items;
|
||||
endif;
|
||||
|
||||
?>
|
||||
<ul class="orderbox_advanced" id="<?php echo $setting["id"]?>">
|
||||
<?php
|
||||
foreach($arrItems as $arrItem){
|
||||
switch(getType($arrItem)){
|
||||
case "string":
|
||||
$value = $arrItem;
|
||||
$text = $arrItem;
|
||||
$enabled = true;
|
||||
break;
|
||||
case "array":
|
||||
$value = $arrItem[0];
|
||||
$text = (count($arrItem)>1)?$arrItem[1]:$arrItem[0];
|
||||
$enabled = (count($arrItem)>2)?$arrItem[2]:true;
|
||||
break;
|
||||
default:
|
||||
$this->throwError("Error in setting:".$setting.". unknown item type.");
|
||||
break;
|
||||
}
|
||||
|
||||
$checkboxClass = $enabled ? "div_checkbox_on" : "div_checkbox_off";
|
||||
|
||||
?>
|
||||
<li>
|
||||
<div class="div_value"><?php echo $value?></div>
|
||||
<div class="div_checkbox <?php echo $checkboxClass?>"></div>
|
||||
<div class="div_text"><?php echo $text?></div>
|
||||
<div class="div_handle"></div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* draw includes of the settings.
|
||||
*/
|
||||
public function drawHeaderIncludes(){
|
||||
|
||||
$arrSections = $this->settings->getArrSections();
|
||||
$arrControls = $this->settings->getArrControls();
|
||||
|
||||
$formID = $this->formID;
|
||||
|
||||
$arrOnReady = array();
|
||||
$arrJs = array();
|
||||
|
||||
//put json string types
|
||||
$jsonString = $this->settings->getJsonClientString();
|
||||
|
||||
//$arrJs[] = "obj.jsonSettingTypes = '$jsonString'";
|
||||
//$arrJs[] = "obj.objSettingTypes = JSON.parse(obj.jsonSettingTypes);";
|
||||
|
||||
//put sections vars
|
||||
/*
|
||||
if(!empty($arrSections)){
|
||||
$arrJs[] = "obj.sectionsEnabled = true;";
|
||||
$arrJs[] = "obj.numSections = ".count($arrSections).";";
|
||||
}
|
||||
else
|
||||
$arrJs[] = "obj.sectionsEnabled = false;";
|
||||
*/
|
||||
|
||||
//put the settings into form id
|
||||
|
||||
$arrJs[] = "g_settingsObj['$formID'] = {}";
|
||||
|
||||
//put controls json object:
|
||||
if(!empty($arrControls)){
|
||||
$strControls = json_encode($arrControls);
|
||||
$arrJs[] = "g_settingsObj['$formID'].jsonControls = '".$strControls."'";
|
||||
$arrJs[] = "g_settingsObj['$formID'].controls = JSON.parse(g_settingsObj['$formID'].jsonControls);";
|
||||
}
|
||||
|
||||
/*
|
||||
//put types onready function
|
||||
$arrTypes = $this->getArrTypes();
|
||||
//put script includes:
|
||||
foreach($arrTypes as $type){
|
||||
switch($type){
|
||||
case UniteSettingsRev::TYPE_ORDERBOX:
|
||||
$arrOnReady[] = "$(function() { $( '.orderbox' ).sortable();}); ";
|
||||
break;
|
||||
case UniteSettingsRev::TYPE_ORDERBOX_ADVANCED:
|
||||
$arrOnReady[] = "init_advanced_orderbox();";
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
//put js vars and onready func.
|
||||
|
||||
echo "<script type='text/javascript'>\n";
|
||||
|
||||
//put js
|
||||
foreach($arrJs as $line){
|
||||
echo $line."\n";
|
||||
}
|
||||
|
||||
if(!empty($arrOnReady)):
|
||||
//put onready
|
||||
echo "$(document).ready(function(){\n";
|
||||
foreach($arrOnReady as $line){
|
||||
echo $line."\n";
|
||||
}
|
||||
echo "});";
|
||||
endif;
|
||||
echo "\n</script>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// draw after body additional settings accesories
|
||||
public function drawAfterBody(){
|
||||
$arrTypes = $this->settings->getArrTypes();
|
||||
foreach($arrTypes as $type){
|
||||
switch($type){
|
||||
case self::TYPE_COLOR:
|
||||
?>
|
||||
<div id='divPickerWrapper' style='position:absolute;display:none;'><div id='divColorPicker'></div></div>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* do some operation before drawing the settings.
|
||||
*/
|
||||
protected function prepareToDraw(){
|
||||
|
||||
$this->settings->setSettingsStateByControls();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|