Page 1 of 1

Global configuration parameters

PostPosted: Mon May 07, 2012 2:25 am
by hhkilis
Hi,

How to make a configuration variable global?

For example, I want to make number of related records to be shown in the view tab of a record 10. I can do this by adding the line below into related relationships.ini file.

Code: Select all
[relationX]
section:limit=10


How can this setting be enabled for all relations?

Re: Global configuration parameters

PostPosted: Mon May 07, 2012 12:06 pm
by shannah
Right now there is no perfect solution. This setting's default is hardcoded (this should be changed) inside the Dataface/RecordView.php file.
You can add a global relationships.ini file that can be used to inherit directives from - but it isn't ideal.

It works as follows:

1. Create a relationships.ini file in the root directory or your app.
2. Add a base relationship configuration:

Code: Select all
[default_rel]
    section:limit=10
    action:condition="false"  ;;   Need to hide this relationship.
    visibility:find="hidden"   ;;  Need to hide this relationship from find form.
    __sql__ = "select * from dashboard" ;;  A dummy query that must be valid


Then in your table's relationships.ini file you could extend this relationship as follows:

Code: Select all
[my_relationship extends default_rel]
    __sql__ = "select .... etc...."
    action:condition="true"
    visibility:find="visible"


This "extends" functionality was originally developed for, and is most useful in actions but it works for any type of INI file since they all use the same config tool. In this case it isn't helpful because it doesn't have a notion of an "abstract" relationship so we need to expend some directives to hide the base relationship from the find form etc..., then make each relationship that extends it visible. Only if there are lots of directives that you can reuse, is this tremendously helpful.

-Steve

Re: Global configuration parameters

PostPosted: Tue May 08, 2012 3:48 am
by hhkilis
Thanks Steve