| @@ -1127,16 +1127,9 @@ | ||
| 1127 | 1127 | </span> |
| 1128 | 1128 | </div> |
| 1129 | 1129 | </td> |
| 1130 | 1130 | <td class="mxchat-url-cell" style="padding: 12px 16px; font-size: 13px;"> |
| 1131 | - <?php if (!empty($source_url) && strpos($source_url, 'mxchat://') !== 0 && strpos($source_url, '_ungrouped_') !== 0) : ?> | |
| 1132 | - <a href="<?php echo esc_url($source_url); ?>" target="_blank" style="color: var(--mxch-primary); text-decoration: none;"> | |
| 1133 | - <span class="dashicons dashicons-external" style="font-size: 14px;"></span> | |
| 1134 | - <?php esc_html_e('View Source', 'mxchat'); ?> | |
| 1135 | - </a> | |
| 1136 | - <?php else : ?> | |
| 1137 | - <span style="color: var(--mxch-text-muted);"><?php esc_html_e('Manual Content', 'mxchat'); ?></span> | |
| 1138 | - <?php endif; ?> | |
| 1131 | + <?php echo MxChat_Knowledge_Manager::mxchat_source_cell_html($source_url, $current_bot_id, true); ?> | |
| 1139 | 1132 | </td> |
| 1140 | 1133 | <td class="mxchat-actions-cell" style="padding: 12px 16px; white-space: nowrap;"> |
| 1141 | 1134 | <button type="button" |
| 1142 | 1135 | class="mxch-btn mxch-btn-ghost mxch-btn-sm mxchat-inspect-entry-btn" |
| @@ -1285,16 +1278,10 @@ | ||
| 1285 | 1278 | $actual_source = $source_url; |
| 1286 | 1279 | if (strpos($source_url, '_ungrouped_') === 0) { |
| 1287 | 1280 | $actual_source = $prompt->source_url ?? ''; |
| 1288 | 1281 | } |
| 1289 | - if (!empty($actual_source) && strpos($actual_source, 'mxchat://') !== 0) : ?> | |
| 1290 | - <a href="<?php echo esc_url($actual_source); ?>" target="_blank" style="color: var(--mxch-primary); text-decoration: none;"> | |
| 1291 | - <span class="dashicons dashicons-external" style="font-size: 14px;"></span> | |
| 1292 | - <?php esc_html_e('View', 'mxchat'); ?> | |
| 1293 | - </a> | |
| 1294 | - <?php else : ?> | |
| 1295 | - <span style="color: var(--mxch-text-muted);"><?php esc_html_e('Manual', 'mxchat'); ?></span> | |
| 1296 | - <?php endif; ?> | |
| 1282 | + echo MxChat_Knowledge_Manager::mxchat_source_cell_html($actual_source, $current_bot_id, false); | |
| 1283 | + ?> | |
| 1297 | 1284 | </td> |
| 1298 | 1285 | <td style="padding: 12px 16px; white-space: nowrap;"> |
| 1299 | 1286 | <button type="button" |
| 1300 | 1287 | class="mxch-btn mxch-btn-ghost mxch-btn-sm mxchat-inspect-entry-btn" |
| @@ -1427,8 +1414,20 @@ | ||
| 1427 | 1414 | </div> |
| 1428 | 1415 | <button type="button" class="mxch-btn mxch-btn-secondary" id="mxchat-kb-reimport-check"><?php esc_html_e('Check knowledge base', 'mxchat'); ?></button> |
| 1429 | 1416 | </div> |
| 1430 | 1417 | <p class="mxch-field-hint"><?php esc_html_e('The date is the release that carried the last of these fixes. Choose a later one if this site was updated after that.', 'mxchat'); ?></p> |
| 1418 | + | |
| 1419 | + <!-- Also offer entries whose page was edited after they were imported (plan a00ef8); off by default --> | |
| 1420 | + <div class="mxch-field mxch-kb-reimport-edited"> | |
| 1421 | + <label class="toggle-switch"> | |
| 1422 | + <input type="checkbox" id="mxchat-kb-reimport-edited" name="mxchat_kb_reimport_edited" value="1" /> | |
| 1423 | + <span class="slider"></span> | |
| 1424 | + </label> | |
| 1425 | + <div class="mxch-kb-reimport-edited-text"> | |
| 1426 | + <label class="mxch-field-label" for="mxchat-kb-reimport-edited"><?php esc_html_e('Also rewrite entries whose page was edited after they were imported', 'mxchat'); ?></label> | |
| 1427 | + <p class="mxch-field-description"><?php esc_html_e('An entry older than its post, page, product or media file is rebuilt from it as it reads today. A site with auto-sync on does not need this.', 'mxchat'); ?></p> | |
| 1428 | + </div> | |
| 1429 | + </div> | |
| 1431 | 1430 | |
| 1432 | 1431 | <div class="mxch-kb-reimport-progress" hidden> |
| 1433 | 1432 | <div class="mxch-progress-bar" hidden><div class="mxch-progress-bar-fill"></div></div> |
| 1434 | 1433 | <p class="mxch-progress-label" aria-live="polite"></p> |