You are here

help.inc in Mobile Codes 6.2

Same filename and directory in other branches
  1. 7.2 includes/help.inc

Help module integration.

File

includes/help.inc
View source
<?php

/**
 * @file
 * Help module integration.
 */

/**
 * Implements hook_help().
 */
function mobile_codes_help($path, $arg) {
  switch ($path) {
    case 'admin/help#mobile_codes':
      ctools_include('export');
      foreach (ctools_export_crud_load_all('mobile_codes_presets') as $preset) {
        if (!$preset->disabled) {
          $active_preset = $preset;
          break;
        }
      }
      $mobile_code = isset($active_preset) ? theme('mobilecode', 'http://stuar.tc/lark/s/module/s/mobile_codes', array(
        '#preset' => $active_preset->name,
      ), '', '', array(
        'style' => 'float: right;',
      )) : '';
      return $mobile_code . "<p>\n" . '  ' . t('The Mobile Codes module provides the ability to render Text, URLs or any other form of informaton as a Mobile Code, including but not limited to the QR and Datamatrix formats, providing a simple way of transfering said information from the screen to a Mobile phone.') . "\n" . "</p>\n" . "<p>&nbsp;</p>\n" . '<h3>' . t('Creating Mobile Codes') . "</h3>\n" . "<p>\n" . '  ' . t('Mobile Codes can be created via three different methods') . ":\n" . "</p>\n" . "<ul>\n" . "  <li>\n" . '    <strong>' . t('CCK/Views formatters') . "</strong>\n" . "    <p>\n" . '      ' . t('A CCK/Views formatter is automatically created for each Mobile Codes Preset, the formatters are available for use with the following field types') . ":\n" . "    </p>\n" . "    <ul>\n" . '      <li>' . t('!cck Text field', array(
        '!cck' => l('CCK', 'http://drupal.org/project/cck'),
      )) . "</li>\n" . '      <li>' . t('!link module field', array(
        '!link' => l('Link', 'http://drupal.org/project/link'),
      )) . "</li>\n" . '      <li>' . t('!filefield module field', array(
        '!filefield' => l('FileField', 'http://drupal.org/project/filefield'),
      )) . "</li>\n" . "    </ul>\n" . "    <p>\n" . '      ' . t('Formatters can be assigned either via a Content types Display settings page or on a View.') . "\n" . "    </p>\n" . "    <p>\n" . '      ' . t('Additionally, a !custom_formatters example is provided to demonstrates how to provide support for additional CCK fields.', array(
        '!custom_formatters' => l('Custom Formatters', 'http://drupal.org/project/custom_foramtters'),
      )) . "\n" . "    </p>\n" . "    <p>&nbsp;</p>\n" . "  </li>\n" . "  <li>\n" . '    <strong>' . t('Input filter') . "</strong>\n" . "    <p>\n" . '      ' . t('For use inside a Node body, or any Text fields using an Input format, Mobile Codes can be generated using the following format') . ":<br />\n" . "      <code>\n" . "        [mobilecode #preset='<strong>preset</strong>']<strong>data</strong>[/mobilecode]\n" . "      </code>\n" . "    </p>\n" . "    <p>\n" . '      <strong>' . t('Note') . ':</strong> ' . t('Be sure to enable the Mobile Codes filter on all required Input formats.') . "\n" . "    </p>\n" . "    <p>&nbsp;</p>\n" . "  </li>\n" . "  <li>\n" . '    <strong>' . t('theme_mobilecode()') . "</strong>\n" . "    <p>\n" . '      ' . t('For use in code, the theme function can be called directly with the following format') . ":<br />\n" . "      <code>theme('mobilecode', <strong>\$data</strong>, array('#preset' => <strong>\$preset</strong>))</code>\n" . "    </p>\n" . "    <p>&nbsp;</p>\n" . "  </li>\n" . "</ul>\n" . "<p>&nbsp;</p>\n" . '<h3>' . t('Geneal configuration') . "</h3>\n" . "<p>\n" . '  ' . t('General configuration for Mobile Codes can be found at:') . "<br />\n" . '  &nbsp;&nbsp;' . l(url('admin/settings/mobile_codes', array(
        'absolute' => TRUE,
      )), url('admin/settings/mobile_codes', array(
        'absolute' => TRUE,
      ))) . "\n" . "</p>\n" . "<p>\n" . '  ' . t('There are three sections in the Mobile Code configuration') . ":\n" . "</p>\n" . "<ul>\n" . "  <li>\n" . '    <strong>' . t('Presets') . "</strong>\n" . "    <p>\n" . '      ' . t('Presets contain the required settings for a chosen Provider, defining the Size, Color or any other available attribute available to the Provider.') . "\n" . "    </p>\n" . "    <p>\n" . '      ' . t('Required settings for a Preset is completely reliant on the chosen Provider.') . "\n" . "    </p>\n" . "    <p>&nbsp;</p>\n" . "  </li>\n" . "  <li><strong>" . t('Providers') . "</strong>\n" . "    <p>\n" . '      ' . t('Providers are the service providers that create the Mobile Codes.') . "\n" . "    </p>\n" . "    <p>\n" . '      ' . t('A provider can be either external (like !nokia or !google) or internal (like the !phpqrcode library), but the configuration is the same:', array(
        '!nokia' => l('Nokia Mobile Codes', 'http://mobilecodes.nokia.com'),
        '!google' => l('Google QR Codes', 'https://code.google.com/apis/chart/docs/gallery/qr_codes.html'),
        '!phpqrcode' => l('PHP QR Code', 'http://phpqrcode.sourceforge.net/'),
      )) . "\n" . "    </p>\n" . "    <ol>\n" . "      <li>\n" . '        ' . t('Add an API URL with the user-definable attributes replaced with tokens') . "\n" . "        <p>\n" . '          <strong>' . t('Example') . ":</strong><br />\n" . "          https://chart.googleapis.com/chart?chs=[width]x[height]&cht=qr&chl=[data]&choe=[output_encoding]\n" . "        </p>\n" . "      </li>\n" . "      <li>\n" . '        ' . t('Provide the required settings for attributes') . ":\n" . "        <dl>\n" . '          <dt><strong>' . t('Label') . "</strong></dt>\n" . '          <dd>' . t('The human readable name of the attribute.') . "</dd>\n" . '          <dt><strong>' . t('Type') . "</strong></dt>\n" . '          <dd>' . t('The type of field to provide to the Presets form.') . "</dd>\n" . '          <dt><strong>' . t('Values') . "</strong></dt>\n" . '          <dd>' . t('The available values (formatted as "key|label", one item per line) to provide the Presets form if the Type is "Selectbox".') . "</dd>\n" . "        </dl>\n" . "      </li>\n" . "    </ol>\n" . '    <strong>' . t('Note') . ':</strong> ' . t('There should always be one attribute with the Type "Data", otherwise the Mobile Codes content will not be user-definable.') . "\n" . "    <p>&nbsp;</p>\n" . "  </li>\n" . "  <li><strong>" . t('Settings') . "</strong>\n" . "    <p>\n" . '      ' . t('All other general settings, such as Data type based alterations, can be found here. Additional settings can be added by third-party modules.') . "\n" . "    </p>\n" . "  </li>\n" . "</ul>\n" . "<p>&nbsp;</p>\n" . '<h3>' . t('Setting up the PHP QR Code library') . "</h3>\n" . "<p>\n" . '  ' . t('The PHP QR Code library is an opensource PHP based QR Code generator that can be used to create QR Codes locally instead of relying on an external Mobile Code generator.') . "\n" . "</p>\n" . "<p>\n" . '  ' . t('Follow these steps to set it up') . ":\n" . "</p>\n" . "<ol>\n" . '  <li>' . t('Download, install and enable the !libraries module.', array(
        '!libraries' => l('Libraries API', 'http://drupal.org/project/libraries'),
      )) . "</li>\n" . '  <li>' . t('Download the !phpqrcode library.', array(
        '!phpqrcode' => l('PHP QR Code', 'http://sourceforge.net/projects/phpqrcode/files/releases/phpqrcode-2010100721_1.1.4.zip/download'),
      )) . "</li>\n" . "  <li>\n" . '    ' . t('Extract the PHP QR Code library to your Libraries directory.') . "<br />\n" . "    <strong>e.g.,</strong> sites/all/libraries/phpqrcode\n" . "  </li>\n" . '  <li>' . t('Clear cached data from the !performance page.', array(
        '!performance' => l(t('Performance'), 'admin/settings/performance'),
      )) . "</li>\n" . "</ol>\n" . "<p>&nbsp;</p>\n";
  }
}

Functions

Namesort descending Description
mobile_codes_help Implements hook_help().