Bludit v1.0.2 "Vector II"

Locked
User avatar
diego
Site Admin
Posts: 711
Joined: Sat May 16, 2015 2:53 pm
Contact:

Tue Feb 02, 2016 4:09 am

Bludit v1.0.2
Codename: Vector II
Release date: 2016-02-01

More information: http://blog.bludit.com/en/post/bludit-v102-vector-ii
User avatar
Herk
Sr. Bludit
Posts: 38
Joined: Wed Aug 19, 2015 8:31 am

Fri Feb 12, 2016 9:54 am

Can you fix TinyMCE 4.3.3 to work with New Menu V8
User avatar
diego
Site Admin
Posts: 711
Joined: Sat May 16, 2015 2:53 pm
Contact:

Fri Feb 12, 2016 10:58 pm

Menu v8 is not implemented on Bludit v1.0.2, it just a beta on github.

Try with this plugin.php for tinymce:

Code: Select all

<?php

class pluginTinymce extends Plugin {

	private $loadWhenController = array(
		'new-post',
		'new-page',
		'edit-post',
		'edit-page'
	);

	public function init()
	{
		$this->dbFields = array(
			'plugins'=>'autoresize, fullscreen, pagebreak, link, textcolor, code, image, paste',
			'toolbar'=>'bold italic underline strikethrough | alignleft aligncenter alignright | bullist numlist | styleselect | link forecolor backcolor removeformat image | pagebreak code fullscreen'
		);
	}

	public function form()
	{
		global $Language;

		$html  = '<div>';
		$html .= '<label>Tinymce plugins</label>';
		$html .= '<input name="plugins" id="jsplugins" type="text" value="'.$this->getDbField('plugins').'">';
		$html .= '</div>';

		$html .= '<div>';
		$html .= '<label>Tinymce toolbar</label>';
		$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getDbField('toolbar').'">';
		$html .= '</div>';

		return $html;
	}

	public function adminHead()
	{
		global $Language;
		global $Site;
		global $layout;

		$html = '';

		// Load CSS and JS only on Controllers in array.
		if(in_array($layout['controller'], $this->loadWhenController))
		{
			$language = $Site->shortLanguage();
			$pluginPath = $this->htmlPath();

			$html  = '<script src="'.$pluginPath.'tinymce/tinymce.min.js"></script>';
		}

		return $html;
	}

	public function adminBodyEnd()
	{
		global $Language;
		global $Site;
		global $layout;

		$html = '';

		// Load CSS and JS only on Controllers in array.
		if(in_array($layout['controller'], $this->loadWhenController))
		{
			$pluginPath = $this->htmlPath();

			$language = '';
			if($Site->shortLanguage()!=='en') {
				if(file_exists($this->phpPath().'tinymce/langs/'.$Site->shortLanguage().'.js')) {
					$language = 'language_url:"'.$pluginPath.'tinymce/langs/'.$Site->shortLanguage().'.js",';
				}
			}

			$html  = '<script>$(document).ready(function() { ';
			$html .= 'tinymce.init({
				selector: "#jscontent",
				cache_suffix: "?v='.$this->version().'",
				element_format : "html",
				entity_encoding : "raw",
				schema: "html5",
				extended_valid_elements : "a[class|name|href|target|title|onclick|rel],script[type|src],iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]",
				plugins: "'.$this->getDbField('plugins').'",
				toolbar: "'.$this->getDbField('toolbar').'",
				content_css: "'.$pluginPath.'css/editor.css",
				theme: "modern",
				height:"400px",
				width:"100%",
				statusbar: false,
				menubar:false,
				'.$language.'
				browser_spellcheck: true,
				autoresize_bottom_margin: "50",
				pagebreak_separator: "'.PAGE_BREAK.'",
				paste_as_text: true,
    				document_base_url: "'.HTML_PATH_UPLOADS.'"
			});';

			// This function is necesary on each Editor, it is used by Bludit Images v8.
			$html .= 'function editorAddImage(filename) {
					tinymce.activeEditor.insertContent("<img src=\""+filename+"\" alt=\"\">" + "\n");
				}'.PHP_EOL;

			$html .= '}); </script>';
		}

		return $html;
	}
}
User avatar
Herk
Sr. Bludit
Posts: 38
Joined: Wed Aug 19, 2015 8:31 am

Mon Feb 15, 2016 7:18 am

Thanks Diego, Unfortunately is not working :(
User avatar
diego
Site Admin
Posts: 711
Joined: Sat May 16, 2015 2:53 pm
Contact:

Thu Feb 18, 2016 11:07 pm

Herk wrote:Thanks Diego, Unfortunately is not working :(
I updated Tinymce plugin for Bludit v1.1
Locked