You are here

function pathauto_punctuation_chars in Pathauto 6

Same name and namespace in other branches
  1. 5.2 pathauto.inc \pathauto_punctuation_chars()
  2. 6.2 pathauto.inc \pathauto_punctuation_chars()
  3. 7 pathauto.inc \pathauto_punctuation_chars()

Return an array of arrays for punctuation values.

Returns an array of arrays for punctuation values keyed by a name, including the value and a textual description. Can and should be expanded to include "all" non text punctuation values.

Return value

An array of arrays for punctuation values keyed by a name, including the value and a textual description.

3 calls to pathauto_punctuation_chars()
pathauto_admin_settings in ./pathauto.admin.inc
Form builder; Configure the Pathauto system.
pathauto_admin_settings_validate in ./pathauto.admin.inc
Validate pathauto_admin_settings form submissions.
pathauto_cleanstring in ./pathauto.inc
Clean up a string segment to be used in an URL alias.

File

./pathauto.inc, line 623
Miscellaneous functions for Pathauto.

Code

function pathauto_punctuation_chars() {
  static $punctuation;
  if (!isset($punctuation)) {
    $punctuation = array();
    $punctuation['double_quotes'] = array(
      'value' => '"',
      'name' => t('Double quotes "'),
    );
    $punctuation['quotes'] = array(
      'value' => "'",
      'name' => t("Single quotes (apostrophe) '"),
    );
    $punctuation['backtick'] = array(
      'value' => '`',
      'name' => t('Back tick `'),
    );
    $punctuation['comma'] = array(
      'value' => ',',
      'name' => t('Comma ,'),
    );
    $punctuation['period'] = array(
      'value' => '.',
      'name' => t('Period .'),
    );
    $punctuation['hyphen'] = array(
      'value' => '-',
      'name' => t('Hyphen -'),
    );
    $punctuation['underscore'] = array(
      'value' => '_',
      'name' => t('Underscore _'),
    );
    $punctuation['colon'] = array(
      'value' => ':',
      'name' => t('Colon :'),
    );
    $punctuation['semicolon'] = array(
      'value' => ';',
      'name' => t('Semicolon ;'),
    );
    $punctuation['pipe'] = array(
      'value' => '|',
      'name' => t('Pipe |'),
    );
    $punctuation['left_curly'] = array(
      'value' => '{',
      'name' => t('Left curly bracket {'),
    );
    $punctuation['left_square'] = array(
      'value' => '[',
      'name' => t('Left square bracket ['),
    );
    $punctuation['right_curly'] = array(
      'value' => '}',
      'name' => t('Right curly bracket }'),
    );
    $punctuation['right_square'] = array(
      'value' => ']',
      'name' => t('Right square bracket ]'),
    );
    $punctuation['plus'] = array(
      'value' => '+',
      'name' => t('Plus +'),
    );
    $punctuation['equal'] = array(
      'value' => '=',
      'name' => t('Equal ='),
    );
    $punctuation['asterisk'] = array(
      'value' => '*',
      'name' => t('Asterisk *'),
    );
    $punctuation['ampersand'] = array(
      'value' => '&',
      'name' => t('Ampersand &'),
    );
    $punctuation['percent'] = array(
      'value' => '%',
      'name' => t('Percent %'),
    );
    $punctuation['caret'] = array(
      'value' => '^',
      'name' => t('Caret ^'),
    );
    $punctuation['dollar'] = array(
      'value' => '$',
      'name' => t('Dollar $'),
    );
    $punctuation['hash'] = array(
      'value' => '#',
      'name' => t('Hash #'),
    );
    $punctuation['at'] = array(
      'value' => '@',
      'name' => t('At @'),
    );
    $punctuation['exclamation'] = array(
      'value' => '!',
      'name' => t('Exclamation !'),
    );
    $punctuation['tilde'] = array(
      'value' => '~',
      'name' => t('Tilde ~'),
    );
    $punctuation['left_parenthesis'] = array(
      'value' => '(',
      'name' => t('Left parenthesis ('),
    );
    $punctuation['right_parenthesis'] = array(
      'value' => ')',
      'name' => t('Right parenthesis )'),
    );
    $punctuation['question_mark'] = array(
      'value' => '?',
      'name' => t('Question mark ?'),
    );
    $punctuation['less_than'] = array(
      'value' => '<',
      'name' => t('Less than <'),
    );
    $punctuation['greater_than'] = array(
      'value' => '>',
      'name' => t('Greater than >'),
    );
    $punctuation['slash'] = array(
      'value' => '/',
      'name' => t('Slash /'),
    );
    $punctuation['back_slash'] = array(
      'value' => '\\',
      'name' => t('Backslash \\'),
    );
  }
  return $punctuation;
}