src/View/Helper/TimelineHelper.php
protected function _format($items) {
		$e = [];
		foreach ($items as $item) {
			$tmp = [];
			foreach ($item as $key => $row) {
				switch ($key) {
					case 'editable':
						$tmp[] = $row ? 'true' : 'false';
						break;
					case 'start':
					case 'end':
						$tmp[] = '\'' . $key . '\': ' . $this->_date($row);
						break;
					default:
						$tmp[] = '\'' . $key . '\': \'' . str_replace('\'', '\\\'', $row) . '\'';
				}
			}
			$e[] = '{' . implode(',' . PHP_EOL, $tmp) . '}';
		}
		$string = '[' . implode(',' . PHP_EOL, $e) . '];';
		return $string;
	}
protected function _format($items) {
		$e = [];
		foreach ($items as $item) {
			$tmp = [];
			foreach ($item as $key => $row) {
				switch ($key) {
					case 'editable':
						$tmp[] = $row ? 'true' : 'false';
						break;
					case 'start':
					case 'end':
						$tmp[] = '\'' . $key . '\': ' . $this->_date($row);
						break;
					default:
						$tmp[] = '\'' . $key . '\': \'' . str_replace('\'', '\\\'', $row) . '\'';
				}
			}
			$e[] = '{' . implode(',' . PHP_EOL, $tmp) . '}';
		}
		$string = '[' . implode(',' . PHP_EOL, $e) . '];';
		return $string;
	}
protected function _format ( $ items ) { $ e = [ ] ; foreach ( $ items as $ item ) { $ tmp = [ ] ; foreach ( $ item as $ key => $ row ) { switch ( $ key ) { case 'editable' : $ tmp [ ] = $ row ? 'true' : 'false' ; break ; case 'start' : case 'end' : $ tmp [ ] = '\'' . $ key . '\': ' . $ this -> _date ( $ row ) ; break ; default : $ tmp [ ] = '\'' . $ key . '\': \'' . str_replace ( '\'' , '\\\'' , $ row ) . '\'' ; } } $ e [ ] = '{' . implode ( ',' . PHP_EOL , $ tmp ) . '}' ; } $ string = '[' . implode ( ',' . PHP_EOL , $ e ) . '];' ; return $ string ; }
Format items to JS code

@see \Tools\View\Helper\TimelineHelper::addItem()
@param array $items
@return string
Format items to JS code