<commit_before><?php

namespace editingToolbar;
/**
 * This is frontend tool bar class render it self as well as tools
 */

class View_FrontToolBar extends \View{
	function init(){
		parent::init();
		
		// Get All Elements 
		$market_place = $this->add('Model_MarketPlace')->addCondition('type','element');
		foreach ($market_place->getRows() as $cmp) {
			foreach (new \DirectoryIterator(getcwd().DIRECTORY_SEPERATOR.'epan-components'.DIRECTORY_SEPERATOR.$cmp['namespace'].DIRECTORY_SEPERATOR.'lib'.DIRECTORY_SEPERATOR.'View'.DIRECTORY_SEPERATOR.'Tools') as $fileInfo) {
				if($fileInfo->isDot()) continue;
				$this->add($cmp['namespace'].'/View_Tools_'.trim($fileInfo->getFilename(),'.php'),null,'tools');
			}
		}

		if($this->api->edit_template){
			$this->add('templateRegions/View_Tools_MainContentRegion',null,'tools');
			// $this->add('templateRegions/View_Tools_EditableContentRegion',null,'tools');
		}

		// Get All INSTALLED Modules and Applications
		$installed_components  = $this->api->current_website->ref('InstalledComponents');
		// TODO DELETE FOLLOWING LINE
		// $componenet_j = $installed_components->join('epan_components_marketplace','component_id');
		$installed_components->addCondition('has_toolbar_tools',true);

		foreach ($installed_components as $junk) {
			// TODO DELETE FOLLOWING LINE
			// $cmp = $installed_components->ref('component_id');
			foreach (new \DirectoryIterator(getcwd().DIRECTORY_SEPERATOR.'epan-components'.DIRECTORY_SEPERATOR.$installed_components['namespace'].DIRECTORY_SEPERATOR.'lib'.DIRECTORY_SEPERATOR.'View'.DIRECTORY_SEPERATOR.'Tools') as $fileInfo) {
			    if($fileInfo->isDot()) continue;
			    // echo $fileInfo->getFilename() . "<br>\n";
				$this->add($installed_components['namespace'].'/View_Tools_'.trim($fileInfo->getFilename(),'.php'),null,'tools');
			}
		}

		$this->add('componentBase/View_CssOptions',null,'common_css_options')->js(true)->hide();
		$this->template->trySet('website_requested',$this->api->website_requested);
		$this->template->trySet('current_website_id',$this->api->current_website->id);
		$this->template->trySet('current_page_name',$this->api->current_page['name']);
		$this->template->trySet('current_page_id',$this->api->current_page->id);
		$this->template->trySet('current_template_id',$this->api->current_page['template_id']);
	}

	function defaultTemplate(){
		$l=$this->api->locate('addons',__NAMESPACE__, 'location');
		$this->api->pathfinder->addLocation(
			$this->api->locate('addons',__NAMESPACE__),
			array(
		  		'template'=>'templates',
		  		'css'=>'templates/css'
				)
			)->setParent($l);
		return array('view/editingToolbar-toolbar');
	}
} <commit_msg>edit template was saving to current page template rather then edit template query variable...bug fixed<commit_after><?php

namespace editingToolbar;
/**
 * This is frontend tool bar class render it self as well as tools
 */

class View_FrontToolBar extends \View{
	function init(){
		parent::init();
		
		// Get All Elements 
		$market_place = $this->add('Model_MarketPlace')->addCondition('type','element');
		foreach ($market_place->getRows() as $cmp) {
			foreach (new \DirectoryIterator(getcwd().DIRECTORY_SEPERATOR.'epan-components'.DIRECTORY_SEPERATOR.$cmp['namespace'].DIRECTORY_SEPERATOR.'lib'.DIRECTORY_SEPERATOR.'View'.DIRECTORY_SEPERATOR.'Tools') as $fileInfo) {
				if($fileInfo->isDot()) continue;
				$this->add($cmp['namespace'].'/View_Tools_'.trim($fileInfo->getFilename(),'.php'),null,'tools');
			}
		}

		if($this->api->edit_template){
			$this->add('templateRegions/View_Tools_MainContentRegion',null,'tools');
			// $this->add('templateRegions/View_Tools_EditableContentRegion',null,'tools');
		}

		// Get All INSTALLED Modules and Applications
		$installed_components  = $this->api->current_website->ref('InstalledComponents');
		// TODO DELETE FOLLOWING LINE
		// $componenet_j = $installed_components->join('epan_components_marketplace','component_id');
		$installed_components->addCondition('has_toolbar_tools',true);

		foreach ($installed_components as $junk) {
			// TODO DELETE FOLLOWING LINE
			// $cmp = $installed_components->ref('component_id');
			foreach (new \DirectoryIterator(getcwd().DIRECTORY_SEPERATOR.'epan-components'.DIRECTORY_SEPERATOR.$installed_components['namespace'].DIRECTORY_SEPERATOR.'lib'.DIRECTORY_SEPERATOR.'View'.DIRECTORY_SEPERATOR.'Tools') as $fileInfo) {
			    if($fileInfo->isDot()) continue;
			    // echo $fileInfo->getFilename() . "<br>\n";
				$this->add($installed_components['namespace'].'/View_Tools_'.trim($fileInfo->getFilename(),'.php'),null,'tools');
			}
		}

		$this->add('componentBase/View_CssOptions',null,'common_css_options')->js(true)->hide();
		$this->template->trySet('website_requested',$this->api->website_requested);
		$this->template->trySet('current_website_id',$this->api->current_website->id);
		$this->template->trySet('current_page_name',$this->api->current_page['name']);
		$this->template->trySet('current_page_id',$this->api->current_page->id);
		$this->template->trySet('current_template_id',$_GET['edit_template']?:$this->api->current_page['template_id']);
	}

	function defaultTemplate(){
		$l=$this->api->locate('addons',__NAMESPACE__, 'location');
		$this->api->pathfinder->addLocation(
			$this->api->locate('addons',__NAMESPACE__),
			array(
		  		'template'=>'templates',
		  		'css'=>'templates/css'
				)
			)->setParent($l);
		return array('view/editingToolbar-toolbar');
	}
} 
{'fraction_non_alphanumeric': 0.1836846929422548, 'fraction_numerical': 0.0, 'mean_word_length': 6.067357512953368, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 115, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1883750', 'n_tokens_mistral': 1900, 'n_tokens_neox': 1719, 'n_words': 208}