Source for file md_document.php
Documentation is available at md_document.php
<?php /* <!-- md_document.php for Dokeos metadata/*.php -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
==============================================================================
* Dokeos Metadata: class mdobject for Document-type items
* @package dokeos.metadata
==============================================================================
function mdo_define_htt() { return new xhtdoc(<<<EOD
<!-- {-INDEXABLETEXT-} -->
{-V metadata/lom/general/title/string-} txt-sep
{-R metadata/lom/general/keyword C KWTEXT-} txt-sep
{-V metadata/lom/general/description[1]/string-} txt-end
{-V metadata/lom/lifeCycle/contribute[1]/entity-}
{-V metadata/lom/lifeCycle/contribute[1]/date/dateTime-}
{-V metadata/lom/technical/format-}
function mdo_generate_default_xml_metadata()
global $iso639_2_code, $ieee_xml;
give_up('IEEE XML (metadata/md_funcs): ' . $xhtDoc->htt_error);
$xhtDoc->xht_get_lang = 'get_lang'; $xhtDoc->xht_xmldoc = new xmddoc('');
if ($xhtDoc->xht_xmldoc->error) give_up($xhtDoc->xht_xmldoc->error);
$xhtDoc->xht_param['siteUri'] = make_uri();
$xhtDoc->xht_param['entry'] = $this->mdo_course['sysCode'] .
'.Document.' . $this->mdo_id; // 2005-05-30: path->sysCode
'main/metadata/openobject.php?cidReq=' .
$xhtDoc->xht_param['mdlang'] = strtolower($iso639_2_code);
$xhtDoc->xht_param['lang'] = strtolower($iso639_2_code);
$xhtDoc->xht_param['title'] =
$this->mdo_title ? $this->mdo_title :
$xhtDoc->xht_param['description'] =
$xhtDoc->xht_param['coverage'] = get_lang('MdCoverage');
$xhtDoc->xht_param['author'] = "BEGIN:VCARD\\nFN:" .
$_user['firstName']. " ". $_user['lastName'] .
"\\nEMAIL:". $_user['mail'] . "\\nEND:VCARD\\n";
$xhtDoc->xht_param['dateTime'] = date('Y-m-d');
if ($this->mdo_filetype == 'folder') $format = "inode/directory";
$xhtDoc->xht_param['format'] = $format;
return $xhtDoc->xht_fill_template('XML');
function mdo_add_breadcrump_nav()
global $interbreadcrumb, $langFormats;
$regs = array(); // for use with ereg()
if (ereg('^(.+[^/\.]+)/[^/\.]+/[^/\.]+.[^/\.]+$', $docurl, $regs))
$docurl = $regs[1] . '/document/document.php';
$interbreadcrumb[]= array ('url' => $docurl,
if (strlen($docpath) > 1) $interbreadcrumb[]= array ('url' =>
$docurl . '?curdirpath=' . urlencode($docpath) .
($this->mdo_group ? '&gidReq=' . $this->mdo_group : ''), "name" =>
// Complete assoclist $langFormats from mime types
$sep = $langFormats{0} ? $langFormats{0} : ":";
if (!isset ($arrFormats[$format]))
$langFormats .= ",, " . $format . $sep . $format;
if (!isset ($arrFormats["inode/directory"]))
$langFormats .= ",, inode/directory" . $sep . "inode/directory";
if (substr($langFormats, 0, 3) == ",, ")
$langFormats = $sep . substr($langFormats, 3);
global $ieee_dcmap_e, $ieee_dcmap_v; // md_funcs
$this->mdo_dcmap_e = $ieee_dcmap_e; $this->mdo_dcmap_v = $ieee_dcmap_v;
"SELECT path,title,comment,filetype FROM $document_table WHERE id='" .
$this->mdo_title = $docinfo['title'];
$this->mdo_group = ''; // 2005-05-30: find group_id, if any
"SELECT id,secret_directory FROM $group_info", __FILE__ , __LINE__ )))
if (($secdir = $row['secret_directory'] . '/') ==
$this->mdo_group = $row['id']; break;
// 2005-05-30: use direct URL
($this->mdo_group ? '?gidReq=' . $this->mdo_group : '');
|