-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplified spaghetti code #8544
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,30 +54,15 @@ public function onInit() | |
// List the skins | ||
$skindirs = glob(JPATH_ROOT . '/media/editors/tinymce/skins' . '/*', GLOB_ONLYDIR); | ||
|
||
// Set the selected skin | ||
if ($app->isSite()) | ||
// Set the selected skin in the current side, front-end or back-end | ||
$side = $app->getClientId() ? 'skin_admin' : 'skin'; | ||
if ((int) $this->params->get($side, 0) < count($skindirs)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CS: Blank line before There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
{ | ||
if ((int) $this->params->get('skin', 0) < count($skindirs)) | ||
{ | ||
$skin = 'skin : "' . basename($skindirs[(int) $this->params->get('skin', 0)]) . '",'; | ||
} | ||
else | ||
{ | ||
$skin = 'skin : "lightgray",'; | ||
} | ||
$skin = 'skin : "' . basename($skindirs[(int) $this->params->get($side, 0)]) . '",'; | ||
} | ||
|
||
// Set the selected administrator skin | ||
elseif ($app->isAdmin()) | ||
else | ||
{ | ||
if ((int) $this->params->get('skin_admin', 0) < count($skindirs)) | ||
{ | ||
$skin = 'skin : "' . basename($skindirs[(int) $this->params->get('skin_admin', 0)]) . '",'; | ||
} | ||
else | ||
{ | ||
$skin = 'skin : "lightgray",'; | ||
} | ||
$skin = 'skin : "lightgray",'; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving |
||
|
||
$entity_encoding = $this->params->get('entity_encoding', 'raw'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use $app->isAdmin(), because it is better readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree @rdeutz, in this case
$app->isAdmin()
would be more appropriate.