Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added french translation and '*' for files import. #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
HTML-Import-2
=============

A WordPress plugin to import content from static HTML files.
A WordPress plugin to import content from static HTML files.


= Contribution from rpeyron in this fork =
* Added French translation and translation fixes
* Added '*' for all document types
* Added option to import media files in original folder structure
* Added option to prefix import path
* Added redirects for imported media files
30 changes: 24 additions & 6 deletions html-import-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ function html_import_get_options() {
'remove_srcset' => 0,
'import_documents' => 0,
'document_mimes' => 'rtf,doc,docx,xls,xlsx,csv,ppt,pps,pptx,ppsx,pdf,zip,wmv,avi,flv,mov,mpeg,mp3,m4a,wav',
'document_keep_structure' => 0,
'documents_prefix' == _('imported-pages', 'import-html-pages' ),
'fix_links' => 0,
'import_title' => 0,
'title_region' => '',
Expand Down Expand Up @@ -99,8 +101,8 @@ function html_import_options_page() { ?>
value="<?php echo esc_attr( $options['root_directory'] ); ?>" class="widefloat" />
</label><br />
<span class="description">
<?php _e( 'The absolute path to the files you want to import.', 'html-import-pages' ); ?><br />
<?php printf( __( 'Hint: the absolute path to this WordPress installation is: %s', 'html-import-pages' ), '<kbd>'.rtrim( ABSPATH, '/' ).'</kbd>' ); ?>
<?php _e( 'The absolute path to the files you want to import.', 'import-html-pages' ); ?><br />
<?php printf( __( 'Hint: the absolute path to this WordPress installation is: %s', 'import-html-pages' ), '<kbd>'.rtrim( ABSPATH, '/' ).'</kbd>' ); ?>
</span>
</p></td>
</tr>
Expand All @@ -110,7 +112,7 @@ function html_import_options_page() { ?>
<td><p><label><input type="text" name="html_import[old_url]" id="old_url"
value="<?php echo esc_attr( $options['old_url'] ); ?>" class="widefloat" /> </label><br />
<span class="description">
<?php _e( 'This will be used only to generate accurate <kbd>.htaccess</kbd> redirects. The importer will not search for files here.', 'html-import-pages' ); ?>
<?php _e( 'This will be used only to generate accurate <kbd>.htaccess</kbd> redirects. The importer will not search for files here.', 'import-html-pages' ); ?>
</span>
</p></td>
</tr>
Expand Down Expand Up @@ -250,9 +252,26 @@ function html_import_options_page() { ?>
<td><label>
<input type="text" name="html_import[document_mimes]" id="document_mimes"
value="<?php echo esc_attr( $options['document_mimes'] ); ?>" class="widefloat" /> </label><br />
<span class="description"><?php _e( "Enter file extensions without periods, separated by commas. File types not listed here will not be imported to the media library. <br />
<span class="description"><?php _e( "Enter file extensions without periods, separated by commas. File types not listed here will not be imported to the media library. Use '*' for all file extensions (except those imported).<br />
Suggested: rtf, doc, docx, xls, xlsx, csv, ppt, pps, pptx, ppsx, pdf, zip, wmv, avi, flv, mov, mpeg, mp3, m4a, wav<br />", 'import-html-pages' ); ?></span>
</td>
</tr>
<tr class="import_documents"
<?php if ( isset( $options['import_documents'] ) && !$options['import_documents'] ) echo 'style="display:none;"'; ?>>
<th></th>
<td>
<label><input name="html_import[documents_keep_structure]" id="documents_keep_structure" value="1" type="checkbox" <?php checked( $options['documents_keep_structure'] ); ?> class="toggle" />
<?php _e( "keep structure of imported documents", 'import-html-pages' ); ?></label>
</td>
</tr>
<tr class="import_documents"
<?php if ( isset( $options['import_documents'] ) && !$options['import_documents'] ) echo 'style="display:none;"'; ?>>
<th><?php _e( "Media Folder Prefix", 'import-html-pages' ); ?></th>
<td><label>
<input type="text" name="html_import[documents_prefix]" id="documents_prefix"
value="<?php echo esc_attr( $options['documents_prefix'] ); ?>" class="widefloat" /> </label><br />
<span class="description"><?php _e( "Enter the folder prefix where uploads will be done", 'import-html-pages' ); ?></span>
</td>
</tr>
<tr>
<th></th>
Expand Down Expand Up @@ -566,8 +585,7 @@ function html_import_options_page() { ?>
</td>
<td>

Select field by:<br />
<label>
<label><?php _e( 'Select field by:', 'import-html-pages' ); ?><br />
<input type="radio" name="html_import[import_field][<?php echo $index; ?>]"
value="tag" class="showrow" title="customfield" <?php checked( $options['import_field'][$index], 'tag' ); ?> />
<?php _e( 'HTML tag', 'import-html-pages' ); ?></label>
Expand Down
15 changes: 12 additions & 3 deletions html-import.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@
Version: 2.6
Author: Stephanie Leary
Author URI: http://sillybean.net/
Text Domain: import-html-pages
Domain Path: /languages/
License: GPL 2
*/

// Make sure translations are loaded before plugin registration
load_plugin_textdomain( 'import-html-pages', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

// Force description translation string (KEEP THIS IN SYNC with description field above !)
if (0) $html_import_description = __('Imports well-formed static HTML files into WordPress posts or pages. Supports Dreamweaver templates and Word HTML cleanup. Visit the settings page to get started. See the <a href="http://sillybean.net/code/wordpress/html-import-2/user-guide/">User Guide</a> for details.');

require_once ( 'html-importer.php' );
require_once ( 'html-import-options.php' );

Expand Down Expand Up @@ -72,7 +80,7 @@ function html_import_add_pages() {
$text = '<p>'.sprintf( __( 'This is a complicated importer with lots of options. If you have never used this importer before, you should take a look at the <a href="%s">User Guide</a>.', 'import-html-pages' ), 'http://sillybean.net/downloads/html-import/user-guide.html' ).'</p>';
$text .= '<p>'.__( "You need to look through the first five tabs and save your settings before you run the importer. The sixth ( Tools ) contains links to some tools that are helpful after you've imported.", 'import-html-pages' ).'</p>';

$text .= '<h3>'.__( 'Tips', 'html-import-pages' )."</h3>
$text .= '<h3>'.__( 'Tips', 'import-html-pages' )."</h3>
<ol>
<li>" . __( "If there is already some content in this site, you should back up your database before you import.", 'import-html-pages' )."</li>
<li>" . __( "Before you import, deactivate any crosspost or notification plugins.", 'import-html-pages' )."</li>
Expand All @@ -95,6 +103,7 @@ function html_import_add_pages() {
add_action( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'html_import_plugin_actions' );
function html_import_plugin_actions( $links ) {
$new_links = array();
$new_links[] = sprintf( '<a href="options-general.php?page=html-import.php">%s</a>', __( 'Settings', 'html-import' ) );
$new_links[] = sprintf( '<a href="options-general.php?page=html-import.php">%s</a>', __( 'Settings', 'import-html-pages' ) );
return array_merge( $new_links, $links );
}
}

Loading