Horde::stripAccessKey PHP Method

stripAccessKey() public static method

For multibyte charset strings the access key gets removed completely, otherwise only the underscore gets removed.
public static stripAccessKey ( string $label ) : string
$label string The label containing an access key.
return string The label with the access key being stripped.
    public static function stripAccessKey($label)
    {
        $replace = $GLOBALS['registry']->nlsconfig->curr_multibyte && preg_match('/[\\x80-\\xff]/', $label) ? '' : '$1';
        return preg_replace('/_(\\w)/u', $replace, $label);
    }

Usage Example

Beispiel #1
0
 /**
  */
 public function perms()
 {
     $permissions = array('max_blocks' => array('title' => _("Maximum Number of Portal Blocks"), 'type' => 'int'), 'administration' => array('title' => _("Administration")));
     if (!empty($GLOBALS['conf']['activesync']['enabled'])) {
         $this->_addActiveSyncPerms($permissions);
     }
     try {
         foreach ($GLOBALS['registry']->callByPackage('horde', 'admin_list') as $perm_key => $perm_details) {
             $permissions['administration:' . $perm_key] = array('title' => Horde::stripAccessKey($perm_details['name']));
         }
     } catch (Horde_Exception $e) {
         /*what to do if this fails?*/
     }
     return $permissions;
 }
All Usage Examples Of Horde::stripAccessKey