Esempio n. 1
0
 public function content($params = false)
 {
     // not signed in?
     if (!Session::get('user_email')) {
         return Request::redirect('/elsa/signin');
     }
     foreach (ContentTypes::get() as $contentType) {
         $first_type = $contentType->slug;
         break;
     }
     if (!$params) {
         return Request::redirect('/elsa/content/type/' . $first_type);
     }
     if ($params) {
         $type = $params->type;
     }
     return View::make('content')->with('type', $type)->with('sidebar', 'content')->with('active', 'content')->with('title', ucfirst($type))->makeBefore('partials/header')->makeAfter('partials/footer')->getInSystem();
 }
Esempio n. 2
0
<div class="sidebar-section">

	<h3>Content Types</h3>

	<ul>

		<?php 
foreach (ContentTypes::get() as $contentType) {
    ?>

			<li<?php 
    if ($type === $contentType->slug) {
        ?>
 class="active"<?php 
    }
    ?>
>
				<a href="<?php 
    echo Config::get('url');
    ?>
/elsa/content/type/<?php 
    echo $contentType->slug;
    ?>
">
					<?php 
    echo $contentType->name;
    ?>
					<span><?php 
    echo count(Content::in($contentType->slug)->get());
    ?>
</span>