| 1 |
<?php |
| 2 |
function avcp_valid_check() { |
| 3 |
// Enable user error handling |
| 4 |
libxml_use_internal_errors(true); |
| 5 |
|
| 6 |
$terms = get_terms( 'annirif', array('hide_empty' => 0) ); |
| 7 |
foreach ( $terms as $term ) { |
| 8 |
$xml = new DOMDocument(); |
| 9 |
$xml->load(get_site_url() . '/avcp/' . $term->name. '.xml'); |
| 10 |
if (!$xml->schemaValidate(get_site_url() . '/wp-content/plugins/avcp/includes/datasetAppaltiL190.xsd')) { |
| 11 |
$errori .= $term->name . ' '; |
| 12 |
} |
| 13 |
} |
| 14 |
if ($errori) { |
| 15 |
update_option('avcp_invalid', '1'); |
| 16 |
echo '<div class="error"><p>AVCP | I seguenti file .xml presentano errori: ' . $errori . '</p><p><a href="' . admin_url() . 'edit.php?post_type=avcp&page=avcp_v_dataset">Clicca qui vedere i dettagli degli errori</a></div>'; |
| 17 |
} else { |
| 18 |
update_option('avcp_invalid', '0'); |
| 19 |
} |
| 20 |
} |
| 21 |
?> |