are_themes_available() ) { return FALSE; } if ( get_option( 'ai1ec_themes_version', 1 ) >= AI1EC_THEMES_VERSION ) { return FALSE; } return TRUE; } /** * Returns a notice informing admin to update the core theme files if core * theme files are determined to be out of date. Else returns '' (evaluates * to false). If $echo is true, outputs the notice. Else outputs nothing. * * @see Ai1ec_Themes_Controller::are_themes_outdated() * * @param boolean $echo Whether to output the message or just return it. * @return boolean Whether core theme files are out of date. */ public function frontend_outdated_themes_notice( $echo = true ) { $output = ''; if ( $this->are_themes_outdated() ) { $output .= '
'; $output .= __( 'The All-in-One Event Calendar core theme files are out of date and the calendar has been temporarily disabled.', AI1EC_PLUGIN_NAME ); $output .= ' '; if ( current_user_can( 'install_themes' ) ) { $output .= sprintf( __( 'To enable the calendar, please log into the WordPress dashboard and follow the instructions.', AI1EC_PLUGIN_NAME ), esc_attr( admin_url() ) ); } else { $output .= __( 'To enable the calendar, an administrator must log into the WordPress dashboard and follow the instructions.', AI1EC_PLUGIN_NAME ); } $output .= '
'; } if ( $echo ) { echo $output; } return $output; } /** * copy_directory function * * @return void **/ private function copy_directory( $source, $destination ) { if( is_dir( $source ) ) { @mkdir( $destination ); $directory = dir( $source ); while( FALSE !== ( $readdirectory = $directory->read() ) ) { if( $readdirectory == '.' || $readdirectory == '..' ) { continue; } $PathDir = $source . '/' . $readdirectory; if( is_dir( $PathDir ) ) { $this->copy_directory( $PathDir, $destination . '/' . $readdirectory ); continue; } copy( $PathDir, $destination . '/' . $readdirectory ); } $directory->close(); } else { copy( $source, $destination ); } } /** * install_themes function * * @return void **/ function install_themes() { ?>get_error_message() ), AI1EC_PLUGIN_NAME ) ?>
'; $error .= __( 'There was an error while removing outdated core themes from your themes folder.', AI1EC_PLUGIN_NAME ); $error .= ' '; $error .= __( 'Please FTP to your web server and manually delete:', AI1EC_PLUGIN_NAME ); $error .= '
'; $error .= implode( '', $delete_errors ); $error .= '
'; $error .= __( 'There was an error while copying core themes from the plugin into the themes folder.', AI1EC_PLUGIN_NAME ); $error .= ' '; $error .= __( 'Please FTP to your web server and manually copy the folders:', AI1EC_PLUGIN_NAME ); $error .= '
'; $error .= ''; $error .= implode( '', $copy_errors ); $error .= '
' . __( 'to', AI1EC_PLUGIN_NAME ) . ' ' . $dest_dir .
'
Please follow any instructions listed below or your calendar may malfunction:
'; $msg .= __( 'Be sure to reload your browser when viewing your site to make sure the most current scripts are used.', AI1EC_PLUGIN_NAME ); $msg .= '