echo $url; ?> " onClick="return CentralSpaceLoad(this,true);" <?php if (!$infobox) { ?> title="<?php echo str_replace(array("\"", "'"), "", htmlspecialchars(i18n_get_translated($value))); ?> "<?php } //end if infobox ?> ><?php } //end link echo highlightkeywords(tidy_trim(TidyList(i18n_get_translated($value)), 28), $search, $df[$x]['partial_index'], $df[$x]['name'], $df[$x]['indexed']); if ($x == 0) { // add link if necessary ?> </a><?php } //end link ?> </div><div class="clearer"></div> <?php } } ?> <?php } ?>
function display_field_data($field, $valueonly = false, $fixedwidth = 452) { global $ref, $fieldcount, $tabcount, $show_expiry_warning, $access, $tabname, $search, $extra, $lang, $used_tab_names, $related_type_show_with_data, $show_default_related_resources; $value = $field["value"]; $modified_field = hook("beforeviewdisplayfielddata_processing", "", array($field)); if ($modified_field) { $field = $modified_field; } # Handle expiry fields if (!$valueonly && $field["type"] == 6 && $value != "" && $value <= date("Y-m-d H:i") && $show_expiry_warning) { $extra .= "<div class=\"RecordStory\"> <h1>" . $lang["warningexpired"] . "</h1><p>" . $lang["warningexpiredtext"] . "</p><p id=\"WarningOK\"><a href=\"#\" onClick=\"document.getElementById('RecordDownload').style.display='block';document.getElementById('WarningOK').style.display='none';\">" . $lang["warningexpiredok"] . "</a></p></div><style>#RecordDownload {display:none;}</style>"; } if ($value != "" && $value != "," && $field["display_field"] == 1 && ($access == 0 || $access == 1 && !$field["hide_when_restricted"])) { if (!$valueonly) { $title = htmlspecialchars(str_replace("Keywords - ", "", $field["title"])); } else { $title = ""; } //if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);} # Value formatting if ($field["type"] == 2 || $field["type"] == 7 || $field["type"] == 9) { $i18n_split_keywords = true; } else { $i18n_split_keywords = false; } $value = i18n_get_translated($value, $i18n_split_keywords); if ($field["type"] == 2 || $field["type"] == 3 || $field["type"] == 7 || $field["type"] == 9) { $value = TidyList($value); } $value_unformatted = $value; # store unformatted value for replacement also if ($field["type"] != 8 || $field["type"] == 8 && $value == strip_tags($value)) { $value = nl2br(htmlspecialchars($value)); } $modified_value = hook('display_field_modified_value', '', array($field)); if ($modified_value) { $value = $modified_value['value']; } # draw new tab panel? if (!$valueonly && $tabname != $field["tab_name"] && $fieldcount > 0) { $resource_type_tab_names = sql_array('SELECT tab_name as value FROM resource_type', ''); $resource_type_tab_names = array_filter($resource_type_tab_names); # Display related resources on this tab, if set: if (isset($related_type_show_with_data)) { # NOTE: the resource type tab name and the current tab you are on need to be the same: if (in_array($tabname, $resource_type_tab_names)) { if (($key = array_search($tabname, $resource_type_tab_names)) !== false) { # Fields with display template should be rendered before the related resources list: echo $extra; $extra = ''; include '../include/related_resources.php'; unset($resource_type_tab_names[$key]); $show_default_related_resources = FALSE; } } } $tabcount++; # Also display the custom formatted data $extra at the bottom of this tab panel. ?> <div class="clearerleft"> </div><?php echo $extra; ?> </div></div><div class="TabbedPanel StyledTabbedPanel" style="display:none;" id="tab<?php echo $tabcount; ?> "><div><?php $extra = ""; } $tabname = $field["tab_name"]; $used_tab_names[] = $tabname; $used_tab_names = array_unique($used_tab_names); $fieldcount++; if (!$valueonly && trim($field["display_template"]) != "") { # Process the value using a plugin $plugin = "../plugins/value_filter_" . $field["name"] . ".php"; if ($field['value_filter'] != "") { eval($field['value_filter']); } else { if (file_exists($plugin)) { include $plugin; } else { if ($field["type"] == 4 || $field["type"] == 6) { $value = NiceDate($value, false, true); } } } # Highlight keywords $value = highlightkeywords($value, $search, $field["partial_index"], $field["name"], $field["keywords_index"]); # Use a display template to render this field $template = $field["display_template"]; $template = str_replace("[title]", $title, $template); $template = str_replace("[value]", $value, $template); $template = str_replace("[value_unformatted]", $value_unformatted, $template); $template = str_replace("[ref]", $ref, $template); $extra .= $template; } else { #There is a value in this field, but we also need to check again for a current-language value after the i18n_get_translated() function was called, to avoid drawing empty fields if ($value != "") { # Draw this field normally. # value filter plugin should be used regardless of whether a display template is used. $plugin = "../plugins/value_filter_" . $field["name"] . ".php"; if ($field['value_filter'] != "") { eval($field['value_filter']); } else { if (file_exists($plugin)) { include $plugin; } else { if ($field["type"] == 4 || $field["type"] == 6) { $value = NiceDate($value, false, true); } } } # Highlight keywords $value = highlightkeywords($value, $search, $field["partial_index"], $field["name"], $field["keywords_index"]); ?> <div <?php if (!$valueonly) { echo "class=\"itemNarrow\""; } elseif (isset($fixedwidth)) { echo "style=\"width:" . $fixedwidth . "px\""; } ?> > <h3><?php echo $title; ?> </h3><p><?php echo $value; ?> </p></div><?php } } } }
$collection_tag = $lang['collection']; } else { $collection_prefix = ""; # The prefix $lang['smartcollection'] . ": " is added in i18n_get_collection_name() $collection_tag = $lang['smartcollection']; } if (!hook("replacelistviewcolresults")) { ?> <td nowrap><div class="ListTitle"><a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $pub_url; ?> " title="<?php echo str_replace(array("\"", "'"), "", $collection_prefix . i18n_get_collection_name($collections[$n])); ?> "><?php echo $collection_prefix . highlightkeywords(tidy_trim(i18n_get_collection_name($collections[$n]), 45), $search); ?> </a></div></td> <?php for ($x = 0; $x < count($df) - 1; $x++) { ?> <td>-</td><?php } ?> <td>-</td> <?php if ($display_user_rating_stars && $k == "") { ?> <td> </td><?php } ?>
<?php hook("beforecollectiontoolscolumnheader");?> <td class="tools"><div class="ListTools"><?php echo $lang["tools"]?></div></td> </tr> <form method="get" name="colactions" id="colactions" action="<?php echo $baseurl_short?>pages/collection_manage.php"> <?php for ($n=$offset;(($n<count($collections)) && ($n<($offset+$per_page)));$n++) { $colusername=$collections[$n]['fullname']; ?><tr <?php hook("collectionlistrowstyle");?>> <td class="name"><div class="ListTitle"> <a <?php if ($collections[$n]["public"]==1 && (strlen($collections[$n]["theme"])>0)) { ?>style="font-style:italic;"<?php } ?> href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this);"><?php echo highlightkeywords(i18n_get_collection_name($collections[$n]),$find) ?></a></div></td> <td class="fullname"><?php echo highlightkeywords($colusername,$find) ?></td> <td class="ref"><?php echo highlightkeywords($collection_prefix . $collections[$n]["ref"],$find) ?></td> <td class="created"><?php echo nicedate($collections[$n]["created"],true) ?></td> <td class="count"><?php echo $collections[$n]["count"] ?></td> <?php if (! $hide_access_column){ ?> <td class="access"><?php # Work out the correct access mode to display if (!hook('collectionaccessmode')) { if ($collections[$n]["public"]==0){ echo $lang["private"]; } else{ if (strlen($collections[$n]["theme"])>0){ echo $lang["theme"]; } else{ echo $lang["public"]; }
<td><?php echo $lang["date"]?></td> <td><?php echo $lang["news_headline"]?></td> <td><?php echo $lang["news_body"]?></td> <td><div class="ListTools"><?php echo $lang["tools"]?></div></td> </tr> <?php for ($n=$offset;(($n<count($news)) && ($n<($offset+$per_page)));$n++) { ?> <tr> <td><div class="ListTitle"><?php echo highlightkeywords($news[$n]["date"],$findtext,true);?></div></td> <td><div class="ListTitle"><?php echo "<a href=\"" . $baseurl . "/plugins/news/pages/news.php?ref=" . $news[$n]["ref"] . "\">" . highlightkeywords($news[$n]["title"],$findtext,true);?></a></div></td> <td><?php echo highlightkeywords(tidy_trim(htmlspecialchars($news[$n]["body"]),100),$findtext,true)?></td> <td> <div class="ListTools"> <a href="news_content_edit.php?ref=<?php echo $news[$n]["ref"]?>&backurl=<?php echo urlencode($url . "&offset=" . $offset . "&findtext=" . $findtext)?>">> <?php echo $lang["action-edit"]?> </a> <a href="#" onclick="if (confirm('<?php echo $lang["confirm-deletion"]?>')) {document.getElementById('newsdelete').value='<?php echo $news[$n]["ref"]?>';document.getElementById('newsform').submit();} return false;">> <?php echo $lang["action-delete"]?></a> </div> </td> </tr> <?php } ?> </table> </div> <div class="BottomInpageNav"><?php pager(true); ?></div>
?> <?php // extended css behavior if ( in_array($df[$x]['ref'],$thumbs_display_extended_fields) && ( (isset($metadata_template_title_field) && $df[$x]['ref']!=$metadata_template_title_field) || !isset($metadata_template_title_field) ) ){ ?> <?php if (!hook("replaceresourcepanelinfo")){?> <div class="ResourcePanelInfo"><div class="extended"> <?php if ($x==0){ // add link if necessary ?><a href="<?php echo $url?>" onClick="return CentralSpaceLoad(this,true);" <?php if (!$infobox) { ?>title="<?php echo str_replace(array("\"","'"),"",htmlspecialchars(i18n_get_translated($value)))?>"<?php } //end if infobox ?>><?php } //end link echo format_display_field($value); ?><?php if ($show_extension_in_search) { ?><?php echo " " . str_replace_formatted_placeholder("%extension", $result[$n]["file_extension"], $lang["fileextension-inside-brackets"])?><?php } ?><?php if ($x==0){ // add link if necessary ?></a><?php } //end link?> </div></div> <?php } /* end hook replaceresourcepanelinfo */?> <?php // normal behavior } else if ( (isset($metadata_template_title_field)&&$df[$x]['ref']!=$metadata_template_title_field) || !isset($metadata_template_title_field) ) {?> <div class="ResourcePanelInfo"><?php if ($x==0){ // add link if necessary ?><a href="<?php echo $url?>" onClick="return CentralSpaceLoad(this,true);" <?php if (!$infobox) { ?>title="<?php echo str_replace(array("\"","'"),"",htmlspecialchars(i18n_get_translated($value)))?>"<?php } //end if infobox ?>><?php } //end link?><?php echo highlightkeywords(tidy_trim(TidyList(i18n_get_translated($value)),$search_results_title_trim),$search,$df[$x]['partial_index'],$df[$x]['name'],$df[$x]['indexed'])?><?php if ($x==0){ // add link if necessary ?></a><?php } //end link?> </div><div class="clearer"></div> <?php } ?> <?php } ?> <!-- Checkboxes --> <div class="ResourcePanelIcons"> <?php if(!hook("thumbscheckboxes")){?> <?php if ($use_checkboxes_for_selection){?><input type="checkbox" id="check<?php echo htmlspecialchars($ref)?>" class="checkselect" <?php if (in_array($ref,$collectionresources)){ ?>checked<?php } ?> onclick="if (jQuery('#check<?php echo htmlspecialchars($ref)?>').attr('checked')=='checked'){ AddResourceToCollection(<?php echo htmlspecialchars($ref)?>); } else if (jQuery('#check<?php echo htmlspecialchars($ref)?>').attr('checked')!='checked'){ RemoveResourceFromCollection(<?php echo htmlspecialchars($ref)?>); }"> <?php } ?> <?php } # end hook thumbscheckboxes?> <?php if ($display_resource_id_in_thumbnail && $ref>0) { echo htmlspecialchars($ref); } else { ?> <?php } ?> </div> <?php if (!hook("replaceresourcetools")){?>
function display_field_data($field, $valueonly = false, $fixedwidth = 452) { global $ref, $fieldcount, $tabcount, $show_expiry_warning, $access, $tabname, $search, $extra, $lang; $value = $field["value"]; # Handle expiry fields if (!$valueonly && $field["type"] == 6 && $value != "" && $value <= date("Y-m-d H:i") && $show_expiry_warning) { $extra .= "<div class=\"RecordStory\"> <h1>" . $lang["warningexpired"] . "</h1><p>" . $lang["warningexpiredtext"] . "</p><p id=\"WarningOK\"><a href=\"#\" onClick=\"document.getElementById('RecordDownload').style.display='block';document.getElementById('WarningOK').style.display='none';\">" . $lang["warningexpiredok"] . "</a></p></div><style>#RecordDownload {display:none;}</style>"; } if ($value != "" && $value != "," && $field["display_field"] == 1 && ($access == 0 || $access == 1 && !$field["hide_when_restricted"])) { if (!$valueonly) { $title = htmlspecialchars(str_replace("Keywords - ", "", $field["title"])); } else { $title = ""; } //if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);} # Value formatting if ($field["type"] == 2 || $field["type"] == 7 || $field["type"] == 9) { $i18n_split_keywords = true; } else { $i18n_split_keywords = false; } $value = i18n_get_translated($value, $i18n_split_keywords); if ($field["type"] == 2 || $field["type"] == 3 || $field["type"] == 7 || $field["type"] == 9) { $value = TidyList($value); } $value_unformatted = $value; # store unformatted value for replacement also if ($field["type"] != 8) { $value = nl2br(htmlspecialchars($value)); } # draw new tab panel? if (!$valueonly && $tabname != $field["tab_name"] && $fieldcount > 0) { $tabcount++; # Also display the custom formatted data $extra at the bottom of this tab panel. ?> <div class="clearerleft"> </div><?php echo $extra; ?> </div></div><div class="TabbedPanel StyledTabbedPanel" style="display:none;" id="tab<?php echo $tabcount; ?> "><div><?php $extra = ""; } $tabname = $field["tab_name"]; $fieldcount++; if (!$valueonly && trim($field["display_template"]) != "") { # Process the value using a plugin $plugin = "../plugins/value_filter_" . $field["name"] . ".php"; if ($field['value_filter'] != "") { eval($field['value_filter']); } else { if (file_exists($plugin)) { include $plugin; } else { if ($field["type"] == 4 || $field["type"] == 6) { $value = NiceDate($value, false, true); } } } # Highlight keywords $value = highlightkeywords($value, $search, $field["partial_index"], $field["name"], $field["keywords_index"]); # Use a display template to render this field $template = $field["display_template"]; $template = str_replace("[title]", $title, $template); $template = str_replace("[value]", $value, $template); $template = str_replace("[value_unformatted]", $value_unformatted, $template); $template = str_replace("[ref]", $ref, $template); $extra .= $template; } else { #There is a value in this field, but we also need to check again for a current-language value after the i18n_get_translated() function was called, to avoid drawing empty fields if ($value != "") { # Draw this field normally. # value filter plugin should be used regardless of whether a display template is used. $plugin = "../plugins/value_filter_" . $field["name"] . ".php"; if ($field['value_filter'] != "") { eval($field['value_filter']); } else { if (file_exists($plugin)) { include $plugin; } else { if ($field["type"] == 4 || $field["type"] == 6) { $value = NiceDate($value, false, true); } } } # Highlight keywords $value = highlightkeywords($value, $search, $field["partial_index"], $field["name"], $field["keywords_index"]); ?> <div <?php if (!$valueonly) { echo "class=\"itemNarrow\""; } elseif (isset($fixedwidth)) { echo "style=\"width:" . $fixedwidth . "px\""; } ?> > <h3><?php echo $title; ?> </h3><p><?php echo $value; ?> </p></div><?php } } } }
{ ?> <tr <?php hook("collectionlistrowstyle");?>> <?php hook ("listsearchpubliccheckboxes"); if ($use_checkboxes_for_selection){echo "<td></td>";} if (!isset($collections[$n]['savedsearch'])||(isset($collections[$n]['savedsearch'])&&$collections[$n]['savedsearch']==null)) { $collection_prefix = $lang["collection"] . ": "; $collection_tag = $lang['collection']; } else { $collection_prefix = ""; # The prefix $lang['smartcollection'] . ": " is added in i18n_get_collection_name() $collection_tag = $lang['smartcollection']; }?> <td nowrap><div class="ListTitle"><a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $pub_url?>" title="<?php echo str_replace(array("\"","'"),"", $collection_prefix . i18n_get_collection_name($collections[$n]))?>"><?php echo $collection_prefix . highlightkeywords(tidy_trim(i18n_get_collection_name($collections[$n]),45),$search)?></a></div></td> <?php for ($x=0;$x<count($df)-1;$x++){ ?><td>-</td><?php } ?> <td>-</td> <?php if ($display_user_rating_stars && $k==""){ ?><td> </td><?php } ?> <?php if ($id_column){?><td><?php echo $collections[$n]['ref']?></td><?php } ?> <?php if ($resource_type_column){?><td><?php echo $collection_tag?></td><?php } ?> <?php if ($date_column){?><td><?php echo nicedate($collections[$n]["created"],false,true)?></td><?php } ?> <?php hook("addlistviewcolumnpublic");?> <td><div class="ListTools"> <?php if (!hook("replacecollectiontools")){?> <a href="<?php echo $baseurl_short?>pages/collections.php?collection=<?php echo $collections[$n]["ref"]?>" onClick="return CollectionDivLoad(this);">> <?php echo $lang["action-select"]?></a> <a onClick="return CentralSpaceLoad(this,true);" href="<?php echo $pub_url?>">> <?php echo $lang["viewall"]?></a>
?> style="font-style:italic;"<?php } ?> href="<?php echo $baseurl_short; ?> pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"]); ?> " onClick="return CentralSpaceLoad(this);"><?php echo highlightkeywords(i18n_get_collection_name($collections[$n]), $find); ?> </a></div></td> <td><?php echo highlightkeywords($collection_prefix . $collections[$n]["ref"], $find); ?> </td> <td><?php echo nicedate($collections[$n]["created"], true); ?> </td> <td><?php echo $collections[$n]["count"]; ?> </td> <?php hook("beforecollectiontoolscolumn"); ?> <td>
echo $text[$n]["name"]; ?> &findpage=<?php echo $findpage; ?> &findname=<?php echo $findname; ?> &findtext=<?php echo $findtext; ?> &offset=<?php echo $offset; ?> " onClick="return CentralSpaceLoad(this,true);"><?php echo highlightkeywords(tidy_trim(htmlspecialchars($text[$n]["text"]), 100), $findtext, true); ?> </a></td> <td><div class="ListTools"><a href="<?php echo $baseurl_short; ?> pages/team/team_content_edit.php?page=<?php echo $text[$n]["page"]; ?> &name=<?php echo $text[$n]["name"]; ?> &findpage=<?php echo $findpage; ?>
function display_field_data($field,$valueonly=false,$fixedwidth=452) { global $ref, $show_expiry_warning, $access, $search, $extra, $lang; $value=$field["value"]; $modified_field=hook("beforeviewdisplayfielddata_processing","",array($field)); if($modified_field){ $field=$modified_field; } # Handle expiry fields if (!$valueonly && $field["type"]==6 && $value!="" && $value<=date("Y-m-d H:i") && $show_expiry_warning) { $extra.="<div class=\"RecordStory\"> <h1>" . $lang["warningexpired"] . "</h1><p>" . $lang["warningexpiredtext"] . "</p><p id=\"WarningOK\"><a href=\"#\" onClick=\"document.getElementById('RecordDownload').style.display='block';document.getElementById('WarningOK').style.display='none';\">" . $lang["warningexpiredok"] . "</a></p></div><style>#RecordDownload {display:none;}</style>"; } if (($value!="") && ($value!=",") && ($field["display_field"]==1) && ($access==0 || ($access==1 && !$field["hide_when_restricted"]))) { if (!$valueonly) {$title=htmlspecialchars(str_replace("Keywords - ","",$field["title"]));} else {$title="";} //if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);} # Value formatting if (($field["type"]==2) || ($field["type"]==7) || ($field["type"]==9)) {$i18n_split_keywords =true;} else {$i18n_split_keywords =false;} $value=i18n_get_translated($value,$i18n_split_keywords ); if (($field["type"]==2) || ($field["type"]==3) || ($field["type"]==7) || ($field["type"]==9)) {$value=TidyList($value);} // Don't display the comma for radio buttons: if($field['type'] == 12) { $value = str_replace(',', '', $value); } $value_unformatted=$value; # store unformatted value for replacement also if ($field["type"]!=8 || ($field["type"]==8 && $value == strip_tags($value))) # Do not convert HTML formatted fields (that are already HTML) to HTML. Added check for extracted fields set to ckeditor that have not yet been edited. { $value=nl2br(htmlspecialchars($value)); } $modified_value = hook('display_field_modified_value', '', array($field)); if($modified_value) { $value = $modified_value['value']; } if (!$valueonly && trim($field["display_template"])!="") { # Process the value using a plugin $plugin="../plugins/value_filter_" . $field["name"] . ".php"; if ($field['value_filter']!=""){ eval($field['value_filter']); } else if (file_exists($plugin)) {include $plugin;} else if ($field["type"]==4 && strpos($value,":")!=false){$value=NiceDate($value,true,true);} // Show the time as well as date if entered else if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);} # Highlight keywords $value=highlightkeywords($value,$search,$field["partial_index"],$field["name"],$field["keywords_index"]); $value_mod_after_highlight=hook('value_mod_after_highlight', '', array($field,$value)); if($value_mod_after_highlight){ $value=$value_mod_after_highlight; } # Use a display template to render this field $template=$field["display_template"]; $template=str_replace("[title]",$title,$template); $template=str_replace("[value]",$value,$template); $template=str_replace("[value_unformatted]",$value_unformatted,$template); $template=str_replace("[ref]",$ref,$template); $extra.=$template; } else { #There is a value in this field, but we also need to check again for a current-language value after the i18n_get_translated() function was called, to avoid drawing empty fields if ($value!=""){ # Draw this field normally. # value filter plugin should be used regardless of whether a display template is used. $plugin="../plugins/value_filter_" . $field["name"] . ".php"; if ($field['value_filter']!=""){ eval($field['value_filter']); } else if (file_exists($plugin)) {include $plugin;} else if ($field["type"]==4 && strpos($value,":")!=false){$value=NiceDate($value,true,true);} // Show the time as well as date if entered else if ($field["type"]==4 || $field["type"]==6) {$value=NiceDate($value,false,true);} # Highlight keywords $value=highlightkeywords($value,$search,$field["partial_index"],$field["name"],$field["keywords_index"]); $value_mod_after_highlight=hook('value_mod_after_highlight', '', array($field,$value)); if($value_mod_after_highlight){ $value=$value_mod_after_highlight; } ?><div <?php if (!$valueonly){echo "class=\"itemNarrow\""; } elseif (isset($fixedwidth)) {echo "style=\"width:" . $fixedwidth . "px\""; } ?>> <h3><?php echo $title?></h3><p><?php echo $value?></p></div><?php } } } }
function format_display_field($value){ // applies trim/wordwrap/highlights global $results_title_trim,$results_title_wordwrap,$df,$x,$search; $string=i18n_get_translated($value); $string=TidyList($string); $string=tidy_trim($string,$results_title_trim); $wordbreaktag="<wbr>"; // $wordbreaktag="​" I'm having slightly better luck with <wbr>, but this pends more testing. // Opera doesn't renders the zero-width space with a small box. $extra_word_separators=array("_"); // only underscore is necessary (regex considers underscores not to separate words, // but we want them to); I've based these transformations on an array just in case more characters act this way. $ews_replace=array(); foreach($extra_word_separators as $extra_word_separator){ $ews_replace[]="{".$extra_word_separator." }"; } //print_r($config_separators_replace); $string=str_replace($extra_word_separators,$ews_replace,$string); $string=wordwrap($string,$results_title_wordwrap,"#zwspace",false); $string=str_replace($ews_replace,$extra_word_separators,$string); $string=htmlspecialchars($string); $string=highlightkeywords($string,$search,$df[$x]['partial_index'],$df[$x]['name'],$df[$x]['indexed']); $ews_replace2=array(); foreach($extra_word_separators as $extra_word_separator){ $ews_replace2[]="{".$extra_word_separator."#zwspace}"; } $ews_replace3=array(); foreach($extra_word_separators as $extra_word_separator){ $ews_replace3[]=$wordbreaktag.$extra_word_separator; } $string=str_replace($ews_replace2,$ews_replace3,$string); $string=str_replace("#zwspace",$wordbreaktag." ",$string); return $string; }
if ($value!=""){ # Draw this field normally. # value filter plugin should be used regardless of whether a display template is used. $plugin="../plugins/value_filter_" . $fields[$n]["name"] . ".php"; if ($fields[$n]['value_filter']!=""){ eval($fields[$n]['value_filter']); } else if (file_exists($plugin)) {include $plugin;} else if ($fields[$n]["type"]==4 || $fields[$n]["type"]==6) { $value=NiceDate($value,false,true); } # Highlight keywords $value=highlightkeywords($value,$search,$fields[$n]["partial_index"],$fields[$n]["name"],$fields[$n]["keywords_index"]); ?><div class="itemNarrow"><h3><?php echo $title?></h3><p><?php echo $value?></p></div><?php } } } } } } ?><?php hook("extrafields2");?><div class="clearerleft"></div> <?php echo $extra?> </div> </div> <?php hook("renderafterresourcedetails"); ?> <!-- end of tabbed panel--> </div></div> <div class="PanelShadow"></div>
<?php } if ($display == "list") { ?> <tr <?php hook("collectionlistrowstyle"); ?> > <?php hook("listsearchpubliccheckboxes"); ?> <td nowrap><div class="ListTitle"><a href="<?php echo $pub_url; ?> "><?php echo $lang["collection"] . ": " . highlightkeywords(tidy_trim(i18n_get_translated($collections[$n]["name"]), 45), $search); ?> </a></div></td> <?php for ($x = 0; $x < count($df) - 1; $x++) { ?> <td>-</td><?php } ?> <td>-</td> <?php if ($display_user_rating_stars && $k == "") { ?> <td> </td><?php } ?>
href="<?php echo $baseurl_short; ?> pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"]); ?> " onClick="return CentralSpaceLoad(this);"><?php echo highlightkeywords(i18n_get_collection_name($collections[$n]), $find); ?> </a></div></td> <td><?php echo htmlspecialchars(highlightkeywords($colusername, $find)); ?> </td> <td><?php echo htmlspecialchars(highlightkeywords($collection_prefix . $collections[$n]["ref"], $find)); ?> </td> <td><?php echo htmlspecialchars(nicedate($collections[$n]["created"], true)); ?> </td> <td><?php echo htmlspecialchars($collections[$n]["count"]); ?> </td> <?php if (!$hide_access_column) { ?> <td><?php # Work out the correct access mode to display
<?php if (!$hide_access_column_public){ ?><td><?php if ($col_order_by=="public") {?><span class="Selected"><?php } ?><a href="<?php echo $baseurl_short?>pages/collection_public.php?offset=0&col_order_by=public&sort=<?php echo urlencode($revsort)?>&find=<?php echo urlencode($find)?>" onClick="return CentralSpaceLoad(this);"><?php echo $lang["access"]?></a><?php if ($col_order_by=="public") {?><div class="<?php echo urlencode($sort)?>"> </div><?php } ?></td><?php } ?> <?php hook("beforecollectiontoolscolumnheader");?> <td><div class="ListTools"><?php echo $lang["tools"]?></div></td> </tr> <?php for ($n=$offset;(($n<count($collections)) && ($n<($offset+$per_page)));$n++) { ?> <tr <?php hook("collectionlistrowstyle");?>> <td><div class="ListTitle"> <a href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this,true);"><?php echo highlightkeywords(i18n_get_collection_name($collections[$n]),$find)?></a></div></td> <?php if (!$collection_public_hide_owner) { ?><td><?php echo highlightkeywords($collections[$n]["fullname"],$find)?></td><?php } ?> <td><?php echo highlightkeywords($collections[$n]["ref"],$find)?></td> <td><?php echo nicedate($collections[$n]["created"],true)?></td> <td><?php echo $collections[$n]["count"]?></td> <?php if (!$hide_access_column_public){ ?><td><?php echo ($collections[$n]["public"]==0)?$lang["private"]:$lang["public"]?></td><?php } ?> <?php hook("beforecollectiontoolscolumn");?> <td><div class="ListTools"> <?php if ($collections_compact_style){ draw_compact_style_selector($collections[$n]["ref"]); } else { ?><a href="<?php echo $baseurl_short?>pages/search.php?search=<?php echo urlencode("!collection" . $collections[$n]["ref"])?>" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["viewall"]?></a> <?php if ($contact_sheet==true) { ?> <a href="<?php echo $baseurl_short?>pages/contactsheet_settings.php?ref=<?php echo urlencode($collections[$n]["ref"]) ?>" onClick="return CentralSpaceLoad(this);">> <?php echo $lang["contactsheet"]?></a> <?php } ?> <?php if (!checkperm("b")) { ?> <a href="#" onclick="document.getElementById('collectionadd').value='<?php echo urlencode($collections[$n]["ref"]) ?>';document.getElementById('collectionform').submit(); return false;">> <?php echo $lang["addtomycollections"]?></a><?php } ?> </div></td>
function format_display_field($value) { // applies trim/wordwrap/highlights global $results_title_trim, $results_title_wordwrap, $df, $x, $search; if (isset($df[$x]['type']) && $df[$x]['type'] == 8) { $value = strip_tags($value); } $string = i18n_get_translated($value); $string = TidyList($string); //$string=tidy_trim($string,$results_title_trim); $string = htmlspecialchars($string); $string = highlightkeywords($string, $search, $df[$x]['partial_index'], $df[$x]['name'], $df[$x]['indexed']); return $string; }
for ($x=0;$x<count($df);$x++){ $value=@$result[$n]['field'.$df[$x]['ref']]; $plugin="../plugins/value_filter_" . $df[$x]['name'] . ".php"; if ($df[$x]['value_filter']!=""){ eval($df[$x]['value_filter']); } else if (file_exists($plugin)) {include $plugin;} # swap title fields if necessary if (isset($metadata_template_resource_type) && isset ($metadata_template_title_field)){ if (($df[$x]['ref']==$view_title_field) && ($result[$n]['resource_type']==$metadata_template_resource_type)){ $value=$result[$n]['field'.$metadata_template_title_field]; } } if ( (isset($metadata_template_title_field)&& $df[$x]['ref']!=$metadata_template_title_field ) || !isset($metadata_template_title_field) ) { ?><td nowrap <?php hook("listviewcolumnstyle");?>><?php if ($x==0){ // add link to first item only ?><div class="ListTitle"><a <?php if ($infobox) { ?>onmouseover="InfoBoxSetResource(<?php echo htmlspecialchars($ref)?>);" onmouseout="InfoBoxSetResource(0);"<?php } ?> href="<?php echo $url?>" onClick="return CentralSpaceLoad(this,true);"><?php } //end link conditional?><?php echo highlightkeywords(tidy_trim(TidyList(i18n_get_translated($value)),$results_title_trim),$search,$df[$x]['partial_index'],$df[$x]['name'],$df[$x]['indexed']) ?><?php if ($x==0){ // add link to first item only ?></a><?php } //end link conditional ?></div></td> <?php } } if ($display_user_rating_stars && $k==""){ ?> <td <?php hook("listviewcolumnstyle");?>> <?php if ($result[$n]['user_rating']=="") {$result[$n]['user_rating']=0;}?> <div class="RatingStars" style="text-align:left;margin:0px;" onMouseOut="UserRatingDisplay(<?php echo $result[$n]['ref']?>,<?php echo $result[$n]['user_rating']?>,'StarCurrent');"> <?php for ($z=1;$z<=5;$z++) { ?><a href="#" onMouseOver="UserRatingDisplay(<?php echo $result[$n]['ref']?>,<?php echo $z?>,'StarSelect');" onClick="UserRatingSet(<?php echo $userref?>,<?php echo $result[$n]['ref']?>,<?php echo $z?>);return false;" id="RatingStarLink<?php echo $result[$n]['ref'].'-'.$z?>"><span id="RatingStar<?php echo $result[$n]['ref'].'-'.$z?>" class="Star<?php echo ($z<=$result[$n]['user_rating']?"Current":"Empty")?>"> </span></a><?php } ?> </div></td> <?php } ?>