This topic is locked

Using Values as labels from a system table

6/28/2010 9:39:01 PM
PHPRunner General questions
P
Peter Brooks author

In my application users can change the label names of fields. For example, 'Surname' can be changed to 'Last name' This is optional, and can be changed in the SysFile table. So SysFile.Label_Surname contains either a blank or a value. How can this be done so it is transparent and all screens will display the optional new values?

So the field label for Table 'Names' and field 'Surname' will always display the Sysfile value if exists otherwise the default of 'Surname'
Peter Brooks

Soft Sys

www.membershipadmin.com

A
ann 6/30/2010

Peter,
you can edit GetFieldLabel($table,$field) function in the include/commonfucntions.php file to select field labels from system table and return resulted value or standart label if there is no label in your tables.

P
Peter Brooks author 6/30/2010



Peter,
you can edit GetFieldLabel($table,$field) function in the include/commonfucntions.php file to select field labels from system table and return resulted value or standart label if there is no label in your tables.


Thanks Ann for responding. I have looked in that file.
function GetFieldLabel($table,$field)

{

global $field_labels;

//New code
if(!array_key_exists($table,$field_labels))

return "";

return @$field_labels[$table][mlang_getcurrentlang()][$field];

P
Peter Brooks author 6/30/2010



Peter,
you can edit GetFieldLabel($table,$field) function in the include/commonfucntions.php file to select field labels from system table and return resulted value or standart label if there is no label in your tables.


Thanks Ann for responding. I have looked in that file.
function GetFieldLabel($table,$field)

{

global $field_labels;

//New code
if(!array_key_exists($table,$field_labels))

return "";

return @$field_labels[$table][mlang_getcurrentlang()][$field];

P
Peter Brooks author 6/30/2010



Peter,
you can edit GetFieldLabel($table,$field) function in the include/commonfucntions.php file to select field labels from system table and return resulted value or standart label if there is no label in your tables.


Thanks Ann for responding. I have looked in that file. Can you give me a hint as to how about coding this? I have put some psuedocode below.
function GetFieldLabel($table,$field)

{

global $field_labels;

//New code - Psuedocode

//String $newLabel;

//If Table = 'Names' then

// If $field = 'Surname' Move System.Label_Surname to $newLabel

// Else If $field = 'Company' Move System.Label_Company to $newLabel

// etc

// If ($newlabel <> '') return $newlabel
if(!array_key_exists($table,$field_labels))

return "";

return @$field_labels[$table][mlang_getcurrentlang()][$field];

J
Jane 7/1/2010

I recommend you you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions of what you want to achieve.