Page 1 of 1

Editor toolbar

Posted: 08 Mar 2018, 21:34
by kokoro
Hi,

I'm developping a multilingual site (french and german).

There is a problem in the front end form.
The editor toolbar is in english although the languages files are installed (for Phoca Guestbook and Tiny Mce).
In the Tiny mce parameters, the option "Detect the language" is checked !

Any idea ?

Thank you.

Re: Editor toolbar

Posted: 09 Mar 2018, 16:37
by Jan
Hi, confirmed, the options path changed in editors, will be fixed in next version:

Image

Thank you for the info.
Jan

Re: Editor toolbar

Posted: 09 Mar 2018, 16:39
by kokoro
I've founded the problem.

There is an error in the file ..\components\com_phocaguestbook\models\fields\phocaeditor.php line 68.

Code: Select all

$langPrefix      = $paramsE->get('lang_code','en');
The lang prefix is forced to "en'.

The right code is :

Code: Select all

$langPrefix = $paramsE->get('lang_code', substr(strval($language->getTag()), 0,2));
with a variable instead of 'en'.

Re: Editor toolbar

Posted: 09 Mar 2018, 16:43
by Jan
It needs to be accepted the option of the plugin if the language should be changed or not

Code: Select all

$user     = JFactory::getUser();
			$language = JFactory::getLanguage();
			$theme    = 'modern';
			$ugroups  = array_combine($user->getAuthorisedGroups(), $user->getAuthorisedGroups());

			// Prepare the parameters
			$levelParams      = new Joomla\Registry\Registry;
			$extraOptions     = new stdClass;
			$toolbarParams    = new stdClass;
			
			$configuration	= $paramsE->get('configuration');
			
			$extraOptionsAll  = $configuration->setoptions;
			$toolbarParamsAll = $configuration->toolbars;

			// Get configuration depend from User group
			foreach ($extraOptionsAll as $set => $val)
			{
				$val->access = empty($val->access) ? array() : $val->access;

				// Check whether User in one of allowed group
				foreach ($val->access as $group)
				{
					if (isset($ugroups[$group]))
					{
						$extraOptions  = $val;
						$toolbarParams = $toolbarParamsAll->$set;
					}
				}
			}

			// Merge the params
			$levelParams->loadObject($toolbarParams);
			$levelParams->loadObject($extraOptions);

			// List the skins
			$skindirs = glob(JPATH_ROOT . '/media/editors/tinymce/skins' . '/*', GLOB_ONLYDIR);

			// Set the selected skin
			$skin = 'lightgray';
			$side = $app->isClient('administrator') ? 'skin_admin' : 'skin';

			if ((int) $levelParams->get($side, 0) < count($skindirs))
			{
				$skin = basename($skindirs[(int) $levelParams->get($side, 0)]);
			}

			$langMode   = $levelParams->get('lang_mode', 1);
			$langPrefix = $levelParams->get('lang_code', 'en');

Re: Editor toolbar

Posted: 09 Mar 2018, 17:41
by Jan
Hi, set in version 3.0.7:

https://www.phoca.cz/news/963-phoca-gue ... 7-released

Please test and let me know.

Thank you, Jan