Skip to content
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

Limit Persistent Anonymous Data Collection Prompt To Control Panel #13948

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions plugins/system/stats/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public function onAfterInitialise()
// Load plugin language files only when needed (ex: they are not needed in site client).
$this->loadLanguage();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code seems fine. But would it not be best to put it above $this->loadLanguage();? No need to load the language if it will potentially return

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, @zero-24 can you move it after the if statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That break the translation and result into a not translated message:

image

As the option is not set to com_cpanel on that screen. if i add it manually it works but not without.
administrator/index.php?option=com_cpanel

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, didn't think about that.


// Only to com_cpanel
if ($this->app->input->get('option', 'com_cpanel') !== 'com_cpanel')
{
return;
}

JHtml::_('jquery.framework');
JHtml::_('script', 'plg_system_stats/stats.js', array('version' => 'auto', 'relative' => true));
}
Expand Down