Editor toolbar

Before you ask see the Phoca Guestbook User Manual
kokoro
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 03 Aug 2016, 18:41

Editor toolbar

Post by kokoro » 08 Mar 2018, 21:34

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.


User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 40121
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Editor toolbar

Post by Jan » 09 Mar 2018, 16:37

Hi, confirmed, the options path changed in editors, will be fixed in next version:

Image

Thank you for the info.
Jan
If you find Phoca extensions useful, please support the project

kokoro
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 03 Aug 2016, 18:41

Re: Editor toolbar

Post by kokoro » 09 Mar 2018, 16:39

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'.

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 40121
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Editor toolbar

Post by Jan » 09 Mar 2018, 16:43

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');
If you find Phoca extensions useful, please support the project

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 40121
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Editor toolbar

Post by Jan » 09 Mar 2018, 17:41

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
If you find Phoca extensions useful, please support the project

Post Reply