You are here

function uc_extra_fields_pane_help in Extra Fields Checkout Pane 7

Same name and namespace in other branches
  1. 6.2 uc_extra_fields_pane.module \uc_extra_fields_pane_help()

Implements hook_help().

Parameters

string $path:

array $arg:

Return value

string

File

./uc_extra_fields_pane.module, line 28
Module: uc_extra_fields_pane.module

Code

function uc_extra_fields_pane_help($path, $arg = array()) {
  switch ($path) {
    case 'admin/help#uc_extra_fields_pane':
      $output = '<p>' . t('This modules allows an administrator to define additional (billing and shipping) address fields (i.e. VAT) in Ubercart e-commerce suite. These fields will be available during checkout process and in order handling pages.') . '</p>';
      $output .= '<h2>' . t('Adding fields for checkout') . '</h2>';
      $output .= '<ul>';
      $output .= '<li>' . t('Extra address fields for the delivery and billing checkout panes can be added at the <a href="@address-fields-page-url">@address-fields-page-title</a> page.', array(
        '@address-fields-page-url' => url('admin/store/settings/countries/fields'),
        '@address-fields-page-title' => t('Address fields'),
      )) . '</li>';
      $output .= '</ul>';
      $output .= '<h2>' . t('About the field types') . '</h2>';
      $output .= '<ul>';
      $output .= '<li><strong>' . t('Textfield') . '</strong><br />' . t('This field type adds a simple text field to the form. This field can be pre-filled with a default value.') . '</li>';
      $output .= '<li><strong>' . t('Select list') . '</strong><br />' . t('This field type adds a selection field to the form (users can select a value from a dropdown menu). In the value section you can define the available options in the format "safe_key|readable part". The <em>safe_key</em> part is the part that will be saved in the database. The <em>readable</em> part is what will be presented to the user. IMPORTANT NOTE: if you want to make this field required, make sure that the first option of the list has an <em>empty</em> safe key. You can insert an empty safe key by typing a space. Example: !example', array(
        '!example' => '<br />' . UCXF_Field::get_example(UCXF_Field::UCXF_WIDGET_TYPE_SELECT),
      )) . '</li>';
      $output .= '<li><strong>' . t('Checkbox') . '</strong><br />' . t('This field type adds a checkbox to the form.') . '</li>';
      $output .= '<li><strong>' . t('Constant') . '</strong><br />' . t('This field type adds a value to the form which can not be changed by the customer. It is just displayed as plain text. However, admins who can change the Ubercart order are able to adjust the value of this field, because then it\'s displayed as a text field. Example: !example', array(
        '!example' => '<br />' . UCXF_Field::get_example(UCXF_Field::UCXF_WIDGET_TYPE_CONSTANT),
      )) . '</li>';
      $output .= '<li><strong>' . t('PHP string') . '</strong><br />' . t('This field type is similar to the constant field type. The difference is that the shown value can be defined with PHP code, which means you could get this value from everywhere. In the value section you should return a string, for example: !example', array(
        '!example' => '<br />' . UCXF_Field::get_example(UCXF_Field::UCXF_WIDGET_TYPE_PHP),
      )) . '</li>';
      $output .= '<li><strong>' . t('PHP select list') . '</strong><br />' . t("This field type is similar to the select list field type. The difference is that you can build the option list with PHP. Be sure to return an array with 'key' => 'value'. IMPORTANT NOTE: if you want to make this field required, make sure that the first option has an <em>empty</em> key. This may be a space, but it can also be an empty string. Example: !example", array(
        '!example' => '<br />' . UCXF_Field::get_example(UCXF_Field::UCXF_WIDGET_TYPE_PHP_SELECT),
      )) . '</li>';
      $output .= '</ul>';
      return $output;
    case 'admin/store/settings/countries/fields/add':
    case 'admin/store/settings/countries/fields/%/edit':
      if (module_exists('help')) {
        return t('For more help, visit the <a href="@help-page">Extra Fields Pane help page</a>.', array(
          '@help-page' => url('admin/help/uc_extra_fields_pane'),
        ));
      }
      else {
        drupal_set_message(t('If you <a href="@modules">enable the help module (Drupal core)</a>, Extra Fields Pane will provide an instruction page about the field types. Alternatively, you can find this information also in the README-file.', array(
          '@modules' => url('admin/modules'),
        )));
      }
  }
}