How to check if user is in edit mode

Permalink 1 user found helpful
Hello there! I wish to a very simply task, but I couldn't find a similar topic even. So, how can I check if the user is in edit mode? I would like to include a different stylesheet if a page is viewed in edit mode. Thanks in advance!

 
cannonf700 replied on at Permalink Reply
cannonf700
Try using this line of code:
<?php
   $u = new User();
   $g = Group::getByName('Administrators');
   if($u->isSuperUser()||$u->inGroup($g)){ 
   ?>
jero replied on at Permalink Best Answer Reply
jero
It's not really the user you want to check, but the page. Try this in your template:

<?php
if ($c->isEditMode())
    $css='edit.css';
else
    $css='main.css';
?>
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet($css) ?>" />
szucslaszlo replied on at Permalink Reply
Hey guys!
Thank you for your answers, the second one was exactly what I was looking for.