original_string: public static function getActionExplodedNames($name, $type, $urlPrefix = null)
      {
          // Site Search does not split Search keywords
          if ($type == Action::TYPE_SITE_SEARCH) {
              return array($name);
          }
  
          $name = str_replace("\n", "", $name);
  
          if ($type == Action::TYPE_PAGE_TITLE && self::$actionTitleCategoryDelimiter === '') {
              if ($name === '' || $name === false || $name === null || trim($name) === '') {
                  $name = self::getUnknownActionName($type);
              }
              return array(' ' . trim($name));
          }
  
          $name = self::parseNameFromPageUrl($name, $type, $urlPrefix);
  
          // outlinks and downloads
          if (is_array($name)) {
              return $name;
          }
  
          $split = self::splitNameByDelimiter($name, $type);
  
          if (empty($split)) {
              $defaultName = self::getUnknownActionName($type);
              return array(trim($defaultName));
          }
  
          $lastPageName = end($split);
          // we are careful to prefix the page URL / name with some value
          // so that if a page has the same name as a category
          // we don't merge both entries
          if ($type != Action::TYPE_PAGE_TITLE) {
              $lastPageName = '/' . $lastPageName;
          } else {
              $lastPageName = ' ' . $lastPageName;
          }
          $split[count($split) - 1] = $lastPageName;
          return array_values($split);
      }
code: public static function getActionExplodedNames($name, $type, $urlPrefix = null)
      {
          // Site Search does not split Search keywords
          if ($type == Action::TYPE_SITE_SEARCH) {
              return array($name);
          }
  
          $name = str_replace("\n", "", $name);
  
          if ($type == Action::TYPE_PAGE_TITLE && self::$actionTitleCategoryDelimiter === '') {
              if ($name === '' || $name === false || $name === null || trim($name) === '') {
                  $name = self::getUnknownActionName($type);
              }
              return array(' ' . trim($name));
          }
  
          $name = self::parseNameFromPageUrl($name, $type, $urlPrefix);
  
          // outlinks and downloads
          if (is_array($name)) {
              return $name;
          }
  
          $split = self::splitNameByDelimiter($name, $type);
  
          if (empty($split)) {
              $defaultName = self::getUnknownActionName($type);
              return array(trim($defaultName));
          }
  
          $lastPageName = end($split);
          // we are careful to prefix the page URL / name with some value
          // so that if a page has the same name as a category
          // we don't merge both entries
          if ($type != Action::TYPE_PAGE_TITLE) {
              $lastPageName = '/' . $lastPageName;
          } else {
              $lastPageName = ' ' . $lastPageName;
          }
          $split[count($split) - 1] = $lastPageName;
          return array_values($split);
      }
code_tokens: public static function getActionExplodedNames ( $ name , $ type , $ urlPrefix = null ) { // Site Search does not split Search keywords if ( $ type == Action :: TYPE_SITE_SEARCH ) { return array ( $ name ) ; } $ name = str_replace ( "\n" , "" , $ name ) ; if ( $ type == Action :: TYPE_PAGE_TITLE && self :: $ actionTitleCategoryDelimiter === '' ) { if ( $ name === '' || $ name === false || $ name === null || trim ( $ name ) === '' ) { $ name = self :: getUnknownActionName ( $ type ) ; } return array ( ' ' . trim ( $ name ) ) ; } $ name = self :: parseNameFromPageUrl ( $ name , $ type , $ urlPrefix ) ; // outlinks and downloads if ( is_array ( $ name ) ) { return $ name ; } $ split = self :: splitNameByDelimiter ( $ name , $ type ) ; if ( empty ( $ split ) ) { $ defaultName = self :: getUnknownActionName ( $ type ) ; return array ( trim ( $ defaultName ) ) ; } $ lastPageName = end ( $ split ) ; // we are careful to prefix the page URL / name with some value // so that if a page has the same name as a category // we don't merge both entries if ( $ type != Action :: TYPE_PAGE_TITLE ) { $ lastPageName = '/' . $ lastPageName ; } else { $ lastPageName = ' ' . $ lastPageName ; } $ split [ count ( $ split ) - 1 ] = $ lastPageName ; return array_values ( $ split ) ; }
docstring: Explodes action name into an array of elements.
  
  NOTE: before calling this function make sure ArchivingHelper::reloadConfig(); is called
  
  for downloads:
  we explode link http://piwik.org/some/path/piwik.zip into an array( 'piwik.org', '/some/path/piwik.zip' );
  
  for outlinks:
  we explode link http://dev.piwik.org/some/path into an array( 'dev.piwik.org', '/some/path' );
  
  for action urls:
  we explode link http://piwik.org/some/path into an array( 'some', 'path' );
  
  for action names:
  we explode name 'Piwik / Category 1 / Category 2' into an array('Matomo', 'Category 1', 'Category 2');
  
  @param string $name action name
  @param int $type action type
  @param int $urlPrefix url prefix (only used for TYPE_PAGE_URL)
  @return array of exploded elements from $name
docstring_tokens: Explodes action name into an array of elements .