Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Joomla - Check to see if we are in admin area or not

Tags:

joomla2.5

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.

like image 563
Farid Rn Avatar asked Sep 05 '12 15:09

Farid Rn


People also ask

What is Joomla admin page?

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.

What is the backend of Joomla?

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.


1 Answers

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';
like image 73
Shaz Avatar answered Oct 15 '22 16:10

Shaz