📄 view.php
字号:
<? } ?><? } /* End of renderinnerresourcedownloadspace hook */ ?></div><? } /* End of renderinnerresourceview hook */ ?></div><? hook("renderbeforeresourcedetails"); ?><div class="Title"><?=$lang["resourcedetails"]?></div><?$extra="";$tabname="";$tabcount=0;$fields=get_resource_field_data($ref);if (count($fields)>0 && $fields[0]["tab_name"]!="") { ?> <div class="TabBar"> <? # Draw tabs. $extra=""; $tabname=""; $tabcount=0; for ($n=0;$n<count($fields);$n++) { $value=$fields[$n]["value"]; # draw new tab? if (($tabname!=$fields[$n]["tab_name"]) && ($value!="") && ($value!=",") && ($fields[$n]["display_field"]==1)) { ?><div id="tabswitch<?=$tabcount?>" class="Tab<? if ($tabcount==0) { ?> TabSelected<? } ?>"><a href="#" onclick="SelectTab(<?=$tabcount?>);return false;"><?=$fields[$n]["tab_name"]?></a></div><? $tabcount++; $tabname=$fields[$n]["tab_name"]; } } ?> </div> <script language="Javascript"> function SelectTab(tab) { // Deselect all tabs <? for ($n=0;$n<$tabcount;$n++) { ?> document.getElementById("tab<?=$n?>").style.display="none"; document.getElementById("tabswitch<?=$n?>").className="Tab"; <? } ?> document.getElementById("tab" + tab).style.display="block"; document.getElementById("tabswitch" + tab).className="Tab TabSelected"; } </script> <? }?><div id="tab0" class="TabbedPanel<? if ($tabcount>0) { ?> StyledTabbedPanel<? } ?>"><div class="clearerleft"> </div><? # Draw standard fields?><div class="itemNarrow"><h3><?=$lang["resourceid"]?></h3><p><?=$ref?></p></div><div class="itemNarrow"><h3><?=$lang["access"]?></h3><p><?=@$lang["access" . $resource["access"]]?></p></div><?# contributed by field$udata=get_user($resource["created_by"]);if ($udata!==false) { ?> <div class="itemNarrow"><h3><?=$lang["contributedby"]?></h3><p><? if (checkperm("u")) { ?><a href="team_user_edit.php?ref=<?=$udata["ref"]?>"><? } ?><?=$udata["fullname"]?><? if (checkperm("u")) { ?></a><? } ?></p></div> <? }# Show field data$tabname="";$tabcount=0;$fieldcount=0;$extra="";for ($n=0;$n<count($fields);$n++) { $value=$fields[$n]["value"]; # Handle expiry fields if ($fields[$n]["type"]==6 && $value!="" && $value<=date("Y-m-d")) { $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!=",") && ($fields[$n]["display_field"]==1)) { $title=htmlspecialchars(str_replace("Keywords - ","",i18n_get_translated($fields[$n]["title"]))); if ($fields[$n]["type"]==4 || $fields[$n]["type"]==6) {$value=NiceDate($value,false,true);} # Value formatting $value=i18n_get_translated($value); if (($fields[$n]["type"]==2) || ($fields[$n]["type"]==30)) {$value=TidyList($value);} $value=highlightkeywords(nl2br(htmlspecialchars($value)),$search); # draw new tab panel? if (($tabname!=$fields[$n]["tab_name"]) && ($fieldcount>0)) { $tabcount++; # Also display the custom formatted data $extra at the bottom of this tab panel. ?><div class="clearerleft"> </div><?=$extra?></div><div class="TabbedPanel StyledTabbedPanel" style="display:none;" id="tab<?=$tabcount?>"><? $extra=""; } $tabname=$fields[$n]["tab_name"]; $fieldcount++; if (trim($fields[$n]["display_template"])!="") { # Process the value using a plugin $plugin="plugins/value_filter_" . $fields[$n]["name"] . ".php"; if (file_exists($plugin)) {include $plugin;} # Use a display template to render this field $template=$fields[$n]["display_template"]; $template=str_replace("[title]",$title,$template); $template=str_replace("[value]",$value,$template); $template=str_replace("[ref]",$ref,$template); $extra.=$template; } else { # Draw this field normally. ?> <div class="itemNarrow"><h3><?=$title?></h3><p><?=$value?></p></div> <? } } }?><div class="clearerleft"> </div><?=$extra?></div><!-- end of tabbed panel--></div></div><div class="PanelShadow"></div></div><?# -------- Related Resources (must be able to search for this to work)if (checkperm("s")) {$result=do_search("!related" . $ref);if (count($result)>0) { ?><!--Panel for related resources--><div class="RecordBox"><div class="RecordPanel"> <div class="RecordResouce"><div class="Title"><?=$lang["relatedresources"]?></div><? # loop and display the results for ($n=0;$n<count($result);$n++) { $rref=$result[$n]["ref"]; ?> <!--Resource Panel--> <div class="CollectionPanelShell"> <table border="0" class="CollectionResourceAlign"><tr><td> <a target="main" href="view.php?ref=<?=$rref?>&search=<?=urlencode("!related" . $ref)?>"><? if ($result[$n]["has_image"]==1) { ?><img border=0 src="<?=get_resource_path($rref,"col",false,$result[$n]["preview_extension"],-1,1,checkperm("w"))?>" class="CollectImageBorder"/><? } else { ?><img border=0 width=56 height=75 src="gfx/type<?=$result[$n]["resource_type"]?>_col.gif"/><? } ?></a></td> </tr></table> <div class="CollectionPanelInfo"><a target="main" href="view.php?ref=<?=$rref?>"><?=tidy_trim($result[$n]["title"],25)?></a> </div> </div> <? } ?> <div class="clearerleft"> </div> <a href="search.php?search=<?=urlencode("!related" . $ref) ?>"><?=$lang["clicktoviewasresultset"]?></a> </div> </div> <div class="PanelShadow"></div> </div><? }if ($show_related_themes==true){# -------- Public Collections / Themes$result=get_themes_by_resource($ref);if (count($result)>0) { ?><!--Panel for related themes / collections --> <div class="RecordBox"> <div class="RecordPanel"> <div class="RecordResouce BasicsBox"> <div class="Title"><?=$lang["collectionsthemes"]?></div> <div class="VerticalNav"> <ul> <? # loop and display the results for ($n=0;$n<count($result);$n++) { ?> <li><a href="search.php?search=!collection<?=$result[$n]["ref"]?>"><?=(strlen($result[$n]["theme"])>0)?htmlspecialchars($result[$n]["theme"] . " / "):$lang["public"] . " : " . htmlspecialchars($result[$n]["fullname"] . " / ")?><?=htmlspecialchars($result[$n]["name"])?></a></li> <? } ?> </ul> </div> </div> </div> <div class="PanelShadow"></div> </div><? }} ?><!--Panel for search for similar resources--><div class="RecordBox"><div class="RecordPanel"> <div class="RecordResouce"><div class="Title"><?=$lang["searchforsimilarresources"]?></div><? if ($resource["has_image"]==1) { ?><!--<p>Find resources with a <a href="search.php?search=<?=urlencode("!rgb:" . $resource["image_red"] . "," . $resource["image_green"] . "," . $resource["image_blue"])?>">similar colour theme</a>.</p><p>Find resources with a <a href="search.php?search=<?=urlencode("!colourkey" . $resource["colour_key"]) ?>">similar colour theme (2)</a>.</p>--><? } ?><script language="Javascript">function UpdateResultCount() { // set the target of the form to be the result count iframe and submit document.getElementById("findsimilar").target="resultcount"; document.getElementById("countonly").value="yes"; document.getElementById("findsimilar").submit(); document.getElementById("findsimilar").target=""; document.getElementById("countonly").value=""; }</script><form method="post" action="find_similar.php" id="findsimilar"><input type="hidden" name="resource_type" value="<?=$resource["resource_type"]?>"><input type="hidden" name="countonly" id="countonly" value=""><?$keywords=get_resource_top_keywords($ref,30);$searchwords=split_keywords($search);for ($n=0;$n<count($keywords);$n++) { ?> <div class="SearchSimilar"><input type=checkbox name="keyword_<?=urlencode($keywords[$n])?>" value="yes" <? if (in_array($keywords[$n],$searchwords)) {?>checked<?}?> onClick="UpdateResultCount();"> <?=$keywords[$n]?></div> <? }?><div class="clearerleft"> </div><br /><input name="search" type="submit" value=" <?=$lang["search"]?> " id="dosearch"/><iframe frameborder=0 scrolling=no width=1 height=1 style="visibility:hidden;" name="resultcount" id="resultcount"></iframe></form><div class="clearerleft"> </div></div></div><div class="PanelShadow"></div></div><? } # end of block that requires search permissions?><?include "include/footer.php";?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -