[svn r10664] Importing metadata fixes from rhaentjens

skala
Bart Mollet 18 years ago
parent dd9512e970
commit de8684d4ff
  1. 8
      main/inc/lib/xht.lib.php
  2. 6
      main/inc/lib/xmd.lib.php
  3. 23
      main/metadata/importlinks.php
  4. 156
      main/metadata/importmanifest.php
  5. 8
      main/metadata/md_document.htt
  6. 112
      main/metadata/md_funcs.php
  7. 16
      main/metadata/md_link.htt
  8. 17
      main/metadata/md_link.php
  9. 6
      main/metadata/md_scorm.php
  10. 227
      main/metadata/md_script.js
  11. 79
      main/metadata/phpdig/CourseKwds_example.js
  12. 11
      main/metadata/phpdig/CourseKwds_example.jsc
  13. 195
      main/metadata/phpdig/en-language.php
  14. 124
      main/metadata/phpdig/search.php
  15. 4
      main/metadata/phpdig/search_function.php

@ -1,7 +1,7 @@
<?php /* <!-- xht.lib.php -->
<!-- XML HTML Templates, 2005/03/16 -->
<!-- XML HTML Templates, 2006/12/14 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see note at end of text -->
<!-- Copyright (C) 2006 rene.haentjens@UGent.be - see note at end of text -->
<!-- Released under the GNU GPL V2, see http://www.gnu.org/licenses/gpl.html -->
*/
@ -29,8 +29,8 @@
function xht_htmlwchars($s) // use only where ISO-8859-1 is not required!
{
return ereg_replace('\[((/?(b|big|i|small|sub|sup|u))|br/)\]', '<\\1>',
str_replace('@@', '&',
htmlspecialchars(ereg_replace('&#([0-9]+);', '@@#\\1;', $s))));
str_replace('@§@', '&',
htmlspecialchars(ereg_replace('&#([0-9]+);', '@§@#\\1;', $s))));
// replaces htmlspecialchars for double-escaped xml chars like '&amp;#nnn;'
// and when html tags <...> are represented as [...]
}

@ -1,5 +1,5 @@
<?php /* <!-- xmd.lib.php -->
<!-- XML MiniDom, 2005/07/28 -->
<!-- XML MiniDom, 2006/12/13 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see note at end of text -->
<!-- Released under the GNU GPL V2, see http://www.gnu.org/licenses/gpl.html -->
@ -799,8 +799,8 @@ class xmddoc
if ($pcs && strlen($data) == 1) $this->_concat = TRUE;
// expat parser puts &xx; in a separate cData, try to re-assemble
if ($pcs && $data{0} == 'é') $this->_concat = TRUE;
// PHP5 expat breaks before é (but not before èêëÉáóíú...)
if ($pcs && $data{0} > '~') $this->_concat = TRUE;
// PHP5 expat breaks before 8-bit characters
if ($this->_concat)
{

@ -1,7 +1,7 @@
<?php /* <!-- Dokeos metadata/importlinks.php -->
<!-- 2005/09/20 -->
<!-- 2006/12/15 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
<!-- Copyright (C) 2006 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
*/
@ -240,6 +240,25 @@ elseif ($slo == get_lang('Index') && file_exists($phpDigIncCn) && count($mceids)
echo '</table>', "\n";
}
}
elseif (isset($pu['scheme']) && $pu['scheme'] == 'mailto' && isset($pu['path']))
{
if ($site_id = remove_engine_entries($url = 'mailto:' . $pu['path'], ''))
{
echo '<table>', "\n";
index_words($site_id, '', '',
get_first_words($text, $url, ''),
get_keywords($text));
echo '</table>', "\n";
}
else
{
echo '<table>', "\n";
echo '<tr><td>', htmlspecialchars($url),
'</td><td>', htmlspecialchars($path),
'</td><td>', htmlspecialchars($file), '</td></tr>';
echo '</table>', "\n";
}
}
}
if(isset($db))

@ -1,7 +1,7 @@
<?php /* <!-- Dokeos metadata/importmanifest.php -->
<!-- 2005/09/20 -->
<!-- 2006/12/15 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
<!-- Copyright (C) 2006 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
*/
@ -12,9 +12,7 @@
* @package dokeos.metadata
==============================================================================
*/
/**
* @todo $rootSys is replaced with $_configuration['root_sys'] except here because I do not understand this code.
*/
// PRELIMS -------------------------------------------------------------------->
@ -31,12 +29,12 @@ $nameTools = get_lang('Tool');
if (!isset($sdisub)) $sdisub = '';
$sdisub = substr(ereg_replace("[^0-9A-Za-z]", "", $sdisub), 0, 4);
// $sdisub is for split manifests - Scorm.NNN.$sdisub_xxx e.g. Scorm.3.1979_12
define('MFFNAME', 'imsmanifest'); define('MFFDEXT', '.xml');
define('MFF', MFFNAME . $sdisub . MFFDEXT);
define('HTF', 'mdp_scorm.htt');
// $sdisub is for split manifests - Scorm.NNN.$sdisub_xxx e.g. Scorm.3.1979_12
$regs = array();
($nameTools && get_lang('Sorry')) or give_up(
'Language file ' . $language_file . " doesn't define 'Tool' and 'Sorry'");
@ -46,14 +44,14 @@ $_course = api_get_course_info(); isset($_course) or give_up(get_lang('Sorry'));
$is_allowed_to_edit = isset($_user['user_id']) && $is_courseMember && is_allowed_to_edit();
if (!$is_allowed_to_edit) give_up(get_lang('Denied'));
$baseWorkDir = get_course_path() . ($courseDir = $_course['path'] . '/scorm');
$mdStore = new mdstore($is_allowed_to_edit); // create table if needed
require(api_get_path(LIBRARY_PATH) . 'xmd.lib.php');
require(api_get_path(LIBRARY_PATH) . 'xht.lib.php');
require(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
$baseWorkDir = get_course_path() . ($courseDir = $_course['path'] . '/scorm');
require('md_phpdig.php');
@ -84,34 +82,49 @@ else
': ' . get_lang('NotInDB') . ')'; unset($workWith);
}
define('UZYX', 'UZYX'); // magic word to repeat for all $sdisub
if (($sdiall = ($sdisub == UZYX)))
{
$sdisub = ''; $sdiall = array();
if (($dh = opendir($baseWorkDir . $workWith)))
{
while (FALSE !== ($file = readdir($dh)))
if (ereg('^'.MFFNAME.'(.+)\\'.MFFDEXT .'$', $file, $regs))
$sdiall[] = $regs[1];
closedir($dh);
}
sort($sdiall);
}
$originalHdrInfo = $hdrInfo;
if (isset($workWith)) // now checked to be a valid path in scormdocument
function slurpmanifest()
{
if ($mdObj->mdo_filetype == 'folder') // a folder with a manifest?
global $baseWorkDir, $workWith, $sdisub, $mfContents, $xht_doc;
if (file_exists($fmff = $baseWorkDir . $workWith . '/' . MFFNAME . $sdisub . MFFDEXT))
{
if (file_exists($fmff = $baseWorkDir . $workWith . '/' . MFF))
if (($mfContents = @fgc($fmff)))
{
if (($mfContents = @fgc($fmff)))
{
set_time_limit(120); // for analyzing the manifest file
$xht_doc = new xmddoc(explode("\n", $mfContents));
if ($xht_doc->error)
{
$hdrInfo .= ' ' . get_lang('ManifestSyntax') . ' ' .
htmlspecialchars($xht_doc->error);
unset($mfContents);
} // else keep $mfContents, meaning manifest file is OK
}
else
{
$hdrInfo .= ' ' . get_lang('EmptyManifest');
}
}
else
{
$hdrInfo .= ' ' . get_lang('NoManifest');
set_time_limit(120); // for analyzing the manifest file
$xht_doc = new xmddoc(explode("\n", $mfContents));
if (!$xht_doc->error) return ''; // keeping $mfContents and $xht_doc
unset($mfContents);
return get_lang('ManifestSyntax') . ' ' . htmlspecialchars($xht_doc->error);
}
else return get_lang('EmptyManifest');
}
else return get_lang('NoManifest');
}
if (isset($workWith)) // now checked to be a valid path in scormdocument
{
if ($mdObj->mdo_filetype == 'folder') // a folder with a manifest?
{
if (($errmsg = slurpmanifest())) $hdrInfo .= ' ' . $errmsg;
}
else
{
@ -122,9 +135,10 @@ if (isset($workWith)) // now checked to be a valid path in scormdocument
$mdObj->mdo_add_breadcrump_nav(); // see 'md_' . EID_TYPE . '.php'
if (isset($sdi)) $interbreadcrumb[]= array(
'url' => $_SERVER['PHP_SELF'] . '?sdi=' . urlencode($sdi) .
($sdisub ? '&sdisub=' . urlencode($sdisub) : ''),
($sdisub ? '&sdisub=' . urlencode($sdisub) :
($sdiall ? '&sdisub='.UZYX : '')),
'name'=> get_lang('Continue') . ' ' . $sdi .
($sdisub ? ' (' . $sdisub . ')' : ''));
($sdisub ? ' (' . $sdisub . ')' : ($sdiall ? ' ('.UZYX.')' : '')));
$htmlHeadXtra[] = '
<link rel="stylesheet" type="text/css" href="md_styles.css">
@ -145,34 +159,11 @@ if ($smo == get_lang('UploadMff'))
fclose($myFile);
if (move_uploaded_file($filespec,
$baseWorkDir . $workWith . '/' . MFF))
$baseWorkDir . $workWith . '/' . MFFNAME . $sdisub . MFFDEXT))
{
echo get_lang('MffOk'); $hdrInfo = $originalHdrInfo;
// note: duplicate code below: remove or put in function?
if (file_exists($fmff = $baseWorkDir . $workWith . '/' . MFF))
{
if (($mfContents = @fgc($fmff)))
{
set_time_limit(120); // for analyzing the manifest file
$xht_doc = new xmddoc(explode("\n", $mfContents));
if ($xht_doc->error)
{
$hdrInfo .= ' ' . get_lang('ManifestSyntax') . ' ' .
htmlspecialchars($xht_doc->error);
unset($mfContents);
} // else keep $mfContents, meaning manifest file is OK
}
else
{
$hdrInfo .= ' ' . get_lang('EmptyManifest');
}
}
else
{
$hdrInfo .= ' ' . get_lang('NoManifest');
}
if (($errmsg = slurpmanifest())) $hdrInfo .= ' ' . $errmsg;
}
else echo get_lang('MffNotOk');
}
@ -301,7 +292,7 @@ elseif ($smo == get_lang('Import'))
$mdStore->mds_put(EID_TYPE . '.' . $mfdocId, $ixt, 'indexabletext');
}
echo htmlspecialchars($level.'/ '.$itemId), '<br>';
echo $level <= 1 ? '<br>'.$level.'/ ' : ' ', htmlspecialchars($itemId);
flush(); $loopctr = 0;
foreach ($xht_doc->xmd_select_elements(SUBITEM, $treeElem) as $subElem)
@ -337,29 +328,41 @@ elseif ($smo == get_lang('Import'))
$fp = fopen($thf, "rb"); fpassthru($fp); fclose($fp);
}
'
. str_replace($_configuration['root_sys'], api_get_path(SYS_PATH),
str_replace('$scid', $scid,
. str_replace('<SYS_PATH-placeholder>', api_get_path(SYS_PATH),
str_replace('<scid>', $scid, // 2 * replace in $drs-line below
'
else
{
$drs = "$rootSys";
$scormid = "$scid";
require($drs. "main/metadata/playscormmdset.inc.php");
$drs = "<SYS_PATH-placeholder>"; $scormid = "<scid>";
require($drs. "claroline/metadata/playscormmdset.inc.php");
}
' )) . '?' . '>';
}
if ($mfContents)
{
store_md_and_traverse_subitems($sdi, 0, 1, 0,
$xht_doc->xmd_select_single_element(TREETOP), -1);
if ($sdiall)
{
foreach ($sdiall as $sdisub)
{
if (($errmsg = slurpmanifest()))
echo '? ', $sdisub, ': ', $errmsg, '<br>';
else
store_md_and_traverse_subitems($sdi, 0, 1, 0,
$xht_doc->xmd_select_single_element(TREETOP), -1);
}
$sdisub = '';
}
else // just once, slurpmanifest() has already been done
store_md_and_traverse_subitems($sdi, 0, 1, 0,
$xht_doc->xmd_select_single_element(TREETOP), -1);
$playIt = $baseWorkDir . $workWith . '/index.php';
$fileHandler = @fopen($playIt, 'w');
@fwrite($fileHandler, content_for_index_php($sdi));
@fclose($fileHandler);
echo htmlspecialchars($workWith);
echo '<br>', htmlspecialchars($workWith);
if (file_exists($playIt)) echo '/index.php ',
htmlspecialchars(date('Y/m/d H:i:s', filemtime($playIt)));
}
@ -370,7 +373,7 @@ elseif ($smo == get_lang('Remove') && $sdisub)
$mdStore->mds_delete_offspring($screm, '\_'); // SQL LIKE underscore
echo htmlspecialchars($screm . '_*: ' . mysql_affected_rows()), '<br>';
}
elseif ($smo == get_lang('Remove'))
elseif ($smo == get_lang('Remove')) // remove all, regardless of $sdiall
{
$mdStore->mds_delete($screm = EID_TYPE . '.' . $sdi);
echo htmlspecialchars($screm . ': ' . mysql_affected_rows()), '<br>';
@ -383,7 +386,8 @@ elseif ($smo == get_lang('Index') && file_exists($phpDigIncCn) &&
{
$result = $mdStore->mds_get_many('eid,mdxmltext,indexabletext',
"eid LIKE '" . EID_TYPE . "." . $sdi .
($sdisub ? "." . $sdisub . "\_%'" : ".%'")); // SQL LIKE underscore
($sdisub ? "." . $sdisub . "\_%'" : ".%'") .
($sdiall ? "" : " AND NOT INSTR(eid,'_')")); // SQL LIKE underscore
while ($row = mysql_fetch_array($result)) // load indexabletexts in memory
{
@ -484,7 +488,7 @@ if (count($perId))
foreach ($pathId as $pth => $id) if ($wwl == 0 ||
($wwl < strlen($pth) && substr($pth, 0, $wwl) == $workWith))
{
$tmfdt = file_exists($tfmff = $baseWorkDir . $pth . '/' . MFF) ?
$tmfdt = file_exists($tfmff = $baseWorkDir . $pth . '/' . MFFNAME . $sdisub . MFFDEXT) ?
date('Y/m/d H:i:s', filemtime($tfmff)) : '-';
echo '<tr><td>', htmlspecialchars($tmfdt), '</td>',
'<td>', htmlspecialchars($pth),
@ -496,7 +500,7 @@ if (count($perId))
if ($mfContents)
{
echo $workWith, '/', MFF, ': ',
echo $workWith, '/', MFFNAME . $sdisub . MFFDEXT, ': ',
htmlspecialchars(date('Y/m/d H:i:s', filemtime($fmff))) , ", \n",
substr_count($mfContents, "\n") + 1,
' ' . get_lang('Lines') . '.', "\n";
@ -504,7 +508,7 @@ if ($mfContents)
if (!$sdisub && ($dh = opendir($baseWorkDir . $workWith)))
{
$nsplit = array();
while (FALSE !== ($file = readdir($dh)))
while (FALSE !== ($file = readdir($dh)))
if (ereg('^'.MFFNAME.'(.+)\\'.MFFDEXT .'$', $file, $regs))
{
$nsplit []= $regs[1];
@ -542,7 +546,7 @@ if ($mfContents || $xht_doc->error)
{
echo '<h3>', get_lang('UploadMff'), "</h3>\n\n",
'<form action="' . $_SERVER['PHP_SELF'] . '?sdi=' . urlencode($sdi) .
($sdisub ? '&sdisub=' . urlencode($sdisub) : '') .
($sdisub ? '&sdisub=' . urlencode($sdisub) : ($sdiall ? '&sdisub='.UZYX : '')) .
'" enctype="multipart/form-data" method="post">', "\n",
'<input type="hidden" name="MAX_FILE_SIZE" value="32768">', "\n",
'<input type="file" name="import_file" size="30">', "\n",
@ -554,7 +558,7 @@ echo '<h3>', get_lang('UploadHtt'), file_exists($fhtf) ?
(' + ' . get_lang('RemoveHtt')) : '', "</h3>\n\n",
'<form action="' . $_SERVER['PHP_SELF'] . '?sdi=' . urlencode($sdi) .
($sdisub ? '&sdisub=' . urlencode($sdisub) : '') .
($sdisub ? '&sdisub=' . urlencode($sdisub) : ($sdiall ? '&sdisub='.UZYX : '')) .
'" enctype="multipart/form-data" method="post">', "\n",
'<input type="hidden" name="MAX_FILE_SIZE" value="32768">', "\n",
'<input type="file" name="import_file" size="30">', "\n",
@ -568,7 +572,7 @@ echo '<h3>', $nameTools, $hdrInfo, '</h3>', "\n";
if ($mfContents || $perId[$sdi]) // buttons for manifest operations
{
echo '<form action="' . $_SERVER['PHP_SELF'] . '?sdi=' . urlencode($sdi) .
($sdisub ? '&sdisub=' . urlencode($sdisub) : '') .
($sdisub ? '&sdisub=' . urlencode($sdisub) : ($sdiall ? '&sdisub='.UZYX : '')) .
'" method="post">', "\n";
if ($mfContents) echo
'<input type="submit" name="smo" value="', get_lang('Import'), '">', "\n";
@ -634,7 +638,7 @@ showSelectForm('SDI',
'<input type="text" size="5" name="sdi" value="' .
htmlspecialchars($sdi) . '" />' .
'(<input type="text" size="4" name="sdisub" value="' .
htmlspecialchars($sdisub) . '" />)' . "\n");
($sdiall ? UZYX : htmlspecialchars($sdisub)) . '" />)' . "\n");
echo '</table>', "\n";

@ -1,5 +1,5 @@
<!-- {-md_document.htt-} --> <!-- for Dokeos metadata/index.php -->
<!-- 2005/04/25 -->
<!-- 2006/05/15 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
@ -91,7 +91,7 @@
<td>{-D xpath metadata/lom/general/language-}{-C LANGSELECT-}</td>
<td>{-D xpath metadata/lom/general/identifier/catalog-}{-D iclass disabled class="wd2" -}{-C INPUT-}</td>
<td>{-D label Identifier-}{-C LABEL-}</td>
<td>{-D xpath metadata/lom/general/identifier/entry-}{-D iclass class="wd2" onKeyPress="return isValidChar(event, '[a-z0-9\x08\x25\*\.\'\(\)_!-]', 'i');" -}{-C INPUT-}</td>
<td>{-D xpath metadata/lom/general/identifier/entry-}{-D iclass class="wd2" onKeyPress="return isValidChar(event, '[a-z0-9\x08\x25\x27\*\.\'\(\)_!-]', 'i');" -}{-C INPUT-}</td>
</tr>
<tr>
<td>{-D label Title-}{-C LABEL-}</td>
@ -129,7 +129,7 @@
<td colspan="2">{-D label CreatedSize-}{-C LABEL-}</td>
<td nowrap>
{-D xpath metadata/lom/lifeCycle/contribute[1]/date/dateTime-}{-D iclass class="wd1" onKeyUp="checkValid(this,'^[0-9]{4}-[0-9]{2}-[0-9]{2}$','i');" -}{-C INPUT-}
{-D xpath metadata/lom/technical/size-}{-D iclass class="wd1" onKeyPress="return isValidChar(event, '[0-9]', 'i');" -}{-C INPUT-}
{-D xpath metadata/lom/technical/size-}{-D iclass class="wd1" onKeyPress="return isValidChar(event, '[0-9\x08\x25\x27]', 'i');" -}{-C INPUT-}
</td>
<td>{-D label Author-}{-C LABEL-}</td>
<td>{-D xpath metadata/lom/lifeCycle/contribute[1]/entity-}{-C INPUTW-}</td>
@ -203,7 +203,7 @@
<input type="text" title="{-X metadata/lom/general/description/string/@language-}"
id="kwds_string" class="wide" value="{-X metadata/lom/general/keyword/string , -}"
onKeyUp="takeTypeIn(this, 150, -100, '150px'); return true;"
onKeyPress="return isValidChar(event, '[0-9a-z\xC0-\xFF\.\x08\x25, -]', 'i');" />
onKeyPress="return isValidChar(event, '[0-9a-z\xC0-\xFF\.\x08\x25\x27, -]', 'i');" />
<!-- {-HEAD-} -->

@ -1,13 +1,13 @@
<?php /* <!-- Dokeos metadata/md_funcs.php -->
<!-- 2005/09/20 -->
<!-- 2006/12/15 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see note at end of text -->
<!-- Copyright (C) 2006 rene.haentjens@UGent.be - see note at end of text -->
*/
/**
==============================================================================
* Dokeos Metadata: common functions and mdstore class
* Dokeos Metadata: common functions and mdstore class
*
* This script requires xmd.lib.php and xht.lib.php (Dokeos inc/lib).
*
@ -25,7 +25,7 @@
* path1,path2,...;subpath=value for all elements in path1, path2, ...
* assign value to subpath (see also xmd_update_many)
*
* @package dokeos.metadata
* @package dokeos.metadata
==============================================================================
*/
@ -49,8 +49,8 @@ function fgc($filename)
function give_up($msg)
{
echo '<p align="center">MetaData:<br><b>? ',
htmlspecialchars($msg), '</b></p>'; exit;
echo '<p align="center">MetaData:<br><b>? ',
htmlspecialchars($msg), '</b></p>'; exit;
}
@ -108,8 +108,8 @@ function define_htt($htt_file, $urlp, $course_path)
function make_uri()
{
$regs = array(); // for use with ereg()
$regs = array(); // for use with ereg()
$uri = strtr(ereg_replace(
"[^0-9A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\xFF\*\(\('!_.-]", "_",
api_get_setting('siteName')), "\\", "_"); // allow letdigs, and _-.()'!*
@ -206,87 +206,32 @@ $ieee_dcmap_v = array(
// KEYWORD TREE --------------------------------------------------------------->
/* NOTE about NESTED_DIVS_FOR_KEYWORDTREE and NESTED_DIV:
The 'document.write' + 'replace's are just a compression mechanism,
they reduce 100K of HTML to an insertable JS file of 25K...
Special characters & combinations: " " " < > <>
Read NESTED_DIV as follows:
{-D bcv class="lfn" value=" "-}
{-R * P empty-}
{-T number >= 1 D bcv class="btn" value="+" onClick="openOrClose(this);"-}
function define_kwds($mdo)
{
if (!($newtext = trim(@fgc(get_course_path() . $mdo->mdo_course['path'] .
'/document' . $mdo->mdo_path ))))
{
unlink(KEYWORDS_CACHE); return;
}
// templates to define the tree as JScript object
$xhtDocKw = new xhtdoc(<<<EOD
<div noWrap="1" class="dvc" level="{-L NLevel-}">
<input type="button" {-P bcv}/>
&#xa0;
<span class="lbl" onClick="spanClick(this, event);">{-L NName-}</span>
<br/>
{-R * C NESTED_DIV-}
</div>
*/
<!-- {-KWTREE_OBJECT-} -->
function define_kwds_htt() { return new xhtdoc(<<<EOD
KWTREE_OBJECT = {n:"", ti:"{-X @title-}"
, c:[{-R * C DOWN_THE_KWTREE-}]};
<!-- {-NESTED_DIVS_FOR_KEYWORDTREE-} -->
document.write((''
{-R * C NESTED_DIV-})
.replace(/"/g, '<div noWrap="1" class="dvc" level="')
.replace(/"/g,'"><input type="button" class="btn" value="+" onClick="openOrClose(this);"/>&#xa0;<span class="lbl" onClick="spanClick(this, event);"')
.replace(/"/g, '"><input type="button" class="lfn" value=" "/>&#xa0;<span class="lbl" onClick="spanClick(this, event);"')
.replace(/<>/g, ' title="').replace(/<>/g, '</span><br/>')
.replace(/</g, '</span><i>').replace(/>/g, '</i><br/>')
.replace(//g, '</div>')
);
document.write(traverseKwObj(KWTREE_OBJECT, '', 0)); KWDS_ARRAY.sort();
<!-- {-NESTED_DIV-} -->
+'"{-L NLevel-}"{-R * P empty-}{-T number >= 1 -}{-L NPost-}>{-L NName-}'
{-R * C NESTED_DIV-}+''
<!-- {-DOWN_THE_KWTREE-} -->
{-T number > 1 , -}{n:"{-V @.-}"{-D cm {-X @comment-}-}{-T cm != empty , cm:"{-P cm-}"-}{-D pt {-X @postit-}-}{-T pt != empty , pt:"{-P pt-}"-}{-R * P empty-}{-T number >= 1
, c:[-}{-T number >= 1 R * C DOWN_THE_KWTREE-}{-R * P empty-}{-T number >= 1 ]-}}
<!-- {--} -->
EOD
);
}
); // traverseKwObj (md_script) generates clickable tree and populates KWDS_ARRAY
function define_kwds($mdo)
{
global $xhtDocKw; // only used here and in the inner function
function not_get_lang($word, $node) // only for the above templates
{
global $xhtDocKw;
if ($word == 'NLevel') // e.g. 001003002
{
$result = '';
for ($k = 1; $k <= $xhtDocKw->xht_param['rdepth']; $k++)
$result .= substr('00' . $xhtDocKw->xht_param['rdepth'.$k], -3);
return $result;
}
if ($word == 'NPost')
{
$postit = $xhtDocKw->xht_xmldoc->attributes[$node]['postit'];
return $postit ? '<>' . str_replace("'", "\'", $postit) . '"' : '';
}
if ($word == 'NName') // replace _ by , in nodename
return str_replace('_', ', ', $xhtDocKw->xht_xmldoc->name[$node]) .
'<'. str_replace("'", "\'",
$xhtDocKw->xht_xmldoc->attributes[$node]['comment']) .'>';
return get_lang($word);
}
if (!($newtext = trim(@fgc(get_course_path() . $mdo->mdo_course['path'] .
'/document' . $mdo->mdo_path ))))
{
unlink(KEYWORDS_CACHE); return;
}
$xhtDocKw = define_kwds_htt();
if ($xhtDocKw->htt_error)
give_up('KwdTree template (metadata/md_funcs): ' . $xhtDocKw->htt_error);
@ -300,12 +245,9 @@ function define_kwds($mdo)
unlink(KEYWORDS_CACHE); return;
}
$xhtDocKw->xht_get_lang = 'not_get_lang';
$newtext = $xhtDocKw->xht_fill_template('NESTED_DIVS_FOR_KEYWORDTREE');
$fileHandler = @fopen(KEYWORDS_CACHE, 'w');
@fwrite($fileHandler, $newtext); @fclose($fileHandler);
@fwrite($fileHandler, $xhtDocKw->xht_fill_template('KWTREE_OBJECT'));
@fclose($fileHandler);
}

@ -1,5 +1,5 @@
<!-- {-md_link.htt-} --> <!-- for Dokeos metadata/index.php -->
<!-- 2005/03/15 -->
<!-- 2006/05/16 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
@ -87,7 +87,7 @@
<td>{-D xpath metadata/lom/general/language-}{-C LANGSELECT-}</td>
<td>{-D xpath metadata/lom/general/identifier/catalog-}{-D iclass disabled class="wd2" -}{-C INPUT-}</td>
<td>{-D label Identifier-}{-C LABEL-}</td>
<td>{-D xpath metadata/lom/general/identifier/entry-}{-D iclass class="wd2" onKeyPress="return isValidChar(event, '[a-z0-9\x08\x25\*\.\'\(\)_!-]', 'i');" -}{-C INPUT-}</td>
<td>{-D xpath metadata/lom/general/identifier/entry-}{-D iclass class="wd2" onKeyPress="return isValidChar(event, '[a-z0-9\x08\x25\x27\*\.\'\(\)_!-]', 'i');" -}{-C INPUT-}</td>
</tr>
<tr>
<td>{-D label Title-}{-C LABEL-}</td>
@ -120,6 +120,16 @@
<!-- {-METADATA_INDEXABLETEXT-} -->
Title: {-V metadata/lom/general/title/string-} txt-sep
Keyword(s): {-R metadata/lom/general/keyword C KWTEXT-} txt-sep
Category: {-V metadata/lom/general/coverage/string-}
{-V metadata/lom/general/description[1]/string-} txt-end
link-type
{-V metadata/lom/lifeCycle/contribute[1]/entity-}
{-V metadata/lom/lifeCycle/contribute[1]/date/dateTime-}
<!-- {-METADATA_INDEXABLETEXT_PREVIOUS_VERSION-} -->
{-V metadata/lom/general/identifier/entry-}
{-V metadata/lom/general/title/string-}
{-V metadata/lom/general/description/string-}
@ -172,7 +182,7 @@
<input type="text" title="{-X metadata/lom/general/description/string/@language-}"
id="kwds_string" class="wide" value="{-X metadata/lom/general/keyword/string , -}"
onKeyUp="takeTypeIn(this, 150, -100, '60%'); return true;"
onKeyPress="return isValidChar(event, '[0-9a-z\xC0-\xFF\.\x08\x25, -]', 'i');" />
onKeyPress="return isValidChar(event, '[0-9a-z\xC0-\xFF\.\x08\x25\x27, -]', 'i');" />
<!-- {-HEAD-} -->

@ -1,7 +1,7 @@
<?php /* <!-- md_link.php for Dokeos metadata/*.php -->
<!-- 2005/09/20 -->
<!-- 2006/12/15 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
<!-- Copyright (C) 2006 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
*/
@ -36,11 +36,9 @@ function mdo_define_htt() { return new xhtdoc(<<<EOD
Title: {-V metadata/lom/general/title/string-} txt-sep
Keyword(s): {-R metadata/lom/general/keyword C KWTEXT-} txt-sep
Category: {-V metadata/lom/general/coverage/string-}
Category: {-V metadata/lom/general/coverage/string-} txt-sep
{-V metadata/lom/general/description[1]/string-} txt-end
link-type
{-V metadata/lom/lifeCycle/contribute[1]/entity-}
{-V metadata/lom/lifeCycle/contribute[1]/date/dateTime-}
<!-- {-KWTEXT-} -->
@ -178,6 +176,7 @@ function mdo_storeback(&$xmlDoc) // by ref!
function mdo_add_breadcrump_nav()
{
global $interbreadcrumb;
$regs = array(); // for use with ereg()
$docurl = $_SERVER['PHP_SELF']; // should be .../main/xxx/yyy.php
@ -219,10 +218,10 @@ function mdobject($_course, $id)
function _find_keywords($d)
{
$dd = new xmddoc($d); if ($dd->error) return NULL;
$regs = array(); // for use with ereg()
$dd = new xmddoc($d); if ($dd->error) return NULL;
$regs = array(); // for use with ereg()
foreach ($dd->attributes[0] as $name => $value)
if ($name == 'kw' && ereg('^<?([^>]+)>?$', $value, $regs))
{

@ -1,5 +1,5 @@
<?php /* <!-- md_scorm.php for Dokeos metadata/*.php -->
<!-- 2005/09/20 -->
<!-- 2006/12/15 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
@ -34,11 +34,13 @@ function mdo_define_htt() { return new xhtdoc(<<<EOD
<!-- {-INDEXABLETEXT-} -->
{-D scormlevel {-V @level-}-}{-D two 2-}
Title: {-V metadata/lom/general/title/string-} txt-sep
{-T scormlevel == two Author(s): {-V metadata/lom/lifeCycle/contribute[1]/entity-} txt-sep-}
Keyword(s): {-R metadata/lom/general/keyword C KWTEXT-} txt-sep
{-V metadata/lom/general/description[1]/string-}
{-V metadata/lom/technical/location-} txt-end
{-V metadata/lom/general/description[2]/string-} scorm-level-{-V @level-}
{-V metadata/lom/general/description[2]/string-} scorm-level-{-P scormlevel-}
{-V metadata/lom/lifeCycle/contribute[1]/entity-}
{-V metadata/lom/lifeCycle/contribute[1]/date/dateTime-}

@ -1,5 +1,5 @@
// md_script.js <!-- for Dokeos metadata/*.php -->
// <!-- 2006/01/18 -->
// <!-- 2006/05/16 -->
// Copyright (C) 2006 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
@ -31,7 +31,7 @@
{
if (!document.getElementById)
alert('Sorry, the buttons only work with W3C browsers. ' +
'Use Moz1.7 or IE6 or NN7 or type in keywords manually...');
'Use FireFox or IE6 or Moz1.7 or type in keywords manually...');
return !document.getElementById;
}
@ -184,8 +184,8 @@
{
if (isNotW3C()) return false;
if (!ev) var ev = window.event;
if (!ev) var ev = window.event;
var kws = document.getElementById('kwds_string');
for (var s in selspans) selspans[s].className = "lbl";
@ -195,7 +195,7 @@
if (!ev.altKey) { kws.value = ''; return; }
// md_script: calling HTML should define var kwdswere!
// md_script: the calling HTML should define var kwdswere!
// in SelKwds.xsl, they are typed in by user or fetched from PPT
var kwdsarray = kwdswere.split(','), allKwds = '';
@ -275,7 +275,7 @@
var KWDS_ARRAY = new Array, nkw = 0, pU; // alphabetic list popup
function makeAlphaList(div)
function makeAlphaList(div) // md_script: not used (hopefully)
{
var ch = div.childNodes;
for (var i = 0; i < ch.length; i++)
@ -329,11 +329,17 @@
if (!pU)
{
pU = document.getElementById('popup');
makeAlphaList(document.getElementById('maindiv'));
KWDS_ARRAY.sort();
if (!KWDS_ARRAY.length)
{
makeAlphaList(document.getElementById('maindiv'));
KWDS_ARRAY.sort();
}
}
var curValue = kws.value.toLowerCase(), kwLines = '';
if (!(curValue = kws.value.toLowerCase())) return;
var kwLines = '';
for (pos = 0; pos < KWDS_ARRAY.length; pos++)
if (KWDS_ARRAY[pos].toLowerCase().indexOf(curValue) == 0)
@ -402,44 +408,44 @@
var fieldColor = (new RegExp(pattern, flags)).test(inputField.value) ? '#000000' : '#D8366C';
var fieldStyle = (document.getElementById || document.all) ?
inputField.style : inputField;
if (fieldStyle) fieldStyle.color = fieldColor;
// OK for all browsers (see devedge.netscape.com
// /library/xref/2003/css-support/css1/mastergrid.html):
// color, background-color (not on NN4), display block/none (NN4?),
// overflow hidden/scroll/auto (not on NN4),
// position relative/static,
// text-align left/right/center, text-indent,
// font-style normal/italic, font-weight normal/bold,
// font-family serif/sans-serif/monospace,
// border-style none/solid/double/groove/ridge/inset/outset.
if (fieldStyle) fieldStyle.color = fieldColor;
// OK for all browsers (see devedge.netscape.com
// /library/xref/2003/css-support/css1/mastergrid.html):
// color, background-color (not on NN4), display block/none (NN4?),
// overflow hidden/scroll/auto (not on NN4),
// position relative/static,
// text-align left/right/center, text-indent,
// font-style normal/italic, font-weight normal/bold,
// font-family serif/sans-serif/monospace,
// border-style none/solid/double/groove/ridge/inset/outset.
}
function getObj(name) // PPK
{
return (document.getElementById) ? document.getElementById(name)
: (document.all) ? document.all[name] // IE4
: (document.layers) ? document.layers[name] // NS4
: null; // With NS4, nested layers are not supported!
: (document.layers) ? document.layers[name] // NS4
: null; // With NS4, nested layers are not supported!
}
function spc(path, value) // set pending change in form field mda
{
var mda = getObj("mda");
if (mda) mda.value += "\n" + path + '=' + value;
var mda = getObj("mda");
if (mda) mda.value += "\n" + path + '=' + value;
}
function spcSel(path, selbox) // set pending change, language selection
{
var mda = getObj("mda");
if (mda) mda.value += "\n" + path + '=' +
selbox.options[selbox.selectedIndex].value;
var mda = getObj("mda");
if (mda) mda.value += "\n" + path + '=' +
selbox.options[selbox.selectedIndex].value;
}
function checkBeforeSubmit(ev)
{
if (!ev) var ev = window.event;
if (!ev) var ev = window.event;
if (ev.ctrlKey && ev.altKey)
{
var mdt = getObj("mdt"); if (!mdt) return false;
@ -454,79 +460,116 @@
return false;
}
var kwdsnow = getObj("kwds_string"); if (!kwdsnow) return true;
if (kwdsnow.value == kwdswere) return true; // unchanged
// note: calling HTML should define var kwdswere!
var language = kwdsnow.title;
var mda = getObj("mda");
if (!mda) { alert('? Form does not contain mda'); return false; }
var kwdsarray = kwdswere.split(',');
for (var k = 0; k < kwdsarray.length; k++) // delete old
if (kwdsarray[k].trim() != '')
mda.value += "\nmetadata/lom/general/keyword[-1]~";
kwdsarray = kwdsnow.value.split(',');
for (k = 0; k < kwdsarray.length; k++)
{
var newkw = kwdsarray[k].trim();
if (newkw != '') mda.value +=
"\nmetadata/lom/general!keyword" +
"\nmetadata/lom/general/keyword[-1]!string=" + newkw +
"\nmetadata/lom/general/keyword[-1]/string/@language=" + language;
var kwdsnow = getObj("kwds_string"); if (!kwdsnow) return true;
if (kwdsnow.value == kwdswere) return true; // unchanged
// note: calling HTML should define var kwdswere!
var language = kwdsnow.title;
var mda = getObj("mda");
if (!mda) { alert('? Form does not contain mda'); return false; }
var kwdsarray = kwdswere.split(',');
for (var k = 0; k < kwdsarray.length; k++) // delete old
if (kwdsarray[k].trim() != '')
mda.value += "\nmetadata/lom/general/keyword[-1]~";
kwdsarray = kwdsnow.value
.replace(/[!-,:-@\[-\^{-~\s]+/g, ',').split(',');
for (k = 0; k < kwdsarray.length; k++)
{
var newkw = kwdsarray[k].trim();
if (newkw != '') mda.value +=
"\nmetadata/lom/general!keyword" +
"\nmetadata/lom/general/keyword[-1]!string=" + newkw +
"\nmetadata/lom/general/keyword[-1]/string/@language=" + language;
}
return true;
return true;
}
function setPendingOperation(op, ev)
{
if (!ev) var ev = window.event;
var mda = getObj("mda");
if (!mda) { alert('? Form does not contain mda'); return false; }
if (op == '!!' || (op == '~~' && confirm(mda.title)))
{
mda.value = op; return true;
}
return false;
if (!ev) var ev = window.event;
var mda = getObj("mda");
if (!mda) { alert('? Form does not contain mda'); return false; }
if (op == '!!' || (op == '~~' && confirm(mda.title)))
{
mda.value = op; return true;
}
return false;
}
function prepSearch(ev)
{
if (!ev) var ev = window.event;
var mdsc = getObj("mdsc");
if (!mdsc) { alert('? Form does not contain mdsc'); return false; }
var kwdsnow = getObj("kwds_string"); if (!kwdsnow) return true;
if (kwdsnow.value == '') return true;
var kwdsarray = kwdsnow.value.split(',');
for (var k = 0; k < kwdsarray.length; k++)
{
var newkw = kwdsarray[k].trim().toLowerCase();
if (newkw != '')
{
var realkw = false;
for (pos = 0; pos < KWDS_ARRAY.length; pos++)
if (KWDS_ARRAY[pos].toLowerCase() == newkw)
realkw = true;
mdsc.value += "\n" + newkw + (realkw ? '-kw' : '');
}
if (!ev) var ev = window.event;
var mdsc = getObj("mdsc");
if (!mdsc) { alert('? Form does not contain mdsc'); return false; }
var kwdsnow = getObj("kwds_string"); if (!kwdsnow) return true;
if (kwdsnow.value == '') return true;
if (!KWDS_ARRAY.length)
{
makeAlphaList(getObj('maindiv'));
KWDS_ARRAY.sort();
}
var restricttokwds = false, checkbox = getObj("restricttokwds");
if (checkbox) restricttokwds = checkbox.checked;
var kwdsarray = kwdsnow.value
.replace(/[!-,:-@\[-\^{-~\s]+/g, ',').split(',');
for (var k = 0; k < kwdsarray.length; k++)
{
var newkw = kwdsarray[k].trim().toLowerCase();
if (newkw != '')
{
var realkw = false;
if (restricttokwds)
for (pos = 0; pos < KWDS_ARRAY.length; pos++)
if (KWDS_ARRAY[pos].toLowerCase() == newkw)
{ realkw = true; break; }
mdsc.value += "\n" + newkw + (realkw ? '-kw' : '');
}
}
return true;
return true;
}
var CRLF = "\n"; // generates clickable tree and populates KWDS_ARRAY
function traverseKwObj(node, parlev, num) // see KWTREE_OBJECT in md_funcs
{
var curlev = parlev + ('00' + (num+1)).substr(-3), kwn = '', html = '';
for (i in (names = node.n.split("_")))
if (nn = names[i]) { KWDS_ARRAY.push(nn); kwn += ', ' + nn; }
for (j in node.c) html += traverseKwObj(node.c[j], curlev, Math.abs(j));
return (parlev == '') ? html :
'<div noWrap="1" class="dvc" level="' + curlev + '">' + CRLF +
'<input type="button" class="' +
(html ? 'btn" value="+" onClick="openOrClose(this);"/>' :
'lfn" value=" "/>') + '&#xa0;' + CRLF +
'<span class="lbl" onClick="spanClick(this, event);"' +
(node.pt ? ' title="' + node.pt + '">' : '>') +
kwn.substr(2) + '</span>' + CRLF +
(node.cm ? '<i>' + node.cm + '</i>' : '') +
html +
'</div>' + CRLF;
}

@ -0,0 +1,79 @@
KWTREE_OBJECT = {n:"", ti:"Aquaculture Keywords"
, c:[{n:"organisms", cm:"(more or less in systematical order)"
, c:[{n:"bacteria"}, {n:"yeast", cm:"he&lt;la", pt:"HoHo"}, {n:"alga"
, c:[{n:"seaweed_macroalga"
, c:[{n:"gracilaria"}, {n:"hijikia"}, {n:"laminaria"}, {n:"porphyra_nori"}, {n:"undaria_wakame"}, {n:"macroalgae-nei"}]}, {n:"microalga"
, c:[{n:"chlorella"}, {n:"dunaliella"}, {n:"isochrysis"}, {n:"nannochloropsis"}, {n:"tetraselmis"}, {n:"diatom-nei"}, {n:"microalga-nei"}]}]}, {n:"rotifer"
, c:[{n:"brachionus-plicatilis"}, {n:"rotifer-nei"}]}, {n:"mollusc"
, c:[{n:"abalone_winkle_conch"
, c:[{n:"abalone_haliotis"}, {n:"other-gastropod"}]}, {n:"clam_cockle"
, c:[{n:"hard-clam_mercenaria-mercenaria"}]}, {n:"mussel"
, c:[{n:"mussel_mytilus-edulis"}]}, {n:"oyster"
, c:[{n:"oyster_ostrea-edulis"}, {n:"oyster_crassostrea-gigas"}]}, {n:"scallop_pecten"
, c:[{n:"scallop_argopecten-irradians"}, {n:"scallop_pecten-maximus"}]}, {n:"squid_cuttlefish_octopus"
, c:[{n:"octopus"}, {n:"sepia"}]}, {n:"mollusc-nei"
, c:[{n:"tapes-philippinarum"}]}]}, {n:"crustacean"
, c:[{n:"brine-shrimp_artemia"}, {n:"freshwater-crustacean"
, c:[{n:"crayfish_astacus_cherax"}, {n:"freshwater-prawn_macrobrachium-rosenbergii"}, {n:"freshwater-crustacean-nei"}]}, {n:"crab"
, c:[{n:"mudcrab_scylla"}, {n:"mitten-crab_eriocheir"}, {n:"crab-nei"}]}, {n:"lobster"
, c:[{n:"lobster_homarus"}, {n:"spiny-lobster_panilurus"}, {n:"lobster-nei"}]}, {n:"penaeid-shrimp_scampi"
, c:[{n:"fenneropenaeus-sinensis"}, {n:"penaeus-indicus"}, {n:"kuruma-shrimp_penaeus-japonicus"}, {n:"tiger-prawn_penaeus-monodon"}, {n:"penaeus-semisulcatus"}, {n:"penaeus-stylirostris"}, {n:"litopenaeus-vannamei"}, {n:"penaeid-nei"}]}, {n:"krill_planktonic-crustacean"
, c:[{n:"moina"}, {n:"copepod-nei"}, {n:"daphnia"}]}, {n:"crustacean-nei"
, c:[{n:"mysidopsis-bahia"}]}]}, {n:"fish"
, c:[{n:"carp_cyprinid"
, c:[{n:"common-carp_cyprinus-carpio"}, {n:"grass-carp_ctenopharyngodon-idella"}, {n:"koi-carp"}]}, {n:"eel"
, c:[{n:"european-eel_anguilla-anguilla"}, {n:"japanese-eel_anguilla-japonica"}]}, {n:"flatfish"
, c:[{n:"flounder_paralichthys-olivaceus"}, {n:"halibut_hippoglossus-hippoglossus"}, {n:"sole_pleuronectes"}, {n:"plaice_pleuronectes-platessa"}, {n:"turbot_scophthalmus-maximus"}, {n:"flatfish-nei"}]}, {n:"herring_sardine_anchovy"
, c:[{n:"herring_clupea-harengus"}]}, {n:"salmon_trout_smelt"
, c:[{n:"atlantic-salmon_salmo-salar"}, {n:"pacific-salmon_oncorhynchus-mykiss"}, {n:"rainbow-trout_salmo-gairdneri"}]}, {n:"shark_ray"}, {n:"tuna_bonito_billfish"}, {n:"tilapia_cichlid"
, c:[{n:"nile-tilapia_oreochromis-niloticus"}]}, {n:"freshwater-fish-nei"
, c:[{n:"african-catfish_clarias-gariepinus"}, {n:"catfish-nei"}, {n:"guppy_poecilia-reticulata"}, {n:"heterobranchus-longifilis"}, {n:"pike_esox-lucius"}, {n:"pike-perch_stizostedion-lucioperca"}, {n:"sturgeon_acipenser"}]}, {n:"marine-fish-nei"
, c:[{n:"arctic-charr_salvelinus-alpinus"}, {n:"asian-seabass_lates-calcarifer"}, {n:"atlantic-cod_gadus-morhua"}, {n:"capelin_mallotus-villosus"}, {n:"dentex_dentex-dentex"}, {n:"dolphin-fish_mahimahi_coryphaena-hippurus"}, {n:"grouper_epinephelus"}, {n:"ictalurus"}, {n:"lumpsucker_cyclopterus-lumpus"}, {n:"milkfish_chanos-chanos"}, {n:"mullet_mugil-cephalus"}, {n:"rabbitfish_siganus"}, {n:"red-drum_sciaenops"}, {n:"red-seabream_pagrus-major"}, {n:"rockfish_sebastes"}, {n:"seabass_dicentrarchus-labrax"}, {n:"seabream_sparus-aurata"}, {n:"snapper_lutjanus"}, {n:"yellowtail_seriola"}]}, {n:"ornamental-fish"}, {n:"fish-nei"}]}, {n:"other-aquatic-organism"
, c:[{n:"sponge"}, {n:"coral"}, {n:"aquatic-plants"}, {n:"aquatic-insects"}, {n:"various-worms"}, {n:"pearl_mother-of-pearl"}, {n:"sea-urchin_echinoderm"}, {n:"zooplankton_phytoplankton"}, {n:"aquatic-invertebrate-nei"}, {n:"frog_amphibian"}, {n:"turtle"}, {n:"crocodile_alligator"}, {n:"aquatic-mammal"}, {n:"aquatic-organism-nei"}]}, {n:"non-aquatic-organism", cm:"(such as birds, cattle, ...)"}]}, {n:"culture-aspects"
, c:[{n:"life-stage"
, c:[{n:"cyst"}, {n:"diapause"}, {n:"seed"}, {n:"egg"}, {n:"larva"
, c:[{n:"spat"}, {n:"umbrella"}, {n:"zoea"}, {n:"nauplius"}, {n:"mysis"}, {n:"megalopa"}, {n:"larval-stage-nei"}]}, {n:"post-larva"}, {n:"juvenile_fingerling"}, {n:"adult"}, {n:"broodstock"}, {n:"biomass"}, {n:"life-cycle"}, {n:"other-life-stage"}]}, {n:"nutrition"
, c:[{n:"diet"
, c:[{n:"dry-diet_formulated-diet"}, {n:"microbound-diet_mbd"}, {n:"wet-diet"}, {n:"live-food"}, {n:"diet-type-nei"}]}, {n:"feed-ingredient"
, c:[{n:"nutrient-requirement"}, {n:"protein"}, {n:"lipids_fat"}, {n:"hufa"}, {n:"carbohydrate"}, {n:"mineral"}, {n:"vitamin"}, {n:"fishmeal"}, {n:"energy"}, {n:"feed-additives_enrichment-product"}, {n:"feed-ingredient-nei"}]}, {n:"feed-production"
, c:[{n:"ingredient"}, {n:"formulation"}, {n:"extrusion"}]}, {n:"feeding-biology"
, c:[{n:"feed-intake"}, {n:"feeding-ratio"}, {n:"feed-conversion"}, {n:"digestion"}, {n:"excretion"}]}, {n:"nutritional-aspect-nei"}]}, {n:"culture-system"
, c:[{n:"pond_pond-culture"}, {n:"tank-culture"}, {n:"experimental-installation"}, {n:"batch-culture"}, {n:"flow-through"}, {n:"raceway-system"}, {n:"recirculation-system"}, {n:"pen-culture"}, {n:"floating-cage"}, {n:"raft_long-line"}, {n:"rack-culture_pole-culture"}, {n:"saltwork_salt-pond"}, {n:"backyard-culture"}, {n:"hydroponic-culture"}, {n:"x-----", cm:"main culture principles:"}, {n:"extensive-culture"}, {n:"semi-intensive-culture"}, {n:"intensive-culture"}, {n:"polyculture_integrated-culture"}, {n:"sea-ranching"}, {n:"culture-system-nei"}]}, {n:"culture-step_culture-activity", cm:"(more or less in chronological order)"
, c:[{n:"x-----", cm:"general culture steps:"}, {n:"reproduction_maturation"}, {n:"spawning"}, {n:"hatchery"}, {n:"larviculture"}, {n:"weaning"}, {n:"nursery"}, {n:"grow-out_farming"}, {n:"x-----", cm:"specific culture steps:"}, {n:"pond-construction"}, {n:"pond-preparation_liming_fertilisation"}, {n:"stocking_inoculation"}, {n:"acclimatisation"}, {n:"hatching"}, {n:"decapsulation"}, {n:"enrichment"}, {n:"cold-storage"}, {n:"feeding"}, {n:"sampling"}, {n:"counting"}, {n:"tagging"}, {n:"grading"}, {n:"cleaning_rinsing"}, {n:"harvesting"}, {n:"processing"}, {n:"quality-control"}, {n:"storage_packing_transport"}, {n:"culture-step-nei"}]}, {n:"equipment_infrastructure"
, c:[{n:"tank"}, {n:"bottle_tube"}, {n:"aquarium"}, {n:"substrate_holder"}, {n:"filter_sieve"}, {n:"incubator"}, {n:"hapa"}, {n:"heater"}, {n:"pump"}, {n:"aerator"}, {n:"air-water-lift"}, {n:"feeder"}, {n:"grader"}, {n:"equipment-nei", cm:"(see also 'water treatment' for more equipment)"}]}, {n:"health_disease"
, c:[{n:"treatment_health-management"}, {n:"disinfection_infection"}, {n:"stress"}, {n:"parasitose"}, {n:"bacteria"}, {n:"virus_phage"}, {n:"fungi"}, {n:"nutritional-disease"}, {n:"water-quality-disease"}, {n:"deformity"}, {n:"pesticide"}, {n:"antibiotics"}, {n:"vaccin"}, {n:"probiont"}, {n:"disease-nei"}]}, {n:"water-quality"
, c:[{n:"water-quality-parameter"
, c:[{n:"temperature"}, {n:"oxygen"}, {n:"ph_acidity"}, {n:"salinity"}, {n:"hardness"}, {n:"organic-matter"}, {n:"nitrogen-compound"}, {n:"harmful-substance"}, {n:"pathogen"}, {n:"heavy-metal"}, {n:"water-quality-parameter-nei"}]}, {n:"water-treatment"
, c:[{n:"water-analysis"}, {n:"water-sampling"}, {n:"aerator_oxygenation"}, {n:"filtering"}, {n:"suspended-solids-removal"}, {n:"protein-skimmer"}, {n:"biofilter"}, {n:"nitrification_denitrification"}, {n:"ozonisation_ozonisator"}, {n:"uv-installation"}, {n:"disinfection"}, {n:"degassing"}, {n:"liming"}, {n:"sedimentation"}, {n:"water-treatment-nei"}]}, {n:"water-usage"
, c:[{n:"water-supply"}, {n:"water-discharge"}, {n:"water-reuse_recirculation"}, {n:"green-water"}, {n:"hydrodynamics_circulation"}]}, {n:"water-quality-aspect-nei"}]}, {n:"culture-aspect-nei"}]}, {n:"life-sciences"
, c:[{n:"morphology"}, {n:"biology"
, c:[{n:"life-cycle"}, {n:"growth"}, {n:"survival"}, {n:"dose-response"}]}, {n:"taxonomy_systematics"}, {n:"ecology"
, c:[{n:"ecosystem_food-chain"}, {n:"predator_prey"}, {n:"biodiversity"}, {n:"zoogeography_natural-distribution"}, {n:"environmental-impact"}, {n:"eutrophication"}, {n:"pollution"}, {n:"toxicant_contaminant"}, {n:"ecological-footprint"}, {n:"biotope"}, {n:"indogeneous-species"}, {n:"exogeneous-species"}]}, {n:"chemistry"
, c:[{n:"analysis_chemical-composition"}, {n:"chemical_molecule"}, {n:"hormone"}, {n:"reaction"}]}, {n:"microbiology"
, c:[{n:"microflora"}, {n:"plating_plate-count_cfu"}, {n:"medium_agar"}, {n:"bacteria"}, {n:"virus"}, {n:"pathogen"}, {n:"probiont"}, {n:"opportunistic-bacteria"}, {n:"microbial-technique-nei"}]}, {n:"genetics"
, c:[{n:"qualitative-genetic-technique"}, {n:"quantative-genetic-technique"}, {n:"gene"}, {n:"dna"}, {n:"chromosome"}, {n:"selection_evolution"}, {n:"heritability"}, {n:"inbreeding"}, {n:"domestication"}, {n:"hybridization"}, {n:"ploidy"}, {n:"gynogenesis"}, {n:"androgenesis"}, {n:"population-genetics"}, {n:"gene-mapping"}, {n:"sex-determination-system"}, {n:"genetics-nei"}]}, {n:"immunology"}, {n:"microscopy"
, c:[{n:"dissection"}, {n:"length-measurement"}, {n:"counting"}, {n:"microscopy-nei"}]}]}, {n:"geography"
, c:[{n:"world"
, c:[{n:"europe"
, c:[{n:"belgium"}, {n:"the-netherlands"}, {n:"france"}, {n:"italy"}, {n:"spain_portugal"}, {n:"greece"}, {n:"uk_ireland"}, {n:"norway_sweden_denmark_iceland"}, {n:"european-country-nei"}]}, {n:"former-USSR"}, {n:"africa"
, c:[{n:"egypt"}, {n:"north-africa-nei"}, {n:"kenia"}, {n:"central-africa-nei"}, {n:"south-africa"}]}, {n:"north-and-central-america"
, c:[{n:"canada"}, {n:"usa"}, {n:"utah"}, {n:"mexico"}, {n:"central-american-state-nei"}, {n:"caribbean"}]}, {n:"south-america"
, c:[{n:"brazil"}, {n:"chile"}, {n:"colombia"}, {n:"ecuador"}, {n:"south-america-nei"}]}, {n:"asia"
, c:[{n:"middle-east"}, {n:"india"}, {n:"china"}, {n:"japan"}, {n:"vietnam"}, {n:"thailand"}, {n:"philippines"}, {n:"asian-country-nei"}]}, {n:"oceania"
, c:[{n:"australia"}, {n:"new-zealand"}]}, {n:"arctic_antarctic"}]}, {n:"biotope"
, c:[{n:"ocean_sea"}, {n:"river"}, {n:"bay_lagoon_fjord"}, {n:"coastline_estuary"}, {n:"mangrove"}, {n:"lake"}, {n:"salt-lake_salina"}, {n:"reef"}, {n:"tundra_prairie_savanna"}, {n:"mountain"}, {n:"forest_jungle"}, {n:"cultured-land"}, {n:"biotope-nei"}]}]}, {n:"other-aspects"
, c:[{n:"sectors"
, c:[{n:"education"
, c:[{n:"university_school"}, {n:"students"}, {n:"lecture_course"}, {n:"practical-exercise"}, {n:"training"}, {n:"study-trip"}, {n:"course-material"}, {n:"examination"}, {n:"scholarship_grant"}, {n:"education-nei"}]}, {n:"research"
, c:[{n:"laboratory"}, {n:"institute_university"}, {n:"scientist_researcher"}, {n:"experiment"}, {n:"project"}, {n:"publication"}, {n:"meeting_conference"}, {n:"research-nei"}]}, {n:"trade_business"
, c:[{n:"company"}, {n:"market_shop"}, {n:"trend_prospect"}, {n:"commercial-product"}, {n:"office"}, {n:"retail_distribution"}, {n:"price_money"}, {n:"marketing_publicity"}, {n:"transport"}, {n:"trade-nei"}]}, {n:"production"
, c:[{n:"farm"}, {n:"factory_industry"}, {n:"building_warehouse"}, {n:"machine"}, {n:"production-nei"}]}, {n:"other-sector"
, c:[{n:"organisation_network"}, {n:"government"}, {n:"ngo"}, {n:"development-aid"}, {n:"cooperation"}, {n:"sponsor_funding-agency"}, {n:"insurance"}, {n:"consultancy"}]}, {n:"aquaculture"}, {n:"agriculture"}, {n:"fishery"
, c:[{n:"harvest_catch"}, {n:"fishing-gear"}, {n:"vessel"}, {n:"restocking"}, {n:"by-catch"}, {n:"overfishing"}, {n:"fishery-aspect-nei"}]}]}, {n:"people"
, c:[{n:"researcher"}, {n:"farmer"}, {n:"fisherman"}, {n:"diver"}, {n:"student_teacher"}, {n:"portrait-of-specific-person_group-picture"}]}, {n:"presentation"
, c:[{n:"title"}, {n:"content_overview"}, {n:"introduction_background"}, {n:"methodology"}, {n:"results"}, {n:"advantages_disadvantages"}, {n:"discussion"}, {n:"conclusion"}, {n:"references"}, {n:"aknowledgement_thanks"}, {n:"the-end"}]}, {n:"apparatus"
, c:[{n:"hufa-analysis"}, {n:"balance"}, {n:"blender"}, {n:"kjeldahl"}, {n:"chromatograph"}, {n:"gel-electrophoresis"}, {n:"centrifuge"}, {n:"lyophilisator"}, {n:"refrigerator"}, {n:"oven"}, {n:"pipette"}, {n:"microscope"}, {n:"apparatus-nei"}]}, {n:"information_media"
, c:[{n:"literature"}, {n:"book"}, {n:"journal"}, {n:"publication"}, {n:"news"}, {n:"internet_www"}, {n:"site_links"}, {n:"discussion-list"}, {n:"computer"}, {n:"software"}, {n:"slide"}, {n:"video_dvd_cd-rom"}, {n:"telephone_fax"}, {n:"e-mail"}]}]}, {n:"slide-content"
, c:[{n:"scheme_drawing"}, {n:"graph_chart"}, {n:"table"}, {n:"map"}, {n:"just-text"}, {n:"combination", cm:"(picture combined with map or table or ...)"}, {n:"skip-this-slide", cm:"(Do not copy to SCORM output)"}]}]};
document.write(traverseKwObj(KWTREE_OBJECT, '', 0)); KWDS_ARRAY.sort();

@ -0,0 +1,11 @@
<>Search for anything<hr/>
<scheme-kw>Slide with scheme
<graph-kw>Slide with graph
<table-kw>Slide with table
<map-kw>Slide with map<hr/>
<scorm-level-0 -allrefs>Only complete presentations<hr/>
<scorm-level-2>Only literature references<b> - </b>
<txt-sep -scorm-level-2>exclude literature references
<link-type>Only useful links<b> - </b>
<link-type>exclude useful links
<txt-sep -scorm-level-2 -link-type>Exclude references and links

@ -0,0 +1,195 @@
<?php
//English messages for PhpDig
//Antoine Bajolet - fr - bajolet@toiletoine.net
//Corrections by Brien Louque
//'keyword' => 'translation'
$phpdig_mess = array (
'one_per_line' =>'Enter one link per line',
'StopSpider' =>'Stop spider',
'id' =>'ID',
'url' =>'URL',
'days' =>'Days',
'links' =>'Links',
'depth' =>'Depth',
'viewRSS' =>'View RSS for this Page',
'powered_by' =>'Powered by PhpDig',
'searchall' =>'Search All',
'wait' =>'Wait... ',
'done' =>'Done!',
'limit' =>'Limit',
'manage' =>'Here you can manage:',
'dayscron' =>'- the number of <b>days</b> crontab waits to reindex (0 = ignore)',
'links_mean' =>'- the max number of <b>links</b> per depth per site (0 = unlimited)',
'depth_mean' =>'- the max search <b>depth</b> per site (0 = none, depth trumps links)',
'max_found' =>'Maximum links found is ((links * depth) + 1) when links is greater than zero.',
'default_vals' =>'Default values',
'use_vals_from' =>'Use values from',
'table_present' =>'table if present and use<br/>default values if values absent from table?',
'admin_msg_1' =>'- To empty tempspider table click delete button <i>without</i> selecting a site',
'admin_msg_2' =>'- Search depth of zero tries to crawl just that page regardless of links per',
'admin_msg_3' =>'- Set links per depth to the max number of links to check at each depth',
'admin_msg_4' =>'- Links per depth of zero means to check for all links at each seach depth',
'admin_msg_5' =>'- Clean dashes removes \'-\' index pages from blue arrow listings of pages',
'admin_panel' =>'Admin Panel',
'choose_temp' =>'Choose a template',
'select_site' =>'Select a site to search',
'restart' =>'Restart',
'narrow_path' =>'Narrow Path to Search',
'upd_sites' =>'Update sites',
'upd2' =>'Update Done',
'links_per' =>'Links per',
'yes' =>'yes',
'no' =>'no',
'delete' =>'delete',
'reindex' =>'Re-index',
'back' =>'Back',
'files' =>'files',
'admin' =>'Administration',
'warning' =>'Warning !',
'index_uri' =>'Which URI would you index?',
'spider_depth' =>'Search depth',
'spider_warn' =>'Please ensure that no one else is updating the same site.
A locking mechanism will be included in a later version.',
'site_update' =>'Update a site or one of its branch',
'clean' =>'Clean',
't_index' =>'index',
't_dic' =>'dictionary',
't_stopw' =>'common words',
't_dash' =>'dashes',
'update' =>'Update',
'exclude' =>'Delete and exclude branch',
'excludes' =>'Exclude paths',
'tree_found' =>'Found tree',
'update_mess' =>'Re-index or delete a tree ',
'update_warn' =>'Exclude will delete indexed entries',
'update_help' =>'Click on the cross to delete the branch
Click on the green sign to update it
Click on the noway sign to exclude from future indexings',
'branch_start' =>'Select the folder to display on the left side',
'branch_help1' =>'Select there documents to update individually',
'branch_help2' =>'Click on the cross to delete a document
Click on the green sign to reindex it',
'redepth' =>'levels depth',
'branch_warn' =>'Erase is permanent',
'to_admin' =>'to admin interface',
'to_update' =>'to update interface',
'search' =>'Search',
'results' =>'results',
'display' =>'display',
'w_begin' =>'and operator',
'w_whole' =>'exact phrase',
'w_part' =>'or operator',
'alt_try' =>'Did you mean',
'limit_to' =>'limit to',
'this_path' =>'this path',
'total' =>'total',
'seconds' =>'seconds',
'w_common_sing' =>'is a very common word and was ignored.',
'w_short_sing' =>'is too short a word and was ignored.',
'w_common_plur' =>'are very common words and were ignored.',
'w_short_plur' =>'are too short of words and were ignored.',
's_results' =>'search results',
'previous' =>'Previous',
'next' =>'Next',
'on' =>'on',
'id_start' =>'Site indexing',
'id_end' =>'Indexing complete !',
'id_recent' =>'Was recently indexed',
'num_words' =>'Num words',
'time' =>'time',
'error' =>'Error',
'no_spider' =>'Spider not launched',
'no_site' =>'No such site in database',
'no_temp' =>'No link in temporary table',
'no_toindex' =>'No content indexed',
'double' =>'Duplicate of an existing document',
'spidering' =>'Spidering in progress...',
'links_more' =>'more new links',
'level' =>'level',
'links_found' =>'links found',
'define_ex' =>'Define exclusions',
'index_all' =>'index all',
'end' =>'end',
'no_query' =>'Select predefined keywords (recommended) by opening the tree with the [+] button below, or type descriptive words in the inputzone, separated by a comma, or type the first letters of a keyword and use autocomplete. Empty the inputzone to re-use autocomplete',
'pwait' =>'Please wait',
'statistics' =>'Statistics',
// INSTALL
'slogan' =>'The smallest search engine in the universe : version',
'installation' =>'Installation',
'instructions' =>'Type here the MySql parameters. Specify a valid existing user who can create databases if you choose create or update.',
'hostname' =>'Hostname :',
'port' =>'Port (none = default) :',
'sock' =>'Sock (none = default) :',
'user' =>'User :',
'password' =>'Password :',
'phpdigdatabase' =>'PhpDig database :',
'tablesprefix' =>'Tables prefix :',
'instructions2' =>'* optional. Use lowercase characters, 16 characters max.',
'installdatabase' =>'Install phpdig database',
'error1' =>'Can\'t find connexion template. ',
'error2' =>'Can\'t write connexion template. ',
'error3' =>'Can\'t find init_db.sql file. ',
'error4' =>'Can\'t create tables. ',
'error5' =>'Can\'t find all config database files. ',
'error6' =>'Can\'t create database.<br />Verify user\'s rights. ',
'error7' =>'Can\'t connect to database<br />Verify connection datas. ',
'createdb' =>'Create database',
'createtables' =>'Create tables only',
'updatedb' =>'Update existing database',
'existingdb' =>'Write only connection parameters',
// CLEANUP_ENGINE
'cleaningindex' =>'Cleaning index',
'enginenotok' =>' index references targeted an inexistent keyword.',
'engineok' =>'Engine is coherent.',
// CLEANUP_KEYWORDS
'cleaningdictionnary' =>'Cleaning dictionary',
'keywordsok' =>'All keywords are in one or more page.',
'keywordsnotok' =>' keywords where not in one page at least.',
// CLEANUP_COMMON
'cleanupcommon' =>'Cleanup common words',
'cleanuptotal' =>'Total ',
'cleaned' =>' cleaned.',
'deletedfor' =>' deleted for ',
// INDEX ADMIN
'digthis' =>'Dig this !',
'databasestatus' =>'DataBase status',
'entries' =>' Entries ',
'updateform' =>'Update form',
'deletesite' =>'Delete site',
// SPIDER
'spiderresults' =>'Spider results',
// STATISTICS
'mostkeywords' =>'Most keywords',
'richestpages' =>'Richest pages',
'mostterms' =>'Most search terms',
'largestresults'=>'Largest results',
'mostempty' =>'Most searchs giving empty results',
'lastqueries' =>'Last search queries',
'lastclicks' =>'Last search clicks',
'responsebyhour'=>'Response time by hour',
// UPDATE
'userpasschanged' =>'User/Password changed !',
'uri' =>'URI : ',
'change' =>'Change',
'root' =>'Root',
'pages' =>' pages',
'locked' => 'Locked',
'unlock' => 'Unlock site',
'onelock' => 'A site is locked, because of spidering. You can\'t do this for now',
// PHPDIG_FORM
'go' =>'Go ...',
// SEARCH_FUNCTION
'noresults' =>'No results'
);
?>

@ -1,7 +1,7 @@
<?php /* <!-- Dokeos phpdig/search.php -->
<!-- 2005/05/02 -->
<!-- 2006/12/14 -->
<!-- Copyright (C) 2005 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
<!-- Copyright (C) 2006 rene.haentjens@UGent.be - see metadata/md_funcs.php -->
--------------------------------------------------------------------------------
PhpDig Version 1.8.6 is provided WITHOUT warranty under the GNU/GPL license.
@ -19,11 +19,11 @@ If you modify code and redistribute, you may ADD your copyright to this notice.
/**
==============================================================================
* Dokeos Metadata: search Dokeos course objects via PhpDig 1.8.6
* Dokeos Metadata: search Dokeos course objects via PhpDig 1.8.6
*
* customized search.php 1.8.6 for Dokeos 1.6 assumes $template == "array"
*
* @package dokeos.metadata
* @package dokeos.metadata
==============================================================================
*/
@ -31,7 +31,7 @@ If you modify code and redistribute, you may ADD your copyright to this notice.
$language_file = "md_mix";
include('../../../main/inc/global.inc.php');
if (! $is_allowed_in_course) api_not_allowed();
// start of part copied (with some changes) from standard PhpDig search.php
$relative_script_path = '.';
$no_connect = 0;
@ -91,18 +91,26 @@ $htmlHeadXtra[] = '<script type="text/javascript" src="../../../main/metadata/md
$htmlHeadXtra[] = '
<script type="text/javascript">
/* <![CDATA[ */
var kwdswere = "' . $kwdswere_string . '";
function mdscSet(s)
{
var mdsc = getObj("mdsc");
if (!mdsc) { alert("? Form does not contain mdsc"); return false; }
function selakw(word)
{
pU_select(word); return false;
}
mdsc.value = s; return true;
}
function checkEnter(ev)
{
if (!ev) ev = window.event;
if (ev.altKey) {alert(document.getElementById("kwds_string").value); return;}
function seladw(word)
if (ev.keyCode == 13)
{
document.getElementById("mdsc").value += "\n" + word;
return false;
document.getElementById("kwdswere_string").value =
document.getElementById("kwds_string").value;
if (prepSearch(ev)) getObj("form_submit").form.submit();
}
}
/* ]]> */
</script>';
@ -112,15 +120,15 @@ echo '<table width="100%"><tr><td><h3>', get_lang('Search'), '</h3></td>',
'<td align="right"><a href="http://www.phpdig.net"><img src="phpdig_powered_2.gif"/></a></td></tr></table>';
// Store new extra criteria (see below), or execute PhpDig Search
// and echo result message, table with results, pages bar
// Store new extra criteria (course manager only, see below), or execute
// PhpDig Search and echo result message + table with results + pages bar
if (!$query_string) $query_string = trim($mdsc);
$ckwcdt = file_exists($ckwc = KEYWORDS_CACHE . 'c') ?
date('Y/m/d H:i:s', filemtime($ckwc)) : '?'; $pkwc = '';
if (strpos($query_string, '>') && api_is_allowed_to_edit())
if (substr($query_string, 0, 2) == '<>' && api_is_allowed_to_edit())
{
if ($ckwcdt{0} != '?')
{
@ -174,7 +182,7 @@ if ($phpdigSearchResults['results']) foreach ($phpdigSearchResults['results'] as
$thumburl = "tpl_img/link.gif";
}
echo '<tr><td><a target="_blank" href="', $url, '"><img src="', $thumburl,
echo '<tr><td align="center"><a target="_blank" href="', $url, '"><img src="', $thumburl,
'"/></a></td><td><a target="_blank" href="', $url, '">', $searchResult['link_title'],
'</a><br>', $searchResult['text'], '</td></tr>', "\n";
}
@ -185,64 +193,72 @@ if ($result_message && ($hits > 10))
echo "Results page ", str_replace('?template_demo=',
'?kwdswere_string=' . urlencode($kwdswere_string), $pages_bar), '<br><br>';
/* Extra criteria: course manager types in the descriptive zone (Advanced):
keyword=k>
-
keyword=k>label
<br/>
descriptive-word=d>label for dword
/* Extra criteria: A course manager can define and edit them in the TEXTAREA.
If he types in something as in the example below, and clicks 'Go', the new
criteria are stored and the old ones are displayed. So it is easy to
restore the old ones. To confirm the new ones, empty the TEXTAREA.
<>This selection empties extra criteria
<searchword>Label
<keyword-kw>Descriptive text
*/
$tdhtm = '';
function tdhtm($xc, $pp, $type = 'k')
function tdhtm($xc)
{
$value = substr($xc, 0, $pp);
if (!($label = trim(substr($xc, $pp + 2 + strlen($type))))) $label = $value;
$eol = '<br/>'; if ($xc{0} == '<') $xc = substr($xc, 1);
if (($eov = strpos($xc, '>')) === FALSE)
$value = $label = $xc;
else
{
$value = substr($xc, 0, $eov); $label = substr($xc, $eov+1);
if (($eot = strpos($label, '<')) !== FALSE)
{
$eol = substr($label, $eot); $label = substr($label, 0, $eot);
}
}
return '<a href="." onClick="return sela' .
$type . 'w(\'' . $value . '\')">' . $label . '</a>';
return '<input type="radio" name="xc" onclick="mdscSet(' . "'" .
htmlspecialchars($value) . "'" . ')">' .
htmlspecialchars($label) . '</input>' . $eol;
}
if ($ckwcdt{0} != '?') // there is a file with extra criteria
{
$fckwc = fopen($ckwc, 'rb');
foreach (explode("\n", fread($fckwc, filesize($ckwc))) as $xc)
$tdhtm .= "\n" . (($pp = strpos($xc, '=k>')) ? tdhtm($xc, $pp) :
(($pp = strpos($xc, '=d>')) ? tdhtm($xc, $pp, 'd') : $xc));
$tdhtm .= "\n" . tdhtm($xc);
fclose($fckwc); unset($fckwc);
}
/* Sample result for the above extra criteria:
<a href="." onClick="return selakw('keyword')">keyword</a> -
<a href="." onClick="return selakw('keyword')">label</a><br/>
<a href="." onClick="return seladw('descriptive-word')">label for dword</a>
*/
// Search criteria form and keywords tree
?>
<div onMouseUp="if ((kw = pU_clicked(event))) pU_select(kw); else pU_hide();">
<input type="text" id="kwds_string" class="kwl" onKeyUp="takeTypeIn(this, 150, -100, '60%'); return true;"/>
<input type="text" id="kwds_string" class="kwl" onKeyUp="takeTypeIn(this, 150, -100, '60%'); checkEnter(event); return true;"/>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<div id="descriptive_words" class="dvc">
<?php echo get_lang('SearchCrit')?>:<br/>
<table><tr>
<td><textarea rows=10 name="mdsc" id="mdsc"><?php echo htmlspecialchars($pkwc) ?></textarea></td>
<td><?php echo $tdhtm ?></td>
</tr></table>
</div>
<input type="hidden" id="kwdswere_string" name="kwdswere_string"/>
<button onClick="document.getElementById('descriptive_words').className='dvo'; this.style.display='none'; return false;"><?php echo get_lang('Advanced') ?></button>
<input type="submit" onClick="document.getElementById('kwdswere_string').value = document.getElementById('kwds_string').value; return prepSearch(event);" value="<?php echo phpdigMsg('go')?>"/>
<table>
<tr>
<td><?php echo $tdhtm, '&nbsp;'; ?>
</td>
<td>
<?php if (api_is_allowed_to_edit())
echo '<textarea name="mdsc" id="mdsc" rows="10" cols="60">', htmlspecialchars($pkwc), '</textarea>';
else echo '<textarea name="mdsc" id="mdsc" class="dvc"> </textarea>';
?>
</td>
<td>
<input type="hidden" id="kwdswere_string" name="kwdswere_string"/>
<input type="submit" id="form_submit" onClick="document.getElementById('kwdswere_string').value = document.getElementById('kwds_string').value; return prepSearch(event);" value="<?php echo phpdigMsg('go')?>"/>
</td>
</tr>
</table>
<div id="popup" noWrap="1" class="pup">
Working...
@ -250,8 +266,12 @@ if ($ckwcdt{0} != '?') // there is a file with extra criteria
</form>
<div>
</div>
<div noWrap="1" id="maindiv">
<?php if ($keywordscache == '') { ?> &#xa0; <?php } else { ?>
<input type="checkbox" id="restricttokwds">Keywords-restrictive search<br>
<input type="button" class="btn" value="+" onClick="if (this.value == '+') deselectAll(event, this); openOrClose(this);"/>
<input type="button" class="btm" id="btnOpenOrCloseAll" value="++" onClick="openOrCloseAll(this);"/>
<input type="button" class="btn" value="?" onClick="openOrCloseHelp(this)"/>

@ -342,7 +342,7 @@ if ($ncrit && is_array($strings)) {
reset($final_result);
$query_for_phrase_array = explode(" ",$query_for_phrase);
$reg_strings = str_replace('@#@',' ',phpdigPregQuotes(str_replace('\\','',implode('@#@',$query_for_phrase_array))));
$stop_regs = "[][(){}[:blank:]=&?!&#%\$*@+%:;,/\.'\"]";
$stop_regs = "[][(){}[:blank:]=&?!&#%\$£*@+%:;,/\.'\"]";
$reg_strings = "($stop_regs{1}|^)($reg_strings)($stop_regs{1}|\$)";
while (list($spider_id,$weight) = each($final_result)) {
$content_file = $relative_script_path.'/'.TEXT_CONTENT_PATH.$spider_id.'.txt';
@ -416,7 +416,7 @@ if ((is_array($final_result)) && (count($final_result) > 0)) {
else {
$reg_strings = str_replace('@#@','|',phpdigPregQuotes(str_replace('\\','',implode('@#@',$strings))));
}
$stop_regs = "[][(){}[:blank:]=&?!&#%\$*@+%:;,/\.'\"]";
$stop_regs = "[][(){}[:blank:]=&?!&#%\$£*@+%:;,/\.'\"]";
switch($option) {
case 'any':

Loading…
Cancel
Save