Jump to content

More control for custom settings


Wolfie

Recommended Posts

Posted

I'm sure there's more potential to this than I'm thinking of but here goes. Being able to dynamically control certain attributes of an individual setting without having to get all complex about it. For example, let's say that I create a setting that I only want available under certain conditions. I could use the PHP portion of the setting to determine if the conditions are met and if so, leave it alone. Otherwise, set a value to either hide or disable the setting altogether.

As an example...


if ( condition )

{

 do something

}

else

{

 $r['conf_attributes']['active'] = false;

}


When the setting is displayed, it would be inaccessible (visible but disabled). I'm sure a better way to handle it can be determined, other than 'conf_attributes' and 'active', but hopefully you get the idea.

I was thinking that some valid attributes would consist of active (true), visible (true), height (default), width (default), etc. Could either be that the values are pre-added, so it's possible to use the value or that it would only be used if it's set from the code. (I'll explain what I mean by that if it didn't make any sense.)

There are likely other uses or attributes that could be added but overall this would open up a lot of potential functionality and control so that settings can be a bit smarter for the end user.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...