]> git.mxchange.org Git - friendica.git/blobdiff - doc/smarty3-templates.md
Merge pull request #11394 from annando/is-blocked
[friendica.git] / doc / smarty3-templates.md
index d44f263255fcece30edb561288355cfab92f28a5..f3f7c3e608777d68cdba19883338f08c6fe200c7 100644 (file)
@@ -20,10 +20,10 @@ Templates that are only used by addons shall be placed in the
 
 directory.
 
-To render a template use the function *get_markup_template* to load the template and *replace_macros* to replace the macros/variables in the just loaded template file.
+To render a template use the function *getMarkupTemplate* to load the template and *replaceMacros* to replace the macros/variables in the just loaded template file.
 
-               $tpl = get_markup_template('install_settings.tpl');
-        $o .= replace_macros($tpl, array( ... ));
+               $tpl = Renderer::getMarkupTemplate('install_settings.tpl');
+        $o .= Renderer::replaceMacros($tpl, array( ... ));
 
 the array consists of an association of an identifier and the value for that identifier, i.e.
 
@@ -39,7 +39,7 @@ They are initialized with an array of data, depending on the tyle of the field.
 
 All of these take an array holding the values, e.g. for a one line text input field, which is required and should be used to type email addesses use something along the lines of:
 
-               '$adminmail' => array('adminmail', L10n::t('Site administrator email address'), $adminmail, L10n::t('Your account email address must match this in order to use the web admin panel.'), 'required', '', 'email'),
+               '$adminmail' => array('adminmail', DI::l10n()->t('Site administrator email address'), $adminmail, DI::l10n()->t('Your account email address must match this in order to use the web admin panel.'), 'required', '', 'email'),
 
 To evaluate the input value, you can then use the $_POST array, more precisely the $_POST['adminemail'] variable.
 
@@ -80,16 +80,16 @@ Field parameter:
 
 ### field_input.tpl
 
-A single line input field for textual input.
+A single line input field for any type of input.
 Field parameter:
 
 0. Name of the field,
 1. Label for the input box,
 2. Current value of the variable,
 3. Help text for the input box,
-4. if set to "required" modern browser will check that this input box is filled when submitting the form,
+4. Should be set to the translation of "Required" to mark this field as required,
 5. if set to "autofocus" modern browser will put the cursur into this box once the page is loaded,
-6. if set to "email" or "url" modern browser will check that the filled in value corresponds to an email address or URL.
+6. if set, it will be used for the input type, default is `text` (possible types: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#%3Cinput%3E_types).
 
 ### field_intcheckbox.tpl
 
@@ -122,7 +122,7 @@ Field parameter:
 1. Label for the field,
 2. Value for the field, e.g. the old password,
 3. Help text for the input field,
-4. if set to "required" modern browser will check that this field is filled out,
+4. Should be set to the translation of "Required" to mark this field as required,
 5. if set to "autofocus" modern browser will put the cursor automatically into this input field.
 
 ### field_radio.tpl
@@ -176,15 +176,5 @@ Field parameter:
 0. Name of the input field,
 1. Label for the input box,
 2. Current text for the box,
-3. Help text for the input box.
-
-### field_yesno.tpl
-
-A button that has two states *yes* or *no*.
-Field parameter:
-
-0. Name of the input field,
-1. Label for the button,
-2. Current value,
-3. Help text for the button
-4. if set to an array of two values, these two will be used, otherwise "off" and "on".
+3. Help text for the input box,
+4. Should be set to the translation of "Required" to mark this field as required.