Example #1
0
function showApproval($result)
{
    $approval = sql_value("SELECT approval_status AS value FROM resource WHERE ref = {$result['ref']}", FALSE);
    $approval_form_id = sql_value("SELECT ref AS value FROM resource_type_field WHERE name = 'approval_form'", FALSE);
    if (!$approval_form_id) {
        return;
    }
    $approval_form = TidyList(get_data_by_field($result['ref'], $approval_form_id));
    if (empty($approval) and strpos($approval_form, 'Yes') !== FALSE) {
        $approval = 'waiting';
    }
    if ($approval) {
        switch ($approval) {
            case 'waiting':
                $title = 'Awaiting Approval';
                break;
            case 'minor':
                $title = 'Minor Changes Needed';
                break;
            case 'major':
                $title = 'Major Changes Needed';
                break;
            case 'approved':
                $title = 'Approved';
                break;
        }
        echo '<span class="rps-approval rps-approval-' . $approval . '" title="' . $title . '"></span>';
    }
}
Example #2
0
function HookApprovalViewRenderbeforeresourcedetails()
{
    global $lang, $ref, $resource, $fields;
    $approval_form_id = sql_value("SELECT ref AS value FROM resource_type_field WHERE name = 'approval_form'", FALSE);
    if (!$approval_form_id) {
        return;
    }
    $approval_form = TidyList(get_data_by_field($ref, $approval_form_id));
    if ($approval_form !== 'Yes') {
        return;
    }
    $history = sql_query('SELECT id, ref, posted, comment, name, signature, status FROM approval WHERE ref = ' . (int) $ref . ' ORDER BY posted DESC');
    ob_start();
    $path = dirname(dirname(__FILE__));
    include $path . '/inc/approval.php';
    echo ob_get_clean();
}
Example #3
0
function HookApprovalResource_emailFooterbottom()
{
    global $ref;
    $approval_form_id = sql_value("SELECT ref AS value FROM resource_type_field WHERE name = 'approval_form'", FALSE);
    if (!$approval_form_id) {
        return;
    }
    $approval_form = TidyList(get_data_by_field($ref, $approval_form_id));
    if ($approval_form !== 'Yes') {
        return;
    }
    $settings = get_plugin_config('approval');
    echo '
		<script type="text/javascript">
			document.getElementById("message").value = "' . htmlspecialchars($settings['email_message']) . '";
		</script>
	';
}
Example #4
0
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;
}
Example #5
0
                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
            ?>
&nbsp;</div><div class="clearer"></div>
			<?php 
        }
    }
    ?>
			<?php 
}
?>
function contact_sheet_add_fields($resourcedata)
{
    global $pdf, $n, $getfields, $sheetstyle, $imagesize, $refnumberfontsize, $leading, $csf, $pageheight, $currentx, $currenty, $topx, $topy, $bottomx, $bottomy, $logospace, $deltay, $width, $config_sheetsingle_include_ref, $contactsheet_header, $cellsize, $ref, $pagewidth;
    //exit (print_r($getfields));
    if ($sheetstyle == "single" && $config_sheetsingle_include_ref == "true") {
        $pdf->SetY($bottomy);
        $pdf->MultiCell($pagewidth - 2, 0, '', '', 'L', false, 1);
        $pdf->ln();
        $pdf->MultiCell($pagewidth - 2, 0, $ref, '', 'L', false, 1);
    }
    for ($ff = 0; $ff < count($getfields); $ff++) {
        $value = "";
        $value = str_replace("'", "\\'", $resourcedata['field' . $getfields[$ff]]);
        $plugin = "../../plugins/value_filter_" . $csf[$ff]['name'] . ".php";
        if ($csf[$ff]['value_filter'] != "") {
            eval($csf[$ff]['value_filter']);
        } else {
            if (file_exists($plugin)) {
                include $plugin;
            }
        }
        $value = TidyList($value);
        if ($sheetstyle == "thumbnails") {
            $pdf->Cell($imagesize, ($refnumberfontsize + $leading) / 72, $value, 0, 2, 'L', 0, '', 1);
            //if ($ff==2){echo print_r($getfields) . " " . $pdf->GetY();exit();}
            $bottomy = $pdf->GetY();
            $bottomx = $pdf->GetX();
        } else {
            if ($sheetstyle == "list") {
                $pdf->SetXY($pdf->GetX() + $imagesize + 0.1, $pdf->GetY());
                $pdf->MultiCell($pagewidth - 3, 0.15, $value, 0, "L");
            } else {
                if ($sheetstyle == "single") {
                    $query = sprintf("SELECT rd.`value`, \n\t\t\t\t\t           rtf.`type` AS field_type\n\t\t\t\t\t      FROM resource_data AS rd\n\t\t\t\t\tINNER JOIN resource_type_field AS rtf ON rd.resource_type_field = rtf.ref AND rtf.ref = '%s'\n\t\t\t\t\t     WHERE rd.resource = '%s';", $getfields[$ff], $resourcedata['ref']);
                    $raw_value = sql_query($query);
                    // Default value:
                    $value = $raw_value[0]['value'];
                    // When values have been saved using CKEditor make sure to remove html tags and decode html entitities:
                    if ($raw_value[0]['field_type'] == '8') {
                        $value = strip_tags($raw_value[0]['value']);
                        $value = mb_convert_encoding($value, 'UTF-8', 'HTML-ENTITIES');
                    }
                    $pdf->MultiCell($pagewidth - 2, 0, $value, '', 'L', false, 1);
                }
            }
        }
    }
}
    ?>
">
	<meta name="target" content="<?php 
    echo $baseurl;
    ?>
/pages/view.php?ref=<?php 
    echo urlencode($ref);
    ?>
">
	<?php 
    $textblock = "";
    for ($n = 0; $n < count($resourcedata); $n++) {
        if ($resourcedata[$n]["keywords_index"] == 1) {
            $value = trim($resourcedata[$n]["value"]);
            if (substr($value, 0, 1) == ",") {
                $value = TidyList($value);
            }
            if ($value != "" && ($resourcedata[$n]["hide_when_restricted"] != 1 || $access == 0)) {
                $textblock .= "<p rs_fieldid=\"" . $resourcedata[$n]["ref"] . "\" rs_fieldname=\"" . $resourcedata[$n]["name"] . "\">" . htmlspecialchars($value) . "</p>\n";
            }
        }
        if ($resourcedata[$n]["name"] == "caption" || $resourcedata[$n]["name"] == "extract") {
            ?>
<meta name="description" content="<?php 
            echo str_replace("\"", "", trim($resourcedata[$n]["value"]));
            ?>
">
			<?php 
        }
        if ($resourcedata[$n]["name"] == "project") {
            ?>
Example #8
0
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 
            }
        }
    }
}
Example #9
0
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 
            }
        }
    }
}
Example #10
0
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
				}
			}
		}
	}
Example #11
0
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="&#8203;" 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;
}
Example #12
0
			$value=$fields[$n]["value"];
			
			# Handle expiry fields
			if ($fields[$n]["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!=",") && ($fields[$n]["display_field"]==1) && ($access==0 || ($access==1 && !$fields[$n]["hide_when_restricted"])))
				{
				$title=htmlspecialchars(str_replace("Keywords - ","",$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"]==3) || ($fields[$n]["type"]==7) || ($fields[$n]["type"]==9)) {$value=TidyList($value);}
				$value_unformatted=$value; # store unformatted value for replacement also

				if ($fields[$n]["type"]!=8) # Do not convert HTML formatted fields (that are already HTML) to HTML.
					{
					$value=nl2br(htmlspecialchars($value));
					}
				
				# 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><?php echo $extra?></div></div><div class="TabbedPanel StyledTabbedPanel" style="display:none;" id="tab<?php echo $tabcount?>"><div><?php	
					$extra="";
					}
        ?>
: <?php 
        echo $ref;
        ?>
</p>
	<?php 
    }
    # Display fields
    for ($n = 0; $n < count($infobox_fields); $n++) {
        $field = $infobox_fields[$n];
        if ((checkperm("f" . $field) || checkperm("f*")) && !checkperm("f-" . $field)) {
            $value = trim(get_data_by_field($ref, $field));
            $type = sql_value("select type value from resource_type_field where ref = {$field}", 0);
            if ($value != "") {
                if ($type != 8) {
                    $value = nl2br(htmlspecialchars(TidyList(i18n_get_translated($value))));
                }
                if ($type == 4) {
                    $value = nicedate($value);
                }
                ?>
			<p><?php 
                echo $value;
                ?>
</p>
			<?php 
            }
        }
    }
    ?>
Example #14
0
			?>		
			<?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?>&nbsp;</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?>&nbsp;</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)?>); }">&nbsp;<?php } ?>
		<?php } # end hook thumbscheckboxes?>
		<?php if ($display_resource_id_in_thumbnail && $ref>0) { echo htmlspecialchars($ref); } else { ?>&nbsp;<?php } ?>
		</div>	

		<?php if (!hook("replaceresourcetools")){?>
Example #15
0
		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")?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></a><?php
				}
			?>
		</div></td>
		<?php } ?>
function contact_sheet_add_fields($resourcedata)
{
    global $pdf, $n, $getfields, $sheetstyle, $imagesize, $refnumberfontsize, $leading, $csf, $pageheight, $currentx, $currenty, $topx, $topy, $bottomx, $bottomy, $logospace, $deltay, $width, $config_sheetsingle_include_ref, $contactsheet_header, $cellsize, $ref, $pagewidth;
    //exit (print_r($getfields));
    if ($sheetstyle == "single" && $config_sheetsingle_include_ref == "true") {
        $pdf->SetY($bottomy);
        $pdf->MultiCell($pagewidth - 2, 0, '', '', 'L', false, 1);
        $pdf->ln();
        $pdf->MultiCell($pagewidth - 2, 0, $ref, '', 'L', false, 1);
    }
    for ($ff = 0; $ff < count($getfields); $ff++) {
        $value = "";
        $value = str_replace("'", "\\'", $resourcedata['field' . $getfields[$ff]]);
        $plugin = "../../plugins/value_filter_" . $csf[$ff]['name'] . ".php";
        if ($csf[$ff]['value_filter'] != "") {
            eval($csf[$ff]['value_filter']);
        } else {
            if (file_exists($plugin)) {
                include $plugin;
            }
        }
        $value = TidyList($value);
        if ($sheetstyle == "thumbnails") {
            $pdf->Cell($imagesize, ($refnumberfontsize + $leading) / 72, $value, 0, 2, 'L', 0, '', 1);
            //if ($ff==2){echo print_r($getfields) . " " . $pdf->GetY();exit();}
            $bottomy = $pdf->GetY();
            $bottomx = $pdf->GetX();
        } else {
            if ($sheetstyle == "list") {
                $pdf->Text($pdf->GetX() + $imagesize + 0.1, $pdf->GetY() + 0.2 * ($ff + $deltay), $value);
                //$pdf->Text($pdf->GetX()+$imagesize+0.1,$pdf->GetY()+(0.2*($ff+2)),$value);
                //$pdf->Text($pdf->GetX()+$imagesize+0.1,$pdf->GetY()+(0.2*($ff+2)+ 0.15),$value);
                $pdf->SetXY($currentx, $currenty);
            } else {
                if ($sheetstyle == "single") {
                    $pdf->MultiCell($pagewidth - 2, 0, $value, '', 'L', false, 1);
                }
            }
        }
    }
}