original_string: public static function parse_toolbar_setting($customtoolbar) {
          $result = array();
          $customtoolbar = trim($customtoolbar);
          if ($customtoolbar === '') {
              return $result;
          }
          $customtoolbar = str_replace("\r", "\n", $customtoolbar);
          $customtoolbar = strtolower($customtoolbar);
          $i = 0;
          foreach (explode("\n", $customtoolbar) as $line) {
              $line = preg_replace('/[^a-z0-9_,\|\-]/', ',', $line);
              $line = str_replace('|', ',|,', $line);
              $line = preg_replace('/,,+/', ',', $line);
              $line = trim($line, ',|');
              if ($line === '') {
                  continue;
              }
              if ($i == 10) {
                  // Maximum is ten lines, merge the rest to the last line.
                  $result[9] = $result[9].','.$line;
              } else {
                  $result[] = $line;
                  $i++;
              }
          }
          return $result;
      }
code: public static function parse_toolbar_setting($customtoolbar) {
          $result = array();
          $customtoolbar = trim($customtoolbar);
          if ($customtoolbar === '') {
              return $result;
          }
          $customtoolbar = str_replace("\r", "\n", $customtoolbar);
          $customtoolbar = strtolower($customtoolbar);
          $i = 0;
          foreach (explode("\n", $customtoolbar) as $line) {
              $line = preg_replace('/[^a-z0-9_,\|\-]/', ',', $line);
              $line = str_replace('|', ',|,', $line);
              $line = preg_replace('/,,+/', ',', $line);
              $line = trim($line, ',|');
              if ($line === '') {
                  continue;
              }
              if ($i == 10) {
                  // Maximum is ten lines, merge the rest to the last line.
                  $result[9] = $result[9].','.$line;
              } else {
                  $result[] = $line;
                  $i++;
              }
          }
          return $result;
      }
code_tokens: public static function parse_toolbar_setting ( $ customtoolbar ) { $ result = array ( ) ; $ customtoolbar = trim ( $ customtoolbar ) ; if ( $ customtoolbar === '' ) { return $ result ; } $ customtoolbar = str_replace ( "\r" , "\n" , $ customtoolbar ) ; $ customtoolbar = strtolower ( $ customtoolbar ) ; $ i = 0 ; foreach ( explode ( "\n" , $ customtoolbar ) as $ line ) { $ line = preg_replace ( '/[^a-z0-9_,\|\-]/' , ',' , $ line ) ; $ line = str_replace ( '|' , ',|,' , $ line ) ; $ line = preg_replace ( '/,,+/' , ',' , $ line ) ; $ line = trim ( $ line , ',|' ) ; if ( $ line === '' ) { continue ; } if ( $ i == 10 ) { // Maximum is ten lines, merge the rest to the last line. $ result [ 9 ] = $ result [ 9 ] . ',' . $ line ; } else { $ result [ ] = $ line ; $ i ++ ; } } return $ result ; }
docstring: Parse the custom toolbar setting.
  @param string $customtoolbar
  @return array csv toolbar lines
docstring_tokens: Parse the custom toolbar setting .