diff --git a/includes/globals.php b/includes/globals.php index b3ab2f7..dca5832 100755 --- a/includes/globals.php +++ b/includes/globals.php @@ -28,4 +28,4 @@ $GlobalPictureDir = "./pictures"; $GlobalDecimalPoint="." -?> +?> diff --git a/includes/language.php b/includes/language.php index 5158a55..0f3d08e 100755 --- a/includes/language.php +++ b/includes/language.php @@ -23,9 +23,9 @@ function LangSpellHtml ( $Sentence ) function LangSpell ( $Sentence ) { global $GlobalLanguage; - + $ReturnValue=""; - + if (file_exists("./languages/$GlobalLanguage.lng")) $Language = file ("./languages/$GlobalLanguage.lng"); else @@ -38,17 +38,17 @@ function LangSpell ( $Sentence ) $FileSentence=explode("=",$i,2); if ( trim( $FileSentence[0] ) == $Sentence ) { - $ReturnValue=trim($FileSentence[1]); + $ReturnValue=trim($FileSentence[1]); break; } } - + if (!$ReturnValue) { ErrorLog("[$GlobalLanguage.lng] Sentence \"$Sentence\" not found!"); $ReturnValue=$Sentence; } - + return $ReturnValue; } @@ -65,4 +65,4 @@ function LangGetAvailableLanguages () } return $ReturnValue; } -?> +?> diff --git a/includes/other_functions.php b/includes/other_functions.php index 94b4280..8f9093e 100755 --- a/includes/other_functions.php +++ b/includes/other_functions.php @@ -110,7 +110,7 @@ function OtherGetIcon ($IconName,$CssClass) $IconDirectory='./templates/'.$GlobalTemplate.'/icons/'; $Error = 0; $RetVal = ""; - + if (file_exists($IconDirectory.$IconName.".png")) $IconFile=$IconName.".png"; elseif (file_exists($IconDirectory.$IconName.".jpg")) $IconFile=$IconName.".jpg"; elseif (file_exists($IconDirectory.$IconName.".gif")) $IconFile=$IconName.".gif"; @@ -120,13 +120,35 @@ function OtherGetIcon ($IconName,$CssClass) //log if template directory is existing - if not, anyone else will report this if (file_exists("./templates/".$GlobalTemplate)) ErrorLog("Icon '$IconName' +[.png|.jpg|.gif] not found!"); } - + if (!$Error) { $RetVal = ""; } - + return $RetVal; } -?> + +// Returns a html tag +function OtherGetPictureImg($part_id, $max_width=0, $max_height=0) { + + // create anchor tag + $tag = ""; + + // create img tag + $tag .= " 0) $tag .= "&MaxWidth=$max_width"; + if ($max_height > 0) $tag .= "&MaxHeight=$max_height"; + $tag .= "\""; // finish src attribute + $tag .= " alt=\"picture of part $part_id\""; + $tag .= ">"; // finish img tag + + + // close link + $tag .= ''; + + return $tag; +} + +?> diff --git a/languages/English.lng b/languages/English.lng index e2bb76c..05a2ef3 100755 --- a/languages/English.lng +++ b/languages/English.lng @@ -139,6 +139,8 @@ PartsObsolete = Obsolete PartsObsoleteOnly = Only Obsolete PartsObsoleteNon = Non Obsolete PartsObsoleteAll = All Parts +PartsPreviewImageYes = Show Preview Images +PartsPreviewImageNo = Hide Preview Images PartsType = Type PartsStorage = Store PartsValues = Values diff --git a/languages/German.lng b/languages/German.lng index 7682433..35e3968 100755 --- a/languages/German.lng +++ b/languages/German.lng @@ -139,6 +139,8 @@ PartsObsolete = Obsolet PartsObsoleteOnly = nur Obsolet PartsObsoleteNon = keine Obsolete PartsObsoleteAll = alle Bauteile +PartsPreviewImageYes = Vorschaubilder anzeigen +PartsPreviewImageNo = keine Vorschaubilder PartsType = Typ PartsStorage = Lager PartsValues = Werte diff --git a/pages/parts_by_type.php b/pages/parts_by_type.php index 4be3350..14f896a 100755 --- a/pages/parts_by_type.php +++ b/pages/parts_by_type.php @@ -7,14 +7,14 @@ function WriteTypeSelector ($ParentId) global $GlobalMysqlHandler; global $GlobalContent; global $GlobalTemplate; - + $ListQuery="SELECT * FROM `Types` WHERE `ParentId` =$ParentId"; $ListQuery=mysqli_query($GlobalMysqlHandler, $ListQuery); if (!$ParentId || NestedListVisibilityIsSet($ParentId, 'PartTypeSelector')) - $GlobalContent .= "