<?php if (!empty($results)) { ?> <div class="page-header"><h1>Search</h1></div> <?php foreach ($results as $result) { switch ($result['type']) { case 'news': echo Partial::render('newsShort', $result); break; case 'article': echo Partial::render('articleQuickView', $result) . '<hr />'; break; case 'lecture': echo Partial::render('lecture', $result); break; } } }
echo $description; ?> </blockquote> <?php } ?> <p><?php echo BBCode::parse($body); ?> </p> <?php if (!empty($mlt)) { ?> <p><h4>More Like This:</h4> <?php foreach ($mlt as $fetched) { echo '<a href="' . Url::format('article/view/' . Id::create($fetched, 'news')) . '">' . $fetched['title'] . '</a><br />'; } ?> </p> <?php } if ($published && empty($revision) && empty($preview)) { $data = array('_id' => $_id, 'rating' => $rating, 'type' => 'Articles', 'where' => 'article'); echo Partial::render('like', $data); } ?> </div>
<?php if (!empty($article)) { if ($multiple) { $data = array('total' => $total, 'perPage' => articles::PER_PAGE, 'page' => $page, 'url' => $url); echo Partial::render('pagination', $data); foreach ($article as $post) { echo Partial::render('articleQuickView', $post); } } else { $article[0]['mlt'] = $mlt; echo Partial::render('articleFull', $article[0]); if ($article[0]['commentable']) { echo Partial::render('comment', array('id' => $article[0]['_id'], 'page' => $commentPage, 'pageLoc' => $commentPageLoc)); } } }
<?php if (!empty($valid) && $valid) { foreach ($lectures as $lecture) { echo Partial::render('lecture', $lecture); } }
<?php if (!empty($valid) && $valid) { extract($post); if (!is_array($tags)) { $tags = explode(',', clean($tags)); } $category = clean($category); ?> <div class="page-header"><h1><?php echo ucwords($method); ?> Article</h1></div> <?php if (!empty($preview) && $preview && !is_string($info)) { echo Partial::render('articleFull', $info); } ?> <form class="form-vertical well" action="<?php echo Url::format('/article/' . $method . (empty($_id) ? '' : '/' . $_id) . '/save'); ?> " method="post"> <label>Title: </label> <input type="text" name="title" value="<?php echo clean($title); ?> " /><br /> <label>Category: </label> <select name="category"> <?php foreach (articles::$categories as $short => $rCategory) { ?>
<div class="span6"><div class="well"> <h4>Active Forum Posts</h4> <?php if (!empty($fPosts)) { foreach ($fPosts as $post) { echo '<a href="' . Url::format($post['url']) . '">' . $post['topic'] . '</a><br />'; } } else { echo '<i>No active form posts.</i>'; } ?> </div></div> </div> <?php foreach ($news as $post) { echo Partial::render('newsShort', $post); } ?> <br /> <div class="well"> <strong>Most Recent Users:</strong><br /> <?php $links = array(); foreach ($onlineUsers as $user) { array_push($links, '<a href="' . Url::format('/user/view/' . $user) . '">' . $user . '</a>'); } echo implode(' - ', $links); ?> <br /> <strong>Users on IRC: (<?php
function create_replacement_partials() { // construct a special variable which will hold all of the category lists $partials['/@Category_Lists/'] = ''; // find all categories $categories = $this->find_categories(); // category lists will become available as a variable as: '$.projects-folder' => @Projects_Folder foreach ($categories as $category) { // create new category $c = new ContentParser(); $replacements = $c->parse(new Category($category['name_clean'])); // store the output of the CategoryListPartial $category_list = Partial::render($this->page, $category['name'], $category['partial_file'], $replacements, 'CategoryList'); // create a partial that matches the name of the category $partials['/@' . ucfirst(preg_replace('/-(.)/e', "'_'.strtoupper('\\1')", $category['name_clean'])) . '/'] = $category_list; // append to the @Category_Lists variable $partials['/@Category_Lists/'] .= $category_list; } // construct the rest of the special variables $partials['/@Navigation/'] = Partial::render($this->page, '../content/', '../templates/partials/navigation.html', null, 'Navigation'); $partials['/@Pages/'] = Partial::render($this->page, '../content/', '../templates/partials/pages.html', null, 'Pages'); // construct asset variables $partials['/@Images/'] = Partial::render($this->page, null, '../templates/partials/images.html', null, 'Images'); $partials['/@Video/'] = Partial::render($this->page, null, '../templates/partials/video.html', null, 'Video'); $partials['/@Html/'] = Partial::render($this->page, null, null, null, 'Html'); $partials['/@Swfs/'] = Partial::render($this->page, null, '../templates/partials/swf.html', null, 'Swf'); $partials['/@Media/'] = $partials['/@Images/'] . $partials['/@Video/'] . $partials['/@Swfs/'] . $partials['/@Html/']; return $partials; }
<?php if (isset($revisions)) { ?> <h2><u>Current:</u></h2> <?php $current['preview'] = true; echo Partial::render('articleFull', $current); ?> <br /> <br /> <?php if (!empty($revisions)) { ?> <h2><u>Revisions:</u></h2><?php } foreach ($revisions as $revision) { $revision['revision'] = true; echo Partial::render('articleFull', $revision); } }
<center> <?php $links = array(); if ($currCategory == 'new') { array_push($links, '<strong>Newest</strong>'); } else { array_push($links, '<a href="' . Url::format('/article/') . '">New</a>'); } foreach ($categories as $short => $category) { if ($currCategory == $short) { array_push($links, '<strong>' . $category . '</strong>'); } else { array_push($links, ' <a href="' . Url::format('/article/index/' . $short) . '">' . $category . '</a>'); } } echo implode(' - ', $links); ?> </center> <?php if ($currCategory != 'new') { $pageData = array('total' => $total, 'perPage' => articles::PER_PAGE, 'page' => $page, 'url' => '/article/index/' . $currCategory . '/'); echo Partial::render('pagination', $pageData); } foreach ($articles as $article) { echo Partial::render('articleQuickView', $article); } if ($currCategory != 'new') { echo Partial::render('pagination', $pageData); }
<?php if (!empty($valid) && $valid) { extract($post); if (!is_array($tags)) { $tags = explode(',', clean($tags)); } ?> <div class="page-header"><h1><?php echo ucwords($method); ?> News</h1></div> <?php if (!empty($preview) && $preview && !is_string($info)) { echo Partial::render('newsFull', $info); } ?> <form class="well form-vertical" action="<?php echo Url::format('/news/' . $method . (empty($_id) ? '' : '/' . $_id) . '/save'); ?> " method="post"> <label>Title: </label> <input type="text" name="title" value="<?php echo clean($title); ?> " /><br /> <label>Department: </label> <input type="text" name="department" value="<?php echo !empty($department) ? clean($department) : ''; ?> " /><br /> <label>Text: </label> <textarea style="width: 100%" rows="15" name="body"><?php
<a name="comments"></a> <legend>Comments</legend> <?php // Comments // * $id - Content Id // * $page - Comments page // * $pageLoc - Where to send new pages to. $commLib = new comments(ConnectionFactory::get('mongo')); $commentData = $commLib->getForId($id, $page); extract($commentData); $paginationData = array('total' => $total, 'perPage' => comments::PAGE_LIMIT, 'page' => $page, 'url' => $pageLoc, 'where' => 'comments'); $pagination = Partial::render('pagination', $paginationData); if ($total != 0) { echo $pagination; } if (empty($comments)) { echo '<div class="alert">No comments!</div>'; } foreach ($comments as $comment) { ?> <table class="table table-bordered"> <tr> <td style="width: 20%"> <a href="<?php echo Url::format('/user/view/' . $comment['user']['username']); ?> "> <?php echo $comment['user']['username']; ?> </a><br />
<?php if (isset($revisions)) { ?> <div class="page-header"><h1>Current</h1></div> <?php echo Partial::render('newsFull', $current); ?> <br /> <?php if (!empty($revisions)) { ?> <div class="page-header"><h1>Revisions</h1></div><?php } foreach ($revisions as $revision) { $revision['revision'] = true; echo Partial::render('newsFull', $revision); } }
<?php if (!empty($article)) { echo Partial::render('articleFull', $article); ?> <hr /> <form action="<?php echo Url::format('article/approve/save'); ?> " method="post"> <center> <input type="submit" name="decision" value="Publish" class="btn btn-success" /> <input type="submit" name="decision" value="Delete" class="btn btn-danger" /> </center> <input type="hidden" name="id" value="<?php echo $article['_id']; ?> " /> </form> <?php }