Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-55

Wipe out static class variables containing localisable strings

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Blocker
    • Resolution: Fixed/Completed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: Internationalisation
    • Labels:
      None

      Description

      We need some kind of a resolution for the problem of localisable strings appearing in static class properties. As in following example, we need to apply ts() function to "title" and "extra" array values, but with static property it's not possible.

      class CRM_Admin_Page_Category extends CRM_Core_Page_Basic {
      /**

      • The action links that we need to display for the browse screen
        *
      • @var array
        */
        static $_links = array(
        CRM_Core_Action::UPDATE => array(
        'name' => 'Edit',
        'url' => 'civicrm/admin/category',
        'qs' => 'action=update&id=%%id%%',
        'title' => 'Edit Category'),

      CRM_Core_Action::DELETE => array(
      'name' => 'Delete',
      'url' => 'civicrm/admin/category',
      'qs' => 'action=delete&id=%%id%%',
      'extra' => 'onclick = "return confirm(\'Are you sure you want to delete this category.\n\nThis category will be removed from any currently tagged contacts, and users will no longer be able to assign contacts to this category.\');"',
      'title' => 'Delete Category',
      ),
      );

        Attachments

          Activity

            People

            • Assignee:
              mover Michał Mach
              Reporter:
              mover Michał Mach
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: