Skip to content

Commit

Permalink
Codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
810 committed Feb 28, 2019
1 parent 1859ea4 commit 3e0e722
Show file tree
Hide file tree
Showing 201 changed files with 182 additions and 230 deletions.
36 changes: 18 additions & 18 deletions src/administrator/components/com_kunena/controllers/users.php
Expand Up @@ -679,42 +679,42 @@ public function moderate()
{
$this->app->enqueueMessage(Text::_('COM_KUNENA_ERROR_TOKEN'), 'error');
$this->setRedirect(KunenaRoute::_($this->baseurl, false));

return;
}

$modCatids = $this->app->input->get('catid', array(), 'post', 'array');
$modCatids = ArrayHelper::toInteger($modCatids);

$cid = $this->app->input->get('cid', array(), 'post', 'array');
$cid = ArrayHelper::toInteger($cid);
$userid = array_shift($cid);

if ($userid <= 0)
{
$this->app->enqueueMessage(Text::_('COM_KUNENA_PROFILE_NO_USER'), 'error');
$this->setRedirect(KunenaRoute::_($this->baseurl, false));

return;
}

if ($userid <= 0)
{
$this->app->enqueueMessage(Text::_('COM_KUNENA_PROFILE_NO_USER'), 'error');
$this->setRedirect(KunenaRoute::_($this->baseurl, false));

return;
}

$user = KunenaUserHelper::get($userid);
$this->setModerate($user, $modCatids);

$this->setModerate($user, $modCatids);

$this->app->enqueueMessage(Text::_('COM_KUNENA_USER_MODERATE_DONE'));

$this->setRedirect(KunenaRoute::_($this->baseurl, false));
}

/**
* Unmoderate
*
Expand Down Expand Up @@ -1178,7 +1178,7 @@ protected function cleanSocial(&$user, $app)
$user->youtube = str_replace(' ', '', trim($app->input->getString('youtube', '')));
$user->ok = str_replace(' ', '', trim($app->input->getString('ok', '')));
}

/**
* Set moderator rights on the user given
*
Expand All @@ -1191,18 +1191,18 @@ protected function setModerate(KunenaUser $user, $modCatids)
{
// Update moderator rights
$categories = KunenaForumCategoryHelper::getCategories(false, false, 'admin');

foreach ($categories as $category)
{
$category->setModerator($user, in_array($category->id, $modCatids));
}

// Global moderator is a special case
if ($this->me->isAdmin())
{
KunenaAccess::getInstance()->setModerator(0, $user, in_array(0, $modCatids));
KunenaAccess::getInstance()->setModerator(0, $user, in_array(0, $modCatids));
}

return true;
}
}
43 changes: 21 additions & 22 deletions src/administrator/components/com_kunena/install/model.php
Expand Up @@ -26,7 +26,6 @@
define('KUNENA_INSTALLER_SITEPATH', JPATH_SITE . '/components/' . basename(KUNENA_INSTALLER_ADMINPATH));
define('KUNENA_INSTALLER_MEDIAPATH', JPATH_SITE . '/media/kunena');


/**
* Install Model for Kunena
*
Expand Down Expand Up @@ -120,35 +119,35 @@ public function __construct()

// TODO: move to migration
$this->_kVersions = array(
array('component' => null, 'prefix' => null, 'version' => null, 'date' => null),);
array('component' => null, 'prefix' => null, 'version' => null, 'date' => null), );

// TODO: move to migration
$this->_fbVersions = array(
array('component' => 'FireBoard', 'prefix' => 'fb_', 'version' => '1.0.4', 'date' => '2007-12-23',
'table' => 'fb_sessions', 'column' => 'currvisit',),
'table' => 'fb_sessions', 'column' => 'currvisit', ),
array('component' => 'FireBoard', 'prefix' => 'fb_', 'version' => '1.0.3', 'date' => '2007-09-04',
'table' => 'fb_categories', 'column' => 'headerdesc',),
'table' => 'fb_categories', 'column' => 'headerdesc', ),
array('component' => 'FireBoard', 'prefix' => 'fb_', 'version' => '1.0.2', 'date' => '2007-08-03',
'table' => 'fb_users', 'column' => 'rank',),
'table' => 'fb_users', 'column' => 'rank', ),
array('component' => 'FireBoard', 'prefix' => 'fb_', 'version' => '1.0.1', 'date' => '2007-05-20',
'table' => 'fb_users', 'column' => 'uhits',),
'table' => 'fb_users', 'column' => 'uhits', ),
array('component' => 'FireBoard', 'prefix' => 'fb_', 'version' => '1.0.0', 'date' => '2007-04-15',
'table' => 'fb_messages',),
array('component' => null, 'prefix' => null, 'version' => null, 'date' => null),);
'table' => 'fb_messages', ),
array('component' => null, 'prefix' => null, 'version' => null, 'date' => null), );

// TODO: move to migration
$this->_sbVersions = array(
array('component' => 'JoomlaBoard', 'prefix' => 'sb_', 'version' => 'v1.0.5', 'date' => '1000-01-01',
'table' => 'sb_messages',),
array('component' => null, 'prefix' => null, 'version' => null, 'date' => null),);
'table' => 'sb_messages', ),
array('component' => null, 'prefix' => null, 'version' => null, 'date' => null), );

$this->steps = array(
array('step' => '', 'menu' => Text::_('COM_KUNENA_INSTALL_STEP_INSTALL')),
array('step' => 'Prepare', 'menu' => Text::_('COM_KUNENA_INSTALL_STEP_PREPARE')),
array('step' => 'Plugins', 'menu' => Text::_('COM_KUNENA_INSTALL_STEP_PLUGINS')),
array('step' => 'Database', 'menu' => Text::_('COM_KUNENA_INSTALL_STEP_DATABASE')),
array('step' => 'Finish', 'menu' => Text::_('COM_KUNENA_INSTALL_STEP_FINISH')),
array('step' => '', 'menu' => Text::_('COM_KUNENA_INSTALL_STEP_COMPLETE')),);
array('step' => '', 'menu' => Text::_('COM_KUNENA_INSTALL_STEP_COMPLETE')), );
}

/**
Expand Down Expand Up @@ -2984,26 +2983,26 @@ public function deleteTables($prefix)
public function createMenu()
{
$menu = array('name' => Text::_('COM_KUNENA_MENU_ITEM_FORUM'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_FORUM_ALIAS'), 'forum'),
'link' => 'index.php?option=com_kunena&view=home', 'access' => 1, 'params' => array('catids' => 0),);
'link' => 'index.php?option=com_kunena&view=home', 'access' => 1, 'params' => array('catids' => 0), );
$submenu = array(
'index' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_INDEX'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_INDEX_ALIAS'), 'index'),
'link' => 'index.php?option=com_kunena&view=category&layout=list', 'access' => 1, 'default' => 'categories', 'params' => array(),),
'link' => 'index.php?option=com_kunena&view=category&layout=list', 'access' => 1, 'default' => 'categories', 'params' => array(), ),
'recent' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_RECENT'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_RECENT_ALIAS'), 'recent'),
'link' => 'index.php?option=com_kunena&view=topics&mode=replies', 'access' => 1, 'default' => 'recent', 'params' => array('topics_catselection' => '', 'topics_categories' => '', 'topics_time' => ''),),
'link' => 'index.php?option=com_kunena&view=topics&mode=replies', 'access' => 1, 'default' => 'recent', 'params' => array('topics_catselection' => '', 'topics_categories' => '', 'topics_time' => ''), ),
'unread' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_UNREAD'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_UNREAD_ALIAS'), 'unread'),
'link' => 'index.php?option=com_kunena&view=topics&layout=unread', 'access' => 2, 'params' => array(),),
'link' => 'index.php?option=com_kunena&view=topics&layout=unread', 'access' => 2, 'params' => array(), ),
'newtopic' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_NEWTOPIC'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_NEWTOPIC_ALIAS'), 'newtopic'),
'link' => 'index.php?option=com_kunena&view=topic&layout=create', 'access' => 2, 'params' => array(),),
'link' => 'index.php?option=com_kunena&view=topic&layout=create', 'access' => 2, 'params' => array(), ),
'noreplies' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_NOREPLIES'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_NOREPLIES_ALIAS'), 'noreplies'),
'link' => 'index.php?option=com_kunena&view=topics&mode=noreplies', 'access' => 2, 'params' => array('topics_catselection' => '', 'topics_categories' => '', 'topics_time' => ''),),
'link' => 'index.php?option=com_kunena&view=topics&mode=noreplies', 'access' => 2, 'params' => array('topics_catselection' => '', 'topics_categories' => '', 'topics_time' => ''), ),
'mylatest' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_MYLATEST'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_MYLATEST_ALIAS'), 'mylatest'),
'link' => 'index.php?option=com_kunena&view=topics&layout=user&mode=default', 'access' => 2, 'default' => 'my', 'params' => array('topics_catselection' => '2', 'topics_categories' => '0', 'topics_time' => ''),),
'link' => 'index.php?option=com_kunena&view=topics&layout=user&mode=default', 'access' => 2, 'default' => 'my', 'params' => array('topics_catselection' => '2', 'topics_categories' => '0', 'topics_time' => ''), ),
'profile' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_PROFILE'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_PROFILE_ALIAS'), 'profile'),
'link' => 'index.php?option=com_kunena&view=user', 'access' => 2, 'params' => array('integration' => 1),),
'link' => 'index.php?option=com_kunena&view=user', 'access' => 2, 'params' => array('integration' => 1), ),
'help' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_HELP'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_HELP_ALIAS'), 'help'),
'link' => 'index.php?option=com_kunena&view=misc', 'access' => 3, 'params' => array('body' => Text::_('COM_KUNENA_MENU_HELP_BODY'), 'body_format' => 'bbcode'),),
'link' => 'index.php?option=com_kunena&view=misc', 'access' => 3, 'params' => array('body' => Text::_('COM_KUNENA_MENU_HELP_BODY'), 'body_format' => 'bbcode'), ),
'search' => array('name' => Text::_('COM_KUNENA_MENU_ITEM_SEARCH'), 'alias' => KunenaRoute::stringURLSafe(Text::_('COM_KUNENA_MENU_SEARCH_ALIAS'), 'search'),
'link' => 'index.php?option=com_kunena&view=search', 'access' => 1, 'params' => array(),),
'link' => 'index.php?option=com_kunena&view=search', 'access' => 1, 'params' => array(), ),
);

// Disable language debugging while creating menu items.
Expand Down Expand Up @@ -3078,7 +3077,7 @@ public function createMenuJ25($menu, $submenu)
'menu-meta_description' => '',
'menu-meta_keywords' => '',
'robots' => '',
'secure' => 0,);
'secure' => 0, );

$gparams = new \Joomla\Registry\Registry($paramdata);

Expand Down
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Router\Route;


/**
* Class KunenaAvatarAltaUserPoints
* @since Kunena
Expand Down
Expand Up @@ -137,7 +137,7 @@ public function showProfile($view, &$params)
return implode(
' ', $_PLUGINS->trigger(
'forumSideProfile', array('kunena', $view, $view->profile->userid,
array('config' => &$view->config, 'userprofile' => &$view->profile, 'params' => &$params),)
array('config' => &$view->config, 'userprofile' => &$view->profile, 'params' => &$params), )
)
);
}
Expand Down
Expand Up @@ -150,7 +150,7 @@ public function onAfterReply($message)
'title' => '',
'type' => 'post',
'url' => $permalink,
'image' => ''
'image' => '',
);

// Add notifications in EasySocial
Expand Down
Expand Up @@ -79,22 +79,22 @@ public function getCategoryAccess(KunenaForumCategory $category)
$accessname = Text::sprintf($category->pub_recurse ? 'COM_KUNENA_A_GROUP_X_PLUS' : 'COM_KUNENA_A_GROUP_X_ONLY', $groupname ? Text::_($groupname) : Text::_('COM_KUNENA_NOBODY'));

$list["joomla.group.{$category->pub_access}"] = array('type' => 'joomla.group', 'id' => $category->pub_access, 'alias' => $accessname,
'title' => $accessname,);
'title' => $accessname, );

$groupname = $this->getGroupName($category->accesstype, $category->admin_access);

if ($groupname && $category->pub_access != $category->admin_access)
{
$accessname = Text::sprintf($category->admin_recurse ? 'COM_KUNENA_A_GROUP_X_PLUS' : 'COM_KUNENA_A_GROUP_X_ONLY', Text::_($groupname));
$list["joomla.group.{$category->admin_access}"] = array('type' => 'joomla.group', 'id' => $category->admin_access, 'alias' => $accessname,
'title' => $accessname,);
'title' => $accessname, );
}
}
else
{
$groupname = $this->getGroupName($category->accesstype, $category->access);
$list["joomla.level.{$category->access}"] = array('type' => 'joomla.level', 'id' => $category->access, 'alias' => $groupname,
'title' => $groupname,);
'title' => $groupname, );
}

return $list;
Expand Down
Expand Up @@ -185,7 +185,7 @@ public function getRemindURL()

return Route::_('index.php?option=com_users&view=remind' . ($Itemid ? "&Itemid={$Itemid}" : ''));
}

/**
* Return the parameters of the plugin
*
Expand Down
Expand Up @@ -11,7 +11,6 @@

use Joomla\CMS\Factory;


/**
* Class pkg_kunena_languagesInstallerScript
* @since Kunena
Expand Down
Expand Up @@ -371,7 +371,7 @@ public function getAdminCategories()
'filter_allow_polls' => $this->getState('filter.allow_polls'),
'filter_review' => $this->getState('filter.review'),
'filter_anonymous' => $this->getState('filter.anonymous'),
'action' => 'admin',);
'action' => 'admin', );

$catid = $this->getState('item.id', 0);
$categories = array();
Expand Down
2 changes: 1 addition & 1 deletion src/administrator/components/com_kunena/models/user.php
Expand Up @@ -158,7 +158,7 @@ public function getListmodcats()

$params = array(
'sections' => false,
'action' => 'read',);
'action' => 'read', );
$modCats = HTMLHelper::_('kunenaforum.categorylist', 'catid[]', 0, $categoryList, $params, 'class="inputbox" multiple="multiple" size="15"', 'value', 'text', $modCatList, 'kforums');

return $modCats;
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


?>

<div id="kunena" class="admin override">
Expand Down
Expand Up @@ -219,7 +219,7 @@ class="element-invisible"><?php echo Text::_('COM_KUNENA_FIELD_LABEL_SEARCHIN');
. \Joomla\CMS\Language\Text::_("JSAVE") . '</button>'
. '<button type="button" class="btn btn-success" aria-hidden="true" onclick="jQuery(\'#plugin' . $item->extension_id
. 'Modal iframe\').contents().find(\'#applyBtn\').click(); return false;">'
. \Joomla\CMS\Language\Text::_("JAPPLY") . '</button>'
. \Joomla\CMS\Language\Text::_("JAPPLY") . '</button>',
)
); ?>
<?php else : ?>
Expand Down
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
Expand Down
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


?>

<div id="kunena" class="admin override">
Expand Down
Expand Up @@ -11,7 +11,6 @@
defined('_JEXEC') or die();
use Joomla\CMS\Language\Text;


?>
<div id="kunena" class="admin override">
<div id="j-sidebar-container" class="span2">
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


?>
<div id="kunena" class="admin override">
<div id="j-sidebar-container" class="span2">
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


?>
<div id="kunena" class="admin override">
<div id="j-sidebar-container" class="span2">
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
Expand Down
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;


HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


?>

<div id="kunena" class="admin override">
Expand Down
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;


HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
Expand Down
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;


HTMLHelper::_('behavior.tooltip');
HTMLHelper::_('behavior.multiselect');
HTMLHelper::_('dropdown.init');
Expand Down

0 comments on commit 3e0e722

Please sign in to comment.