$config_vars = array(
array('desc', 'flitter_desc'),
array('select', 'flitter_position', array('topic' => $txt['flitter_position_topic'], 'sidebar' => $txt['flitter_position_sidebar'])),
array('title', 'flitter_fb'),
array('check', 'flitter_showfb'),
array('title', 'flitter_twitter'),
array('check', 'flitter_showtwitter'),
$txt['flitter_twitter_via_desc'],
array('text', 'flitter_twitter_via'),
array('text', 'flitter_twitter_related'),
array('text', 'flitter_twitter_related_desc'),
array('title', 'flitter_google'),
array('check', 'flitter_showgoogle'),
);<settings-page area="flitter" icon="mgallery.png" bigicon="$plugindir/flitter.png">
<load-language file="Flitter-Admin" />
<desc name="flitter_desc" />
<select name="flitter_position">
<opt value="topic" name="flitter_position_topic" />
<opt value="sidebar" name="flitter_position_sidebar" />
</select>
<title name="flitter_fb" />
<check name="flitter_showfb" />
<title name="flitter_twitter" />
<check name="flitter_showtwitter" />
<literal name="flitter_twitter_via_desc" />
<text name="flitter_twitter_via" />
<text name="flitter_twitter_related" />
<text name="flitter_twitter_related_desc" />
<title name="flitter_google" />
<check name="flitter_showgoogle" />
</settings-page>| 1. | Three if you want to make it searchable as well, yup, even that isn't automated. |
| 1. | Since unless I'm much mistaken, that's eval() right there... |
How well did it work out for you?
but, in the end, language entries got injected into a master file, if you remember.
though I think the format of embedding options into the XML sort of defeats the point of using XML a bit...
So, all in all, it seems like it hasn't confused anyone?
Strikes me that there's two ways to do it, either by checking for $txt[$current_setting . '_subtext'] and just setting subtext to that if found, or manually specifying it as a parameter. The former would be quicker and likely easier to use but the latter would be clearer how the answer is derived.
Which would you prefer to use? (Remember that you can have help text if you so desire, though it's not immediately obvious how... if you declare $helptxt[$current_setting] and then have it so your language file is also loaded by the lang_help hook, it should work (though I haven't tested to be sure)
That seems a big drastic seeing how there's absolutely no need to do anything extra in core for help popup strings.
Strikes me that there's two ways to do it, either by checking for $txt[$current_setting . '_subtext'] and just setting subtext to that if found, or manually specifying it as a parameter. The former would be quicker and likely easier to use but the latter would be clearer how the answer is derived.
Which would you prefer to use? (Remember that you can have help text if you so desire, though it's not immediately obvious how... if you declare $helptxt[$current_setting] and then have it so your language file is also loaded by the lang_help hook, it should work (though I haven't tested to be sure)
<settings>
<setting name="contact_verification" default="guests" />
</settings> <settings>
<setting name="contact_verification" default="guests" subtext="contact_verification_somestring" />
</settings> // !!! Temporary. Preventing divs inside label tags.
$divPos = strpos($context['config_vars'][$config_var[1]]['label'], '<div');
if ($divPos !== false)
{
$context['config_vars'][$config_var[1]]['subtext'] = preg_replace('~</?div[^>]*>~', '', substr($context['config_vars'][$config_var[1]]['label'], $divPos));
$context['config_vars'][$config_var[1]]['label'] = substr($context['config_vars'][$config_var[1]]['label'], 0, $divPos);
}No, same file as in the revision, there's a small regex hack that allegedly converts the div in the label to the subtext.
Hey, this actually works! :D. Great!
No, I didn't drop any hooks at all