diff options
author | zotlabs <mike@macgirvin.com> | 2018-05-01 19:38:32 -0700 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-05-02 09:30:45 +0200 |
commit | a9b71f5b4a6ed0f40b42c828a27fce472988fc30 (patch) | |
tree | 9fd2ae54fa7a988b6520eac71660844218e4bcd2 | |
parent | c99fb4b7f1f551926e87d093f1931556e14ff053 (diff) | |
download | volse-hubzilla-a9b71f5b4a6ed0f40b42c828a27fce472988fc30.tar.gz volse-hubzilla-a9b71f5b4a6ed0f40b42c828a27fce472988fc30.tar.bz2 volse-hubzilla-a9b71f5b4a6ed0f40b42c828a27fce472988fc30.zip |
The channel import page seems to have missed the big theme cleanup of the last couple of years.
-rw-r--r-- | Zotlabs/Module/Import.php | 19 | ||||
-rwxr-xr-x | include/dba/dba_driver.php | 25 | ||||
-rw-r--r-- | view/css/mod_import.css | 37 | ||||
-rwxr-xr-x | view/tpl/channel_import.tpl | 60 |
4 files changed, 62 insertions, 79 deletions
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index 58f0c60d5..c36e4723a 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -532,16 +532,19 @@ class Import extends \Zotlabs\Web\Controller { '$desc' => t('Use this form to import an existing channel from a different server/hub. You may retrieve the channel identity from the old server/hub via the network or provide an export file.'), '$label_filename' => t('File to Upload'), '$choice' => t('Or provide the old server/hub details'), - '$label_old_address' => t('Your old identity address (xyz@example.com)'), - '$label_old_email' => t('Your old login email address'), - '$label_old_pass' => t('Your old login password'), + + '$old_address' => [ 'old_address', t('Your old identity address (xyz@example.com)'), '', ''], + '$email' => [ 'email', t('Your old login email address'), '', '' ], + '$password' => [ 'password', t('Your old login password'), '', '' ], + '$import_posts' => [ 'import_posts', t('Import a few months of posts if possible (limited by available memory'), false, '', [ t('No'), t('Yes') ]], + '$common' => t('For either option, please choose whether to make this hub your new primary address, or whether your old location should continue this role. You will be able to post from either location, but only one can be marked as the primary location for files, photos, and media.'), - '$label_import_primary' => t('Make this hub my primary location'), - '$label_import_moving' => t('Move this channel (disable all previous locations)'), - '$label_import_posts' => t('Import a few months of posts if possible (limited by available memory'), + + '$make_primary' => [ 'make_primary', t('Make this hub my primary location'), false, '', [ t('No'), t('Yes') ] ], + '$moving' => [ 'moving', t('Move this channel (disable all previous locations)'), false, '', [ t('No'), t('Yes') ] ], + '$pleasewait' => t('This process may take several minutes to complete. Please submit the form only once and leave this page open until finished.'), - '$email' => '', - '$pass' => '', + '$form_security_token' => get_form_security_token('channel_import'), '$submit' => t('Submit') )); diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index b3298b673..9e9f24bb3 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -460,3 +460,28 @@ function db_logger($s,$level = LOGGER_NORMAL,$syslog = LOG_INFO) { \DBA::$logging = false; \DBA::$dba->debug = $saved; } + + +function db_columns($table) { + + if($table) { + if(ACTIVE_DBTYPE === DBTYPE_POSTGRES) { + $r = q("SELECT column_name as field FROM information_schema.columns WHERE table_schema = 'public' AND table_name = '%s'", + dbesc($table) + ); + if($r) { + return ids_to_array($r,'field'); + } + } + else { + $r = q("show columns in %s", + dbesc($table) + ); + if($r) { + return ids_to_array($r,'Field'); + } + } + } + + return []; +}
\ No newline at end of file diff --git a/view/css/mod_import.css b/view/css/mod_import.css deleted file mode 100644 index 8b988b324..000000000 --- a/view/css/mod_import.css +++ /dev/null @@ -1,37 +0,0 @@ -h2 { - margin-left: 15%; - margin-top: 8%; -} - -#import-channel-form { - font-size: 1.4em; - margin-left: 15%; - margin-top: 5%; - width: 50%; -} - - - -#import-channel-form .descriptive-paragraph { - color: #888; - margin-left: 20px; - margin-bottom: 25px; -} - -.import-label { - float: left; - width: 275px; -} - -.import-input { - float: left; - width: 275px; - padding: 5px; -} - - -.import-field-end { - clear: both; - margin-bottom: 20px; -} - diff --git a/view/tpl/channel_import.tpl b/view/tpl/channel_import.tpl index baffe9b06..d702a2437 100755 --- a/view/tpl/channel_import.tpl +++ b/view/tpl/channel_import.tpl @@ -1,43 +1,35 @@ -<h2>{{$title}}</h2> +<div class="generic-content-wrapper"> + <div class="section-title-wrapper"> + <h2>{{$title}}</h2> + <div class="clear"></div> + </div> + <div class="section-content-wrapper"> -<form action="import" method="post" enctype="multipart/form-data" id="import-channel-form"> - <input type="hidden" name="form_security_token" value="{{$form_security_token}}"> - <div id="import-desc" class="descriptive-paragraph">{{$desc}}</div> + <form action="import" method="post" enctype="multipart/form-data" id="import-channel-form"> + <input type="hidden" name="form_security_token" value="{{$form_security_token}}"> + <div id="import-desc" class="section-content-info-wrapper">{{$desc}}</div> - <label for="import-filename" id="label-import-filename" class="import-label" >{{$label_filename}}</label> - <input type="file" name="filename" id="import-filename" class="import-input" value="" /> - <div id="import-filename-end" class="import-field-end"></div> + <label for="import-filename" id="label-import-filename" class="import-label" >{{$label_filename}}</label> + <input type="file" name="filename" id="import-filename" class="import-input" value="" /> + <div id="import-filename-end" class="import-field-end"></div> - <div id="import-choice" class="descriptive-paragraph">{{$choice}}</div> + <div id="import-choice" class="section-content-info-wrapper">{{$choice}}</div> - <label for="import-old-address" id="label-import-old-address" class="import-label" >{{$label_old_address}}</label> - <input type="text" name="old_address" id="import-old-address" class="import-input" value="" /> - <div id="import-old-address-end" class="import-field-end"></div> + {{include file="field_input.tpl" field=$old_address}} + {{include file="field_input.tpl" field=$email}} + {{include file="field_password.tpl" field=$password}} + {{include file="field_checkbox.tpl" field=$import_posts}} - <label for="import-old-email" id="label-import-old-email" class="import-label" >{{$label_old_email}}</label> - <input type="text" name="email" id="import-old-email" class="import-input" value="{{$email}}" /> - <div id="import-old-email-end" class="import-field-end"></div> + <div id="import-common-desc" class="section-content-info-wrapper">{{$common}}</div> - <label for="import-old-pass" id="label-import-old-pass" class="import-label" >{{$label_old_pass}}</label> - <input type="password" name="password" id="import-old-pass" class="import-input" value="{{$pass}}" /> - <div id="import-old-pass-end" class="import-field-end"></div> + {{include file="field_checkbox.tpl" field=$make_primary}} + {{include file="field_checkbox.tpl" field=$moving}} - <input type="checkbox" name="import_posts" id="import-posts" value="1" /> - <label for="import-posts" id="label-import-posts">{{$label_import_posts}}</label> - <div id="import-posts-end" class="import-field-end"></div> + <div id="import-common-desc" class="section-content-info-wrapper">{{$pleasewait}}</div> - <div id="import-common-desc" class="descriptive-paragraph">{{$common}}</div> + <input type="submit" class="btn btn-primary" name="submit" id="import-submit-button" value="{{$submit}}" /> + <div id="import-submit-end" class="import-field-end"></div> - <input type="checkbox" name="make_primary" id="import-make-primary" value="1" /> - <label for="import-make-primary" id="label-import-make-primary">{{$label_import_primary}}</label> - <div id="import-make-primary-end" class="import-field-end"></div> - - <input type="checkbox" name="moving" id="import-moving" value="1" /> - <label for="import-moving" id="label-import-moving">{{$label_import_moving}}</label> - <div id="import-moving-end" class="import-field-end"></div> - - <input type="submit" name="submit" id="import-submit-button" value="{{$submit}}" /> - <div id="import-submit-end" class="import-field-end"></div> - - <div id="import-common-desc" class="descriptive-paragraph">{{$pleasewait}}</div> -</form> + </form> + </div> +</div> |