Return the current section type? (plugin) Is there an easy way to check what the current page section type is, within a plugin? 

I wonder if I'm overlooking a little function that simply returns: "single", "channel", "entry", etc...? 



UPDATE:

Thank you Aevlan, this was the approach I took originally. I've been struggling to determine wether the user is currently on the root of a channel/structure, or if they are on an entry page. 

This is how I can determine "single", "channel" or "structure". 

$element = craft()-&gt;urlManager-&gt;getMatchedElement();
$element_exists = $element &amp;&amp; $element-&gt;getElementType() == ElementType::Entry;

$currentPageType = $element-&gt;section-&gt;type;


The reason I need to know this, is so I can perform some checks before I add certain navigation throughout the site. To help with my specific issue, I will use "hasDescendants()" or check the segment counts. 

Thanks again. Mark
The SectionModel has a type property, which return what you're after, "single", "channel" and "entry". In a template it can be accessed like this:

{{ entry.section.type }}


If this is in a plugin and you have the section, you access it like this:

$section-&gt;type


But I'm confused by the "current page" of your question. Maybe you can describe in a bit more detail what you're trying to achieve, and what your code looks like atm?