I'm creating a new template for my joomla website and I've replaced joomla's native Mootools with jQuery and I'm converting all moo codes to jQuery ones.
Somehow many of codes like the ones in joomla libraries are written for both admin and frontend area, and if I replace them with jquery codes, admin section won't work properly. I wanna know if there's a way to determine if we are in admin section of site or not, so I can use javascript codes based on this condition.
Joomla! ≥ 3.0. The Administrator application, also known as the Backend, Admin Panel or Control Panel, is the interface where administrators and other site officials with appropriate privileges can manipulate the look of a Joomla-powered website. There are many tasks which can be done with the administrator interface.
The Back-end of a Joomla! site is used to manage the content, appearance and functionality of the site. It is not seen by visitors to the 'Front-end' and you can only login to it if you have appropriate permissions. It is here too that the basis of a new site is created.
It seems to work in Joomla 1.5, Joomla 2.x and 3.x
$app = JFactory::getApplication();
if ($app->isSite()) echo 'Client is site';
if ($app->isAdmin()) echo 'Client is administrator';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With