Commit ad2e5d8b authored by Juraj Nemec's avatar Juraj Nemec Committed by Joe 🤘 Shindelar
Browse files

Issue #3278966 by poker10, prabhu.j: Incorrect links on Drupal 7 form API

parent 15cd9c9c
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -2560,14 +2560,14 @@ be called after the form or element is built.</p>

<div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp; $form</span><span style="color: #007700">[</span><span style="color: #DD0000">'file_public_path'</span><span style="color: #007700">] = array(<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#type' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'textfield'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#title' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Public file system path'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#default_value' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">variable_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'file_public_path'</span><span style="color: #007700">, </span><span style="color: #0000BB">conf_path</span><span style="color: #007700">() . </span><span style="color: #DD0000">'/files'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#maxlength' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">255</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#description' </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'A local file system path where public files will be stored. This directory must exist and be writable by Drupal. This directory must be relative to the Drupal installation directory and be accessible over the web.'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp; </span><span style="color: #DD0000">'#after_build' </span><span style="color: #007700">=&gt; array(</span><span style="color: #DD0000">'system_check_directory'</span><span style="color: #007700">),<br />&nbsp; );<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>

<h3><a name="ajax" id="ajax" href="http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax">#ajax</a></h3>
<h3><a name="ajax" id="ajax" href="https://api.drupal.org/api/drupal/includes%21ajax.inc/group/ajax/7.x">#ajax</a></h3>

<p><strong>Used by</strong>: <a href="#button">button</a>, <a href="#checkbox">checkbox</a>, <a href="#checkboxes">checkboxes</a>, <a href="#image_button">image button</a>, <a href="#password">password</a>,
<a href="#radio">radio</a>, <a href="#radios">radios</a>, <a href="#select">select</a>, <a href="#submit">submit</a>, <a href="#tableselect">tableselect</a>, <a href="#textarea">textarea</a>, <a href="#text_format">text_format</a>,
<a href="#textfield">textfield</a> </p>

<p>An array of elements whose values control the behavior of the
element with respect to the <a href="http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax">Drupal AJAX framework</a>.</p>
element with respect to the <a href="https://api.drupal.org/api/drupal/includes%21ajax.inc/group/ajax/7.x">Drupal AJAX framework</a>.</p>

<p><a href="http://en.wikipedia.org/wiki/AJAX">AJAX</a>
(Asynchronous Javascript and XML) is a term used for dynamic
@@ -2588,7 +2588,7 @@ element (such as 'click'), the AJAX request is made to the Drupal path
of the element's <a href="#ajax_path">#ajax['path']</a>. If an <a href="#ajax_callback">#ajax['callback']</a> has been specified (the
normal case), the Drupal path will be <code>system/ajax</code>.</li>
  <li>Form information gets processed, and the function specified in <a href="#ajax_callback">#ajax['callback']</a> is called. &nbsp;<a href="forms_api_reference.html#ajax_callback">#ajax['callback']</a>
can return either HTML, a renderable array, or an array of <a href="http://api.drupal.org/api/group/ajax_commands">AJAX commands</a>.</li>
can return either HTML, a renderable array, or an array of <a href="https://api.drupal.org/api/drupal/includes%21ajax.inc/group/ajax_commands/7.x">AJAX commands</a>.</li>
  <li>While the user
waits for the callback to execute a throbber or progress bar is shown
as determined by <a href="#ajax_progress">#ajax['progress']</a>. The
@@ -2605,7 +2605,7 @@ the returned HTML into the <a href="#ajax_wrapper">#ajax['wrapper']</a>.&nbsp;</

<p><strong>Description</strong>:
Specifies the name of a callback function which will be called during
an AJAX call. It can return HTML, a renderable array, or an array of <a href="http://api.drupal.org/api/group/ajax_commands">AJAX Commands</a>.
an AJAX call. It can return HTML, a renderable array, or an array of <a href="https://api.drupal.org/api/drupal/includes%21ajax.inc/group/ajax_commands/7.x">AJAX Commands</a>.
This callback
function is given the <code>$form</code> and <code>$form_state</code>
parameters, allowing it to produce a result, which it returns for
@@ -2692,7 +2692,7 @@ Modify the behavior of the returned
HTML from an AJAX request when inserting into the <a href="#ajax_wrapper">#ajax['wrapper']</a>. If not set, the returned
HTML will <span style="font-style: italic;">replace</span> the
contents of the wrapper element, but it's also possible to use any of
the available <a href="http://docs.jquery.com/DOM/Manipulation">jQuery
the available <a href="https://api.jquery.com/category/manipulation">jQuery
operations for DOM manipulation</a>. </p>

<p><strong>Values</strong>: String. Possible values: 'replace'
@@ -2803,7 +2803,7 @@ replaced, not just the contents of the element.</p>
HTML element on the same page. This <span style="font-style: italic;">must
not contain</span> the '#' character that a selector would have.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/upload/upload.module">upload.module</a>):</p>
<p><strong>Usage example</strong>:</p>

<div class="codeblock"><code><span class="def-txt"><span class="b-txt">&nbsp;&nbsp;&nbsp;
$form</span><span class="g-txt">[</span><span class="r-txt">'new'</span><span class="g-txt">][</span><span class="r-txt">'attach'</span><span class="g-txt">] = array(<br />
@@ -2846,7 +2846,7 @@ below and the loader functions <a href="http://api.drupal.org/api/function/drupa

<p>See <a href="http://api.drupal.org/api/function/drupal_process_attached">drupal_process_attached()</a> for additional information.</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/function/ajax_example_dependent_dropdown_degrades">AJAX Example</a>):</p>
<p><strong>Usage example</strong> (<a href="https://api.drupal.org/api/examples/ajax_example%21ajax_example_graceful_degradation.inc/function/ajax_example_dependent_dropdown_degrades/7.x-1.x">AJAX Example</a>):</p>

<div class="codeblock"> <code>
$form['#attached']['css'] = array(<br/>  drupal_get_path('module', 'ajax_example') . '/ajax_example.css',<br/>);<br/>
@@ -2933,8 +2933,7 @@ form element has been built yet.</p>

<p><strong>Values</strong>: TRUE or FALSE</p>

<p><strong>Usage example</strong>: INTERNAL. See the <a href="http://api.drupal.org/api/function/_form_builder">_form_builder</a>
function in <a href="http://api.drupal.org/api/file/includes/form.inc">form.inc</a>.</p>
<p><strong>Usage example</strong>: INTERNAL.</p>

<h3><a name="button_type" id="button_type">#button_type</a></h3>

@@ -3293,7 +3292,7 @@ after a textfield. This can be used to add a unit to a textfield.</p>

<p><strong>Values</strong>: Mixed</p>

<p><strong>Usage example</strong> (<a href="http://api.drupal.org/api/file/modules/upload/upload.module">system.module</a>):</p>
<p><strong>Usage example</strong>:</p>

<div class="codeblock"> <code><span class="def-txt"><span class="b-txt">&lt;?php<br />
$form</span><span class="g-txt">[</span><span class="r-txt">'settings_general'</span><span class="g-txt">][</span><span class="r-txt">'upload_usersize_default'</span><span class="g-txt">]&nbsp;=&nbsp;array(<br />
@@ -3533,7 +3532,7 @@ $form</span><span class="g-txt">[</span><span class="r-txt">'admin'</span><span

<p><strong>Description</strong>:
Function(s) to call <strong>after</strong>
rendering in <a href="http://api.drupal.org/api/function/drupal_render/" class="local">drupal_render</a>()
rendering in <a href="https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_render/7.x" class="local">drupal_render</a>()
has occured. The named function is called with two arguments, the rendered element and its children. It returns the (potentially)
altered) element content.</p>

@@ -3550,7 +3549,7 @@ over it, so don't follow this usage example exactly.</p>
$form</span><span class="g-txt">[</span><span class="r-txt">'admin'</span><span class="g-txt">][</span><span class="r-txt">'#post_render'</span><span class="g-txt">] = array(</span><span class="r-txt">'admin_form_html_cleanup'</span><span class="g-txt">);<br />
</span><span class="b-txt">?&gt;</span></span></code>
<p>This example would call admin_form_html_cleanup($content, $element)
after $element has been rendered to $content via <a href="http://api.drupal.org/api/function/drupal_render/" class="local">drupal_render</a>().
after $element has been rendered to $content via <a href="https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_render/7.x" class="local">drupal_render</a>().
$content may then be modified and must be returned.</p>
</div>

@@ -3583,7 +3582,7 @@ $form</span><span class="g-txt">[</span><span class="r-txt">'choice'</span><span

<p><strong>Description</strong>:
Function(s) to call <strong>before</strong>
rendering in <a href="http://api.drupal.org/api/function/drupal_render/" class="local">drupal_render</a>()
rendering in <a href="https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_render/7.x" class="local">drupal_render</a>()
has occured. The function(s) provided in #pre_render receive the element as an argument and
must return the altered element.</p>

@@ -3611,7 +3610,7 @@ function filter_form_access_denied($element) {<br />
}<br />
</code>
<p>This example would call filter_form_access_denied($element) before
the $element has been rendered via <a href="http://api.drupal.org/api/function/drupal_render/" class="local">drupal_render</a>().
the $element has been rendered via <a href="https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_render/7.x" class="local">drupal_render</a>().
$element may then be modified and is returned for rendering.</p>
</div>