dcex.php 773 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * Test file for metadata
  4. * @package chamilo.metadata
  5. */
  6. /**
  7. * Init
  8. */
  9. require_once api_get_path(SYS_CODE_PATH).'metadata/md_funcs.php'; $mdStore = new mdstore(TRUE);
  10. require_once api_get_path(LIBRARY_PATH) . 'xmd.lib.php';
  11. require_once api_get_path(LIBRARY_PATH) . 'xht.lib.php';
  12. require_once api_get_path(SYS_CODE_PATH).'metadata/md_document.php';
  13. $mdObj = new mdobject($_course, $docId); // e.g. '12'
  14. // Fetch example:
  15. if (is_array($dcelems = $mdStore->mds_get_dc_elements($mdObj))) {
  16. echo '<div>', htmlspecialchars($dcelems['Identifier']), ': ',
  17. htmlspecialchars($dcelems['Description']), '</div>';
  18. }
  19. // Store example:
  20. $langMdCopyright = 'Provided the source is acknowledged';
  21. $mdStore->mds_put_dc_elements($mdObj, array('Description'=>time()));