Beispiel #1
0
		<div class="container container-center">
			<?php 
include $_SERVER["DOCUMENT_ROOT"] . "/../includes/content.sidebar_left.php";
?>
		</div>
	</div>
	<div class="component-right">
		<div class="container container-padded">
			<h3>Welcome, <?php 
echo $_SESSION["UserName"];
?>
</h3>
			<h4>What would you like to do now?</h4>
			<ul>
				<?php 
if (is_editor()) {
    ?>
				<li><a href="/admin/posts">Manage posts</a></li>
				<li><a href="/admin/posts/new">Create a new post</a></li>
				<?php 
}
if (is_manager()) {
    ?>
				<li><a href="/admin/users">Manage users</a></li>
				<li><a href="/admin/users/new">Create a new user</a></li>
                <li><a href="/admin/users/block">Block users</a></li>
                <li><a href="/admin/users/unblock">Unblock users</a></li>
				<?php 
}
if (is_owner()) {
    ?>
Beispiel #2
0
 function emit()
 {
     /* If there's a link, wrap it */
     if (null != $this->url) {
         print '<a ';
         print '  class="story-link" ';
         print '  href="' . $this->url . '" ';
         if (null != $this->alt) {
             print '  title="' . $this->alt . '" ';
         }
         print '>';
     }
     /* Switch on type */
     switch ($this->type) {
         case STORY_CHUNK_HEADLINE:
             print '<h1 ';
             print '  class="story-headline" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print '>' . $this->value . '</h1>';
             break;
         case STORY_CHUNK_SECTION:
             print '<div class="closure_div"></div>';
             print '<h2 ';
             print '  class="story-headline" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print '>' . $this->value . '</h2>';
             break;
         case STORY_CHUNK_GROUP:
             print '<div class="closure_div"></div>';
             print '<h3 ';
             print '  class="story-headline" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print '>' . $this->value . '</h3>';
             break;
         case STORY_CHUNK_SUBGROUP:
             print '<h4 ';
             print '  class="story-headline" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print '>' . $this->value . '</h4>';
             break;
         case STORY_CHUNK_LEDE:
             print '<img ';
             print '  class="story-lede" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             if (null != $this->alt) {
                 print '  alt="' . $this->alt . '" ';
             }
             print '  src="' . $this->value . '" ';
             print '/>';
             break;
         case STORY_CHUNK_BANNER:
             print '<img ';
             print '  class="story-banner" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             if (null != $this->alt) {
                 print '  alt="' . $this->alt . '" ';
             }
             print '  src="' . $this->value . '" ';
             print '/>';
             break;
         case STORY_CHUNK_TEXT:
             print '<span ';
             print '  class="story-span" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print ">\n";
             print $this->value;
             print "\n</span>";
             break;
         case STORY_CHUNK_ERROR:
             print '<span ';
             print '  class="story-error" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print ">\n";
             print $this->value;
             print "\n</span>";
             break;
         case STORY_CHUNK_WARNING:
             print '<span ';
             print '  class="story-warning" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print ">\n";
             print $this->value;
             print "\n</span>";
             break;
         case STORY_CHUNK_META:
             print '<span ';
             print '  class="story-meta" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print ">\n";
             print $this->value;
             print "\n</span>";
             break;
         case STORY_CHUNK_FILE:
             /* If the user is logged in, add an editor button */
             if (is_authenticated() && is_editor()) {
                 print '<a ';
                 print '  href="/edit-story-file.php?file=' . $this->value . '" ';
                 print '  class="story-trail" ';
                 print '  title="Edit this text" ';
                 print '>';
                 skin_img("edit_icon.png", "Edit this text", "story-trail");
                 print '</a>';
             }
             print '<span ';
             print '  class="story-span" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print ">\n";
             /* Verify that we can read it */
             if (!is_readable($this->value)) {
                 print "[[I can't import text from \"" . $this->value . "\", because I can't find it (or can't read it).  Sorry 'bout that.]]";
             } else {
                 @(include $this->value);
             }
             print "\n</span>";
             break;
         case STORY_CHUNK_OBJECT:
             print '<div ';
             print '  class="story-object" ';
             if (null != $this->id) {
                 print '  id="' . $this->id . '" ';
             }
             print '>';
             $this->object->emit();
             print '</div>';
     }
     /* Finish the link (if any) */
     if (null != $this->url) {
         print "</a>";
     }
     /* Add the newline */
     print "\n";
 }