Skip to content

Commit

Permalink
Merge pull request #1 from zero-24/patch-4
Browse files Browse the repository at this point in the history
A few minor cs fixes ;)
  • Loading branch information
chmst committed Apr 22, 2016
2 parents 2143527 + b91c6d5 commit 4df0f9d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
33 changes: 17 additions & 16 deletions plugins/editors/tinymce/tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,23 @@ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons
if ($this->params->get('use_config_textfilters', 0))
{
// Use filters from com_config
$filter = self::getGlobalFilters();
$filter = $this->getGlobalFilters();

$tagBlacklist = !empty($filter->tagBlacklist) ? $filter->tagBlacklist : array();
$tagBlacklist = !empty($filter->tagBlacklist) ? $filter->tagBlacklist : array();
$attrBlacklist = !empty($filter->attrBlacklist) ? $filter->attrBlacklist : array();
$tagArray = !empty($filter->tagArray) ? $filter->tagArray : array();
$attrArray = !empty($filter->attrArray) ? $filter->attrArray : array();
$tagArray = !empty($filter->tagArray) ? $filter->tagArray : array();
$attrArray = !empty($filter->attrArray) ? $filter->attrArray : array();

$invalid_elements = implode(',', array_merge($tagBlacklist, $attrBlacklist, $tagArray, $attrArray));
$extended_elements = '';
$valid_elements = '';
$invalid_elements = implode(',', array_merge($tagBlacklist, $attrBlacklist, $tagArray, $attrArray));
$extended_elements = '';
$valid_elements = '';
}
else
{
// Use filters from Tiny Params
$invalid_elements = $this->params->get('invalid_elements', 'script,applet,iframe');
// Use filters from TinyMCE params
$invalid_elements = $this->params->get('invalid_elements', 'script,applet,iframe');
$extended_elements = $this->params->get('extended_elements', '');
$valid_elements = $this->params->get('valid_elements', '');
$valid_elements = $this->params->get('valid_elements', '');
}

// Advanced Options
Expand Down Expand Up @@ -1151,19 +1151,19 @@ private function tinyButtons($name, $excluded)
protected static function getGlobalFilters()
{
// Filter settings
$config = JComponentHelper::getParams('com_config');
$user = JFactory::getUser();
$config = JComponentHelper::getParams('com_config');
$user = JFactory::getUser();
$userGroups = JAccess::getGroupsByUser($user->get('id'));

$filters = $config->get('filters');

$blackListTags = array();
$blackListTags = array();
$blackListAttributes = array();

$customListTags = array();
$customListTags = array();
$customListAttributes = array();

$whiteListTags = array();
$whiteListTags = array();
$whiteListAttributes = array();

$whiteList = false;
Expand All @@ -1172,7 +1172,7 @@ protected static function getGlobalFilters()
$unfiltered = false;

// Cycle through each of the user groups the user is in.
// Remember they are included in the Public group as well.
// Remember they are included in the public group as well.
foreach ($userGroups as $groupId)
{
// May have added a group but not saved the filters.
Expand Down Expand Up @@ -1295,6 +1295,7 @@ protected static function getGlobalFilters()
{
$filter->tagBlacklist = array_diff($filter->tagBlacklist, $whiteListTags);
}

// Remove white listed attributes from filter's default blacklist
if ($whiteListAttributes)
{
Expand Down
4 changes: 3 additions & 1 deletion plugins/editors/tinymce/tinymce.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@
<option value="0">PLG_TINY_FIELD_VALUE_P</option>
</field>

<field name="use_config_textfilters" type="radio"
<field
name="use_config_textfilters"
type="radio"
class="btn-group btn-group-yesno"
default="0"
description="PLG_TINY_CONFIG_TEXTFILTER_ACL_DESC"
Expand Down

0 comments on commit 4df0f9d

Please sign in to comment.