You are here

function arrange_fields_position_form in Arrange Fields 7

Same name and namespace in other branches
  1. 6 arrange_fields.module \arrange_fields_position_form()

This is the form which we will use to store the position data for the fields.

Parameters

array $form_state:

string $form_id:

string $form_type:

Return value

array

3 string references to 'arrange_fields_position_form'
arrange_fields_display_form in ./arrange_fields.module
This function will display a form and let us arrange its fields. It is designed to work with Drupal's content types (not Webform or programmer-designed forms).
arrange_fields_display_otherform in ./arrange_fields.module
Similar function as arrange_fields_display_form, but this is specifically for other, more generic forms on the system. For example, user_register, or custom forms which a developer has written.
arrange_fields_display_webform in ./arrange_fields.module
Similar function as arrange_fields_display_form, but this is specifically for webforms (with the webform module).

File

./arrange_fields.module, line 1644

Code

function arrange_fields_position_form($form_state1, $form_state2, $form_id, $form_type) {
  $form = array();
  $form["arrange_fields_form_id"] = array(
    "#type" => "hidden",
    "#value" => $form_id,
  );
  $form["arrange_fields_form_type"] = array(
    "#type" => "hidden",
    "#value" => $form_type,
  );

  // This field ends up being hidden in CSS.  It
  // is where we will store a semi-serialized string of all our
  // position data for all our fields.
  $form["arrange_fields_position_data"] = array(
    "#type" => "textfield",
    "#maxlength" => 99999999999,
  );

  // In a shameless beg for money, I am including this paypal donate button
  // If it's too tacky, users can easily "hide" it in CSS.  ;)
  $html = "\n    <div id='paypal-please-donate' style='float:right; max-width:320px; border: 1px solid #ccc; padding: 3px; margin-left: 20px; margin-bottom: 5px; font-size: 0.8em; line-height: 1.5em;'>\n      If you find this module useful, please consider donating to the project maintainer (Richard Peacock).\n      Any amount is greatly appreciated!\n      <div style='text-align: center;'>\n        <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8VVAK7KZVTHGE' \n                target='_blank'><img src='" . $GLOBALS["base_url"] . "/" . drupal_get_path("module", "arrange_fields") . "/paypal-donate-button.png'></a>\n      </div>\n    </div>  \n  ";
  $form["markup_paypal_beg"] = array(
    "#markup" => $html,
  );
  $form["save"] = array(
    "#type" => "submit",
    "#value" => t("Save position data *"),
    "#attributes" => array(
      "onClick" => "return arrangeFieldsSavePositions()",
    ),
  );
  $form["reset"] = array(
    "#type" => "button",
    "#value" => t("Reset position data"),
    "#attributes" => array(
      "onClick" => "return arrangeFieldsConfirmReset()",
    ),
  );
  $form["extra_markup_help"] = array(
    "#markup" => "<div style='font-size: 0.9em;'>" . t("* To ensure the correct hight of the form is saved, you may need\n                    to save position data twice, once you have finished arranging fields.") . "</div>",
  );
  return $form;
}