controller on_page_view() isEditMode()

Permalink
Hi there

I'm currently building a block and should know, how i can check if the site is in edit mode within the on_page_view() function of my controller.

Thanks in advance.

Steff
 
ryan replied on at Permalink Reply
ryan
This should work:
Get the current collection object from the controller.

<?
public function on_page_view() {
  $c = $this->getCollectionObject();
  if($c->isEditMode()) {
    // edit mode
  }
}
?>
Steff replied on at Permalink Reply
Steff
thanks ryan. that worked perfect.

which object do i have to get, to check if a user is logged in?

Thanks a lot.
Remo replied on at Permalink Reply
Remo
global $u; 
if ($u->isLoggedIn ()) { 
  echo "logged in"; 
}


if $u isn't available:

$user = new User(); 
$user->isLoggedIn()...
Steff replied on at Permalink Reply
Steff
Thank you Remo. That's what I was looking for.
ob7dev replied on at Permalink Reply
ob7dev