• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP i18n_get_translated函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中i18n_get_translated函数的典型用法代码示例。如果您正苦于以下问题:PHP i18n_get_translated函数的具体用法?PHP i18n_get_translated怎么用?PHP i18n_get_translated使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了i18n_get_translated函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: setLink

function setLink($selector, $url, $title, $rel = 'lightbox')
{
    ?>
		<script>
		jQuery(document).ready(function() {
			jQuery('<?php 
    echo $selector;
    ?>
')
					.attr('href', '<?php 
    echo $url;
    ?>
')
					.attr('title', '<?php 
    echo addslashes(htmlspecialchars(i18n_get_translated($title)));
    ?>
')
					.attr('rel', '<?php 
    echo $rel;
    ?>
')
					.attr('onmouseup', 'closeModalOnLightBoxEnable();');
		});
		</script>
	<?php 
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:26,代码来源:utility.php


示例2: DisplayThemeBar

function DisplayThemeBar($theme1)
        {
        global $lang,$flag_new_themes,$contact_sheet,$theme_images,$allow_share,$n,$baseurl;

        # Work out theme name
        $themename=$theme1;
        $theme_display=getval("theme_$n","off");
       
        $themes=get_themes(array($theme1));
        if (count($themes)>0)
                {
                ?>

<div
onclick="
var theme_display=get_cookie('theme_<?php echo $n?>');
if (theme_display=='off'){var toggle_theme_display='on';} else { var toggle_theme_display='off';}
SetCookie('theme_<?php echo $n?>',toggle_theme_display,1000);
jQuery('#themebar_<?php echo htmlspecialchars(str_replace(array("\""," "),"",$themename)) ?>').slideToggle(0.2);


return false;">                
               
	<a href='#'><b><?php echo htmlspecialchars(stripslashes(i18n_get_translated(str_replace("*","",$themename)))) ?></b></a></div>
               
<div id="themebar_<?php echo htmlspecialchars(str_replace(array("\""," "),"",$themename)) ?>" style="display:<?php if ($theme_display == 'off'){echo 'none';} else {echo '';}?>" >
                <?php
                for ($m=0;$m<count($themes);$m++)
                        { ?><br>
                        &nbsp;&nbsp;&nbsp;<a href="<?php echo $baseurl?>/pages/search.php?search=!collection<?php echo $themes[$m]["ref"]?>&bc_from=themes"  title="<?php echo $lang["collectionviewhover"]?>"><?php echo htmlspecialchars(i18n_get_collection_name($themes[$m])) ?></a>
                        <?php
                        }
                ?><br><br></div><?php
                }
        }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:35,代码来源:themebar.php


示例3: i18n_get_translated

 function i18n_get_translated($text)
 {
     # For field names / values using the i18n syntax, return the version in the current user's language
     # Format is ~en:Somename~es:Someothername
     $text = trim($text);
     # For multiple keywords, parse each keyword.
     if (strpos($text, ",") !== false && strpos($text, "~") !== false) {
         $s = explode(",", $text);
         $out = "";
         for ($n = 0; $n < count($s); $n++) {
             if ($n > 0) {
                 $out .= ",";
             }
             $out .= i18n_get_translated(trim($s[$n]));
         }
         return $out;
     }
     global $language, $defaultlanguage;
     $asdefaultlanguage = $defaultlanguage;
     if (!isset($asdefaultlanguage)) {
         $asdefaultlanguage = 'en';
     }
     # Split
     $s = explode("~", $text);
     # Not a translatable field?
     if (count($s) < 2) {
         return $text;
     }
     # Find the current language and return it
     $default = "";
     for ($n = 1; $n < count($s); $n++) {
         # Not a translated string, return as-is
         if (substr($s[$n], 2, 1) != ":" && substr($s[$n], 5, 1) != ":" && substr($s[$n], 0, 1) != ":") {
             return $text;
         }
         # Support both 2 character and 5 character language codes (for example en, en-US).
         $p = strpos($s[$n], ':');
         $textLanguage = substr($s[$n], 0, $p);
         if ($textLanguage == $language) {
             return substr($s[$n], $p + 1);
         }
         if ($textLanguage == $asdefaultlanguage || $p == 0) {
             $default = substr($s[$n], $p + 1);
         }
     }
     # Translation not found? Return default language
     # No default language entry? Then consider this a broken language string and return the string unprocessed.
     if ($default != "") {
         return $default;
     } else {
         return $text;
     }
 }
开发者ID:vongalpha,项目名称:resourcespace,代码行数:53,代码来源:language_functions.php


示例4: HookResourceconnectCollectionsThumblistextra

function HookResourceconnectCollectionsThumblistextra()
{
    global $usercollection;
    $thumbs = sql_query("select * from resourceconnect_collection_resources where collection='{$usercollection}' order by date_added desc");
    foreach ($thumbs as $thumb) {
        ?>
		<!--Resource Panel--> 
		<div class="CollectionPanelShell"> 

		<table border="0" class="CollectionResourceAlign"><tr><td> 
		<a target="main" href="../plugins/resourceconnect/pages/view.php?url=<?php 
        echo urlencode($thumb["url"]);
        ?>
&k=<?php 
        echo getval("k", "");
        ?>
&col=<?php 
        echo $usercollection;
        ?>
"><img border=0 src="<?php 
        echo $thumb["thumb"];
        ?>
" class="CollectImageBorder" /></a></td> 
		</tr></table> 
				
		<div class="CollectionPanelInfo"><a target="main" href="../plugins/resourceconnect/pages/view.php?url=<?php 
        echo urlencode($thumb["url"]);
        ?>
&k=<?php 
        echo getval("k", "");
        ?>
&col=<?php 
        echo $usercollection;
        ?>
"><?php 
        echo tidy_trim(i18n_get_translated($thumb["title"]), 15);
        ?>
</a>&nbsp;</div> 
				
		<div class="CollectionPanelInfo"> 
		<a href="collections.php?resourceconnect_remove=<?php 
        echo $thumb["ref"];
        ?>
&nc=<?php 
        echo time();
        ?>
">x Remove</a></div>			
		</div>
		<?php 
    }
}
开发者ID:vongalpha,项目名称:resourcespace,代码行数:51,代码来源:collections.php


示例5: HookResourceofthedayHomeReplaceslideshow

function HookResourceofthedayHomeReplaceslideshow()
{
    include_once dirname(__FILE__) . "/../inc/rotd_functions.php";
    global $baseurl, $view_title_field;
    $rotd = get_resource_of_the_day();
    if ($rotd === false) {
        return false;
    }
    # No ROTD, return false to disable hook and display standard slide show.
    # Get preview width
    $sizes = get_image_sizes($rotd, true);
    foreach ($sizes as $size) {
        if ($size["id"] == "pre") {
            $width = $size["width"];
            break;
        }
    }
    # Fetch title
    $title = sql_value("select value from resource_data where resource='{$rotd}' and resource_type_field={$view_title_field}", "");
    # Fetch caption
    $caption = sql_value("select value from resource_data where resource='{$rotd}' and resource_type_field=18", "");
    # Show resource!
    $pre = get_resource_path($rotd, false, "pre", false, "jpg");
    ?>
	<div class="HomePicturePanel RecordPanel" style="width: <?php 
    echo $width;
    ?>
px; padding-left: 3px;">
	<a onClick="return CentralSpaceLoad(this,true);" href="<?php 
    echo $baseurl;
    ?>
/pages/view.php?ref=<?php 
    echo $rotd;
    ?>
"><img class="ImageBorder" style="margin-bottom: 10px;" src="<?php 
    echo $pre;
    ?>
" /></a>
	<br />
	<h2 ><?php 
    echo i18n_get_translated(htmlspecialchars($title));
    ?>
</h2>
	<?php 
    echo $caption;
    ?>
	</div>
	<?php 
    return true;
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:50,代码来源:home.php


示例6: generateResourcesMetadataCSV

/**
* Generates the CSV content of the metadata for resources passed in the array
*
* @param $resources
* @return string
*/
function generateResourcesMetadataCSV(array $resources)
{
    global $lang;
    $return = '';
    $csv_field_headers = array();
    $resources_fields_data = array();
    foreach ($resources as $resource) {
        foreach (get_resource_field_data($resource['ref'], false, true, -1, getval("k", "") != "") as $field_data) {
            if ($field_data['name'] == '') {
                die('Please check field ID ' . $field_data['ref'] . ' and make sure its "' . $lang['property-shorthand_name'] . '" is set!');
            }
            $csv_field_headers[$field_data['name']] = $field_data['title'];
            $resources_fields_data[$resource['ref']][$field_data['name']] = $field_data['value'];
        }
    }
    $csv_field_headers = array_unique($csv_field_headers);
    // Header
    $return = '"' . $lang['resourceids'] . '","' . implode('","', $csv_field_headers) . "\"\n";
    // Results
    $csv_row = '';
    foreach ($resources_fields_data as $resource_id => $resource_fields) {
        // First column will always be Resource ID
        $csv_row = $resource_id . ',';
        // Field values
        foreach ($csv_field_headers as $column_header => $column_header_title) {
            if (!array_key_exists($column_header, $resource_fields)) {
                $csv_row .= '"",';
                continue;
            }
            foreach ($resource_fields as $field_name => $field_value) {
                if ($column_header == $field_name) {
                    $csv_row .= '"' . tidylist(i18n_get_translated($field_value)) . '",';
                }
            }
        }
        $csv_row .= "\n";
        $return .= $csv_row;
    }
    return $return;
}
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:46,代码来源:csv_export_functions.php


示例7: HookResourceConnectAllSearchfiltertop

function HookResourceConnectAllSearchfiltertop()
{
    # Option to search affiliate systems in the basic search panel
    global $lang, $language, $resourceconnect_affiliates, $baseurl, $resourceconnect_selected;
    if (!checkperm("resourceconnect")) {
        return false;
    }
    ?>

	<div class="SearchItem"><?php 
    echo $lang["resourceconnect_affiliate"];
    ?>
<br />
	<select class="SearchWidth" name="resourceconnect_selected">
	
	<?php 
    for ($n = 0; $n < count($resourceconnect_affiliates); $n++) {
        ?>
		<option value="<?php 
        echo $n;
        ?>
" <?php 
        if ($resourceconnect_selected == $n) {
            ?>
selected<?php 
        }
        ?>
><?php 
        echo i18n_get_translated($resourceconnect_affiliates[$n]["name"]);
        ?>
</option>
		<?php 
    }
    ?>
	</select>
	</div>
	<?php 
}
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:38,代码来源:all.php


示例8: HookResourceofthedayHomeReplaceslideshow

function HookResourceofthedayHomeReplaceslideshow()
{
    include_once dirname(__FILE__) . "/../inc/rotd_functions.php";
    $rotd = get_resource_of_the_day();
    if ($rotd === false) {
        return false;
    }
    # No ROTD, return false to disable hook and display standard slide show.
    # Fetch resource data
    $resource = get_resource_data($rotd);
    # Fetch title
    $title = sql_value("select value from resource_data where resource='{$rotd}' and resource_type_field=8", "");
    # Fetch caption
    $caption = sql_value("select value from resource_data where resource='{$rotd}' and resource_type_field=18", "");
    # Show resource!
    $pre = get_resource_path($rotd, false, "pre", false, "jpg");
    ?>
	<div class="HomePicturePanel RecordPanel" style="width:350px;padding-left:4px;">
	<a href="view.php?ref=<?php 
    echo $rotd;
    ?>
"><img class="ImageBorder" style="margin-bottom: 10px;" src="<?php 
    echo $pre;
    ?>
" /></a>
	<br />
	<h2 ><?php 
    echo i18n_get_translated(htmlspecialchars($title));
    ?>
</h2>
	<?php 
    echo $caption;
    ?>
	</div>
	<?php 
    return true;
}
开发者ID:vongalpha,项目名称:resourcespace,代码行数:37,代码来源:home.php


示例9: generateResourcesMetadataCSV

/**
* Generates the CSV content of the metadata for resources passed in the array
*
* @param $resources
* @return string
*/
function generateResourcesMetadataCSV(array $resources)
{
    global $lang;
    $return = '';
    $csv_field_headers = array();
    $resources_fields_data = array();
    foreach ($resources as $resource) {
        foreach (get_resource_field_data($resource['ref'], false, true, -1, getval("k", "") != "") as $field_data) {
            $csv_field_headers[$field_data['resource_type_field']] = $field_data['title'];
            $resources_fields_data[$resource['ref']][$field_data['resource_type_field']] = $field_data['value'];
        }
    }
    $csv_field_headers = array_unique($csv_field_headers);
    // Header
    $return = '"' . $lang['resourceids'] . '","' . implode('","', $csv_field_headers) . "\"\n";
    // Results
    $csv_row = '';
    foreach ($resources_fields_data as $resource_id => $resource_fields) {
        // First column will always be Resource ID
        $csv_row = $resource_id . ',';
        // Field values
        foreach ($csv_field_headers as $column_header => $column_header_title) {
            if (!array_key_exists($column_header, $resource_fields)) {
                $csv_row .= '"",';
                continue;
            }
            foreach ($resource_fields as $field_name => $field_value) {
                if ($column_header == $field_name) {
                    $csv_row .= '"' . str_replace(array("\\n", "\\r", "\""), "//", tidylist(i18n_get_translated($field_value))) . '",';
                }
            }
        }
        $csv_row .= "\n";
        $return .= $csv_row;
    }
    return $return;
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:43,代码来源:csv_export_functions.php


示例10: htmlspecialchars

	<!--List Item-->
	<tr>
	<td><?php echo htmlspecialchars(nicedate($log[$n]["date"],true)) ?></td>
	<td><?php echo htmlspecialchars($log[$n]["fullname"])?></td>
	<td><?php 
		echo $lang["collectionlog-" . $log[$n]["type"]] ;
		if ($log[$n]["notes"] != "" ) { 
			##  notes field contains user IDs, collection references and /or standard texts
			##  Translate the standard texts
			$standard = array('#all_users', '#new_resource');
			$translated   = array($lang["all_users"], $lang["new_resource"]);
			$newnotes = str_replace($standard, $translated, $log[$n]["notes"]);
			echo $newnotes;
		}
		?></td>
	<td><?php if ($log[$n]['resource']!=0){?><a onClick="return CentralSpaceLoad(this,true);" href='<?php echo $baseurl_short?>pages/view.php?ref=<?php echo urlencode($log[$n]["resource"]) ?>'><?php echo $log[$n]["resource"]?></a><?php } ?></td>
	<td><?php if ($log[$n]['resource']!=0){?><a onClick="return CentralSpaceLoad(this,true);" href='<?php echo $baseurl_short?>pages/view.php?ref=<?php echo urlencode($log[$n]["resource"]) ?>'><?php echo i18n_get_translated($log[$n]["title"])?></a><?php } ?></td>
	</tr> 
<?php } ?>
</table>
</div> <!-- End of Listview -->

<div class="BottomInpageNav">
<?php pager(false); ?></div>

</div> <!-- End of BasicsBox -->

<?php
include "../include/footer.php";
?>
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:30,代码来源:collection_log.php


示例11: format_display_field

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;
}
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:14,代码来源:general.php


示例12: CentralSpaceLoad

'><?php 
    echo $log[$n]["resourceid"];
    ?>
</a></td>
	<td><?php 
    if (!hook("replaceuserlogtitlelink")) {
        ?>
<a onClick="return CentralSpaceLoad(this,true);" href='<?php 
        echo $baseurl_short;
        ?>
pages/view.php?ref=<?php 
        echo $log[$n]["resourceid"];
        ?>
'><?php 
        if (!hook("replaceuserlogtitle")) {
            echo i18n_get_translated($log[$n]["resourcetitle"]);
        }
        ?>
</a><?php 
    }
    ?>
</td>
	
	<td><?php 
    echo $lang["log-" . $log[$n]["type"]];
    # For emailed items, append email address from the 'notes' column
    if ($log[$n]["type"] == "E") {
        echo " " . $log[$n]["notes"];
    }
    # For purchases, append size and price
    if ($log[$n]["type"] == "p") {
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:team_user_log.php


示例13: urlencode

						if (isset($metadata_template_title_field) && isset($metadata_template_resource_type))
							{
							if ($result[$n]['resource_type']==$metadata_template_resource_type)
								{
								$title=$result[$n]["field".$metadata_template_title_field];
								}	
							}	
								
						?>
						
						<!--Resource Panel-->
						<div class="ResourcePanelShellSmall">
						<table border="0" class="ResourceAlignSmall"><tr><td>
						<a href="<?php echo $baseurl_short?>pages/view.php?ref=<?php echo $rref?>&search=<?php echo urlencode("!related" . $ref)?>" onClick="return CentralSpaceLoad(this,true);"><?php if ($result[$n]["has_image"]==1) { ?><img border=0 src="<?php echo get_resource_path($rref,false,"col",false,$result[$n]["preview_extension"],-1,1,checkperm("w"),$result[$n]["file_modified"])?>" class="CollectImageBorder"/><?php } else { ?><img border=0 src="../gfx/<?php echo get_nopreview_icon($result[$n]["resource_type"],$result[$n]["file_extension"],true)?>"/><?php } ?></a></td>
						</tr></table>
						<div class="ResourcePanelInfo"><a href="<?php echo $baseurl_short?>pages/view.php?ref=<?php echo $rref?>" onClick="return CentralSpaceLoad(this,true);"><?php echo tidy_trim(i18n_get_translated($title),15)?></a>&nbsp;</div>
						<div class="ResourcePanelIcons"><input type="checkbox" id="share<?php echo $rref ?>" class="checkselect" onChange="UpdateRelatedField(this,<?php echo $rref ?>);"></div>
						
						</div>
						<?php		
						}
					}
					?>
					</div><!-- end of sharerelatedtype -->
					<div class="clearerleft"> </div>
					<?php
				} //end of display loop by resource extension
		
		?>
		</div>
		<div class="clearerleft"> </div>
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:31,代码来源:resource_email.php


示例14: i18n_get_translated

			<div class="Question" id="question_access">
			<label for="archive"><?php echo $lang["access"]?></label>
			<select class="stdwidth" name="access" id="access">
			<?php
			# List available access levels. The highest level must be the minimum user access level.
			for ($n=$minaccess;$n<=1;$n++) { ?>
			<option value="<?php echo $n?>"><?php echo $lang["access" . $n]?></option>
			<?php } ?>
			</select>
			<div class="clearerleft"> </div>
			</div>
			
			<?php
			for ($x=0;$x<$themecount;$x++)
				{ ?>
					<input type="hidden" name="theme<?php echo $x+1 ?>" id="theme<?php echo $x+1 ?>" value="<?php echo i18n_get_translated($themes[$x]) ?>">
				<?php 
				}
			?>
			
			<div class="Question">
			<label><?php echo $lang["expires"]?></label>
			<select name="expires" class="stdwidth">
			<option value=""><?php echo $lang["never"]?></option>
			<?php for ($n=1;$n<=150;$n++)
				{
				$date=time()+(60*60*24*$n);
				?><option <?php $d=date("D",$date);if (($d=="Sun") || ($d=="Sat")) { ?>style="background-color:#cccccc"<?php } ?> value="<?php echo date("Y-m-d",$date)?>"><?php echo nicedate(date("Y-m-d",$date),false,true)?></option>
				<?php
				}
			?>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:theme_category_share.php


示例15: foreach

            ?>

			<?php 
            if ($type == 3) {
                # Drop down box
                ?>
			<select name="custom<?php 
                echo $n;
                ?>
" id="custom<?php 
                echo $n;
                ?>
" class="stdwidth">
			<?php 
                foreach ($custom_request_options[$custom[$n]] as $option) {
                    $val = i18n_get_translated($option);
                    ?>
				<option <?php 
                    if (getval("custom" . $n, "") == $val) {
                        ?>
selected<?php 
                    }
                    ?>
><?php 
                    echo htmlspecialchars($val);
                    ?>
</option>
				<?php 
                }
                ?>
			</select>
开发者ID:claytondaley,项目名称:resourcespace,代码行数:31,代码来源:resource_request.php


示例16: trim_array

<?php

/* -------- Check box list ------------------ */
if (!hook("customchkboxes")) {
    # Translate all options
    $options = trim_array(explode(",", $field["options"]));
    $option_trans = array();
    $option_trans_simple = array();
    for ($m = 0; $m < count($options); $m++) {
        $trans = i18n_get_translated($options[$m]);
        $option_trans[$options[$m]] = $trans;
        $option_trans_simple[] = $trans;
    }
    if ($auto_order_checkbox) {
        natsort($option_trans);
    }
    $options = array_keys($option_trans);
    # Set the options array to the keys, so it is now effectively sorted by translated string
    $set = trim_array(explode(",", $value));
    $wrap = 0;
    $l = average_length($option_trans_simple);
    $cols = 10;
    if ($l > 5) {
        $cols = 6;
    }
    if ($l > 10) {
        $cols = 4;
    }
    if ($l > 15) {
        $cols = 3;
    }
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:2.php


示例17: foreach

" id="custom<?php 
                echo $n;
                ?>
" class="stdwidth">
			<?php 
                foreach ($custom_request_options[$custom[$n]] as $option) {
                    $val = i18n_get_translated($option);
                    ?>
				<option <?php 
                    if (getval("custom" . $n, "") == $val) {
                        ?>
selected<?php 
                    }
                    ?>
><?php 
                    echo htmlspecialchars(i18n_get_translated($option));
                    ?>
</option>
				<?php 
                }
                ?>
			</select>
			<?php 
            }
            ?>
			
			<div class="clearerleft"> </div>
			</div>
			<?php 
        }
    }
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:collection_request.php


示例18: display_field_data

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.
//.........这里部分代码省略.........
开发者ID:claytondaley,项目名称:resourcespace,代码行数:101,代码来源:view.php


示例19: urlencode

            echo urlencode($sort);
            ?>
&archive=<?php 
            echo urlencode($archive);
            ?>
&page=<?php 
            echo urlencode($nextpage);
            ?>
" class="PDFnav pageNext">&gt;</a><?php 
        }
        ?>
</td>
</tr></table>

<?php 
    }
    // end hook previewimage2
}
// end hook previewimage
?>

<?php 
if ($show_resource_title_in_titlebar) {
    $title = htmlspecialchars(i18n_get_translated(get_data_by_field($ref, $view_title_field)));
    if (strlen($title) > 0) {
        echo "<script language='javascript'>\n";
        echo "document.title = \"{$applicationname} - {$title}\";\n";
        echo "</script>";
    }
}
include "../include/footer.php";
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:preview.php


示例20: trim_array

<?php

/* --------Drop down list ---------------- */
# Translate all options
$options = trim_array(explode(",", $fields[$n]["options"]));
$adjusted_dropdownoptions = hook("adjustdropdownoptions");
if ($adjusted_dropdownoptions) {
    $options = $adjusted_dropdownoptions;
}
$option_trans = array();
for ($m = 0; $m < count($options); $m++) {
    $option_trans[$options[$m]] = i18n_get_translated($options[$m]);
}
if ($auto_order_checkbox) {
    asort($option_trans);
}
if (substr($value, 0, 1) == ',') {
    $value = substr($value, 1);
}
// strip the leading comma if it exists
?>
<select class="stdwidth" name="<?php 
echo $name;
?>
" id="<?php 
echo $name;
?>
" <?php 
echo $help_js;
if ($edit_autosave) {
    ?>
开发者ID:vongalpha,项目名称:resourcespace,代码行数:31,代码来源:3.php



注:本文中的i18n_get_translated函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP i18n_menu_translated_tree函数代码示例发布时间:2022-05-15
下一篇:
PHP i18n_get_collection_name函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap