<commit_before><?php
/**
* A heading content item is simply a heading string enclosed within one of the 
* six standard heading types, H1 through H6. The styles for the headings will 
* have already been output in the top of the view script, only custom style 
* options will be added here
*
* @author <NAME> <<EMAIL>>
* @copyright G3D Development Limited
*/
class Dlayer_View_ContentHeading extends Zend_View_Helper_Abstract
{
	/**
	* Override the hinting for the view property so that we can see the view
	* helpers that have been defined
	*
	* @var Dlayer_View_Codehinting
	*/
	public $view;

	/**
	* Data array for the heading
	*
	* @var array
	*/
	private $data = array();

	/**
	* Is the content item currently selectable? 
	* 
	* @var boolean
	*/
	private $selectable;

	/**
	* Is the content item currently selected withing the designer view?
	*
	* @var boolean
	*/
	private $selected;

	/**
	* The number of content items in the content row
	* 
	* @param integer
	*/
	private $items;

	/**
	* A heading content item is simply a heading string enclosed within one 
	* of the six standard heading types, H1 through H6. The styles for the 
	* headings will have already been output in the top of the view script, 
	* only custom style options will be added here
	*
	* @param array $data Content data array. containns all the data required 
	* 	to generate the html for the heading content item
	* @param boolean $selectable Should the selectable class be applied to the 
	* 	content item, a content item is selectable when its content row has 
	* 	been selected
	* @param boolean $selected Should the selected class be applied to the 
	* 	content item, an item is selected when in edit mode, either by being 
	* 	selectable directly or after addition
	* @param integer $items The total number of content items within the 
	* 	content row, this is to help with the addition of the visual movment 
	* 	controls
	* @return Dlayer_View_ContentHeading
	*/
	public function contentHeading(array $data, $selectable=FALSE,
		$selected=FALSE, $items=1)
	{
		$this->resetParams();

		$this->data = $data;
		$this->selectable = $selectable;
		$this->selected = $selected;
		$this->items = $items;

		return $this;
	}

	/**
	* Reset any internal params, we need to reset the params for the view 
	* helper in case it is called multiple times within the same view
	*
	* @return void
	*/
	private function resetParams()
	{
		$this->data = NULL;
		$this->selectable = FALSE;
		$this->selected = FALSE;
	}

	/**
	* This is the worker method for the view helper, it generates the html 
	* for the content item and the html for the content item container and 
	* the movement controls
	*
	* @return string The generated html
	*/
	private function render()
	{
		$tag = $this->view->escape($this->data['tag']);

		/**
		* The id for a content item is defined as the content type, 
		* tool used to create the item and then the id for the content item, 
		* this allows the selectors to set the correct environment vars
		*/
		$id = 'heading:heading:' . $this->view->escape(
			$this->data['content_id']);
		$container_class = 'item content-container-' .  $this->view->escape(
			$this->data['content_id']);
		$content_class = 'content-' . $this->view->escape(
			$this->data['content_id']);
			
		if($this->selectable == TRUE) {
			if($this->selected == FALSE) {
				$container_class .= ' selectable';
			} else {
				$container_class .= ' selected-item';
			}
		}
		
		if($this->data['size'] != NULL) {
			$width = 'col-md-' . $this->view->escape($this->data['size']);
		} else {
			$width = 'col-md-12';
		}
		
		if($this->data['offset'] != NULL) {
			$width .= ' col-md-offset-' . $this->view->escape(
				$this->data['offset']);
		}
		
		$container_styles = $this->view->contentContainerStyles()->contentItem(
			$this->data['content_id']);
			
		$content_item_styles = $this->view->contentItemStyles()->contentItem(
			$this->data['content_id']);
			
		$html = '<div class="' . $width . ' ' . $container_class . '"' . 
			' id="' . $id . '"';
		$html .= $container_styles;
		$html .= '>';
		$html .= '<' . $tag . ' class="' . $content_class . '"'; 
		$html .= $content_item_styles;
		$html .= '>';
		$html .= $this->view->escape($this->data['heading']);
		
		if(strlen($this->data['sub_heading']) > 0) {
			$html .= ' <small>' . $this->view->escape(
				$this->data['sub_heading']) . '</small>';
		}
		
		$html .= '</' . $tag . '>';
		$html .= '</div>';<commit_msg>Heading content item<commit_after><?php
/**
* A heading content item is simply a heading string enclosed within one of the 
* six standard heading types, H1 through H6. The styles for the headings will 
* have already been output in the top of the view script, only custom style 
* options will be added here
*
* @author <NAME> <<EMAIL>>
* @copyright G3D Development Limited
*/
class Dlayer_View_ContentHeading extends Zend_View_Helper_Abstract
{
	/**
	* Override the hinting for the view property so that we can see the view
	* helpers that have been defined
	*
	* @var Dlayer_View_Codehinting
	*/
	public $view;

	/**
	* Data array for the heading
	*
	* @var array
	*/
	private $data = array();

	/**
	* Is the content item currently selectable? 
	* 
	* @var boolean
	*/
	private $selectable;

	/**
	* Is the content item currently selected withing the designer view?
	*
	* @var boolean
	*/
	private $selected;

	/**
	* The number of content items in the content row
	* 
	* @param integer
	*/
	private $items;

	/**
	* A heading content item is simply a heading string enclosed within one 
	* of the six standard heading types, H1 through H6. The styles for the 
	* headings will have already been output in the top of the view script, 
	* only custom style options will be added here
	*
	* @param array $data Content data array. containns all the data required 
	* 	to generate the html for the heading content item
	* @param boolean $selectable Should the selectable class be applied to the 
	* 	content item, a content item is selectable when its content row has 
	* 	been selected
	* @param boolean $selected Should the selected class be applied to the 
	* 	content item, an item is selected when in edit mode, either by being 
	* 	selectable directly or after addition
	* @param integer $items The total number of content items within the 
	* 	content row, this is to help with the addition of the visual movment 
	* 	controls
	* @return Dlayer_View_ContentHeading
	*/
	public function contentHeading(array $data, $selectable=FALSE,
		$selected=FALSE, $items=1)
	{
		$this->resetParams();

		$this->data = $data;
		$this->selectable = $selectable;
		$this->selected = $selected;
		$this->items = $items;

		return $this;
	}

	/**
	* Reset any internal params, we need to reset the params for the view 
	* helper in case it is called multiple times within the same view
	*
	* @return void
	*/
	private function resetParams()
	{
		$this->data = NULL;
		$this->selectable = FALSE;
		$this->selected = FALSE;
	}

	/**
	* This is the worker method for the view helper, it generates the html 
	* for the content item and the html for the content item container and 
	* the movement controls
	*
	* @return string The generated html
	*/
	private function render()
	{
		$tag = $this->view->escape($this->data['tag']);

		/**
		* The id for a content item is defined as the content type, 
		* tool used to create the item and then the id for the content item, 
		* this allows the selectors to set the correct environment vars
		*/
		$id = 'heading:heading:' . $this->view->escape(
			$this->data['content_id']);
		$container_class = 'item content-container-' .  $this->view->escape(
			$this->data['content_id']);
		$content_class = 'content-' . $this->view->escape(
			$this->data['content_id']);
			
		if($this->selectable == TRUE) {
			if($this->selected == FALSE) {
				$container_class .= ' selectable';
			} else {
				$container_class .= ' selected-item';
			}
		}
		
		if($this->data['size'] != NULL) {
			$width = 'col-md-' . $this->view->escape($this->data['size']);
		} else {
			$width = 'col-md-12';
		}
		
		if($this->data['offset'] != NULL) {
			$width .= ' col-md-offset-' . $this->view->escape(
				$this->data['offset']);
		}
		
		$container_styles = $this->view->contentContainerStyles()->contentItem(
			$this->data['content_id']);
			
		$content_item_styles = $this->view->contentItemStyles()->contentItem(
			$this->data['content_id']);
			
		$html = '<div class="' . $width . ' ' . $container_class . '"' . 
			' id="' . $id . '"';
		$html .= $container_styles;
		$html .= '>';
		$html .= '<' . $tag . ' class="' . $content_class . '"'; 
		$html .= $content_item_styles;
		$html .= '>';
		$html .= $this->view->escape($this->data['heading']);
		
		$html .= ' <small>';
		
		if(strlen($this->data['sub_heading']) > 0) {
			$html .= $this->view->escape($this->data['sub_heading']);
		}
		
		$html .= '</small>';
		
		$html .= '</' . $tag . '>';
		$html .= '</div>';
{'fraction_non_alphanumeric': 0.1407158836689038, 'fraction_numerical': 0.0020134228187919465, 'mean_word_length': 3.3487354085603114, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '657151', 'n_tokens_mistral': 3058, 'n_tokens_neox': 2774, 'n_words': 954}