Esempio n. 1
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Title
        if ($this->area->description) {
            echo $this->area->description . '<hr>';
        }
        if ($this->area->topic_count) {
            // Area has topics
            $last_topic = $this->area->last_topic();
            $last_poster = $last_topic->last_post()->author();
            ?>

		<div class="media">
			<div class="pull-left">
				<?php 
            echo HTML::avatar($last_poster ? $last_poster['avatar'] : null, $last_poster ? $last_poster['username'] : null, false);
            ?>
			</div>
			<div class="media-body">
				<small class="ago"><?php 
            echo HTML::time(Date::short_span($last_topic->last_posted, true, true), $last_topic->last_posted);
            ?>
</small>
				<?php 
            echo $last_poster ? HTML::user($last_poster) : HTML::chars($last_topic->last_poster);
            ?>
				<br>
				<?php 
            echo HTML::anchor(Route::model($last_topic, '?page=last#last'), Forum::topic($last_topic), array('title' => HTML::chars($last_topic->name)));
            ?>
<br />
			</div>
		</div>

		<small class="stats muted">
			<i class="icon-comments"></i> <?php 
            echo Num::format($this->area->topic_count, 0);
            ?>
			<i class="icon-comment"></i> <?php 
            echo Num::format($this->area->post_count, 0);
            ?>
		</small>

<?php 
        } else {
            // Empty area
            echo __('No topics yet.');
        }
        return ob_get_clean();
    }
Esempio n. 2
0
File: friend.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function render()
    {
        ob_start();
        ?>

<li class="media">
	<div class="pull-left">
		<?php 
        echo HTML::avatar($this->user['avatar'], $this->user['username']);
        ?>
	</div>
	<div class="media-body">

		<?php 
        if (Visitor::$user && !Visitor::$user->is_friend($this->user)) {
            ?>
		<?php 
            echo HTML::anchor(URL::user($this->user, 'friend') . '?token=' . Security::csrf(), '<i class="fa fa-heart"></i> ' . __('Add to friends'), array('class' => 'ajaxify btn btn-lovely btn-sm pull-right', 'data-ajaxify-target' => 'li.media'));
            ?>
		<?php 
        }
        ?>

		<?php 
        echo HTML::user($this->user);
        ?>
<br />
		<?php 
        if ($this->common) {
            ?>
		<small><?php 
            echo __(':friends mutual friends', array(':friends' => $this->common));
            ?>
</small><br />
		<?php 
        }
        ?>

	</div>
</li>

<?php 
        return ob_get_clean();
    }
Esempio n. 3
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $ignores = array();
        foreach ($this->user->find_ignores() as $ignore_id) {
            $ignore = Model_User::find_user_light($ignore_id);
            $ignores[$ignores['username']] = $ignore;
        }
        ksort($ignores, SORT_LOCALE_STRING);
        ?>

<ul class="media-list">
	<?php 
        foreach ($ignores as $ignore) {
            ?>

	<li class="media">
		<div class="pull-left">
			<?php 
            echo HTML::avatar($ignore['avatar'], $ignore['username']);
            ?>
		</div>
		<div class="media-body">
			<?php 
            echo HTML::user($ignore);
            ?>
<br />
			<?php 
            echo HTML::anchor(URL::user($ignore, 'unignore') . '?token=' . Security::csrf(), '<i class="fa fa-ban"></i> ' . __('Unignore'), array('class' => 'btn btn-default btn-sm ignore-delete'));
            ?>
		</div>
	</li>
	<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
Esempio n. 4
0
    /**
     * Render newsfeed.
     *
     * @return  string
     */
    public function content()
    {
        if ($items = $this->_items()) {
            ob_start();
            ?>

<ul class="media-list">

	<?php 
            foreach ($items as $item) {
                ?>
	<li class="media">
		<div class="pull-left">
			<?php 
                echo HTML::avatar($item['user']['avatar'], $item['user']['username'], $this->mini);
                ?>
		</div>
		<div class="media-body">
			<?php 
                echo HTML::user($item['user']);
                ?>
 <small class="pull-right"><?php 
                echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
                ?>
</small>
			<?php 
                echo $item['text'];
                ?>
		</div>
	</li>
	<?php 
            }
            ?>

</ul>

<?php 
            return ob_get_clean();
        }
        return __('Whoa, we are totally out of news items for you!');
    }
Esempio n. 5
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $friends = array();
        foreach ($this->user->find_friends() as $friend_id) {
            $friend = Model_User::find_user_light($friend_id);
            $friends[$friend['username']] = $friend;
        }
        ksort($friends, SORT_LOCALE_STRING);
        ?>

<ul class="unstyled">
	<?php 
        foreach ($friends as $friend) {
            ?>

	<li class="row-fluid">
		<?php 
            echo HTML::avatar($friend['avatar'], $friend['username']);
            ?>
		<?php 
            echo HTML::user($friend);
            ?>
		<?php 
            if ($friend['last_login']) {
                echo '<small class="ago">' . HTML::time(Date::short_span($friend['last_login'], true, true), $friend['last_login']) . '</small>';
            }
            ?>
	</li>
	<?php 
        }
        ?>

</ul>


<?php 
        return ob_get_clean();
    }
Esempio n. 6
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $ignores = array();
        foreach ($this->user->find_ignores() as $ignore_id) {
            $ignore = Model_User::find_user_light($ignore_id);
            $ignores[$ignores['username']] = $ignore;
        }
        ksort($ignores, SORT_LOCALE_STRING);
        ?>

<ul class="unstyled">
	<?php 
        foreach ($ignores as $ignore) {
            ?>

	<li class="row-fluid">
		<?php 
            echo HTML::avatar($ignore['avatar'], $ignore['username']);
            ?>
		<?php 
            echo HTML::user($ignore);
            ?>
<br />
		<?php 
            echo HTML::anchor(URL::user($ignore, 'unignore') . '?token=' . Security::csrf(), '<i class="icon-ban-circle icon-white"></i> ' . __('Unignore'), array('class' => 'btn btn-inverse btn-small ignore-delete'));
            ?>
	</li>
	<?php 
        }
        ?>

</ul>


<?php 
        return ob_get_clean();
    }
Esempio n. 7
0
File: index.php Progetto: anqh/blog
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if ($this->blog_entries && count($this->blog_entries)) {
            // List blog entries
            foreach ($this->blog_entries as $blog_entry) {
                /** @var  Model_Blog_Entry  $blog_entry */
                $author = $blog_entry->author();
                ?>

<article class="row blog-entry">
	<div class="span1"><?php 
                echo HTML::avatar($author['avatar'], $author['username']);
                ?>
</div>

	<div class="span7">
		<header>
			<h4><?php 
                echo HTML::anchor(Route::model($blog_entry), HTML::chars($blog_entry->name));
                ?>
</h4>
			<p><?php 
                echo __('By :user :ago', array(':user' => HTML::user($author), ':ago' => HTML::time(Date::fuzzy_span($blog_entry->created), $blog_entry->created)));
                ?>
</p>
		</header>
	</div>
</article>

<?php 
            }
        } else {
            // No blog entries available
            echo new View_Alert(__('Alas, the quill seems to be dry, no blog entries found.'), View_Alert::INFO);
        }
        return ob_get_clean();
    }
Esempio n. 8
0
File: new.php Progetto: anqh/core
    /**
     * Render content.
     *
     * @return  string
     */
    public function content()
    {
        $dates = array();
        foreach (Model_User::find_new_users($this->limit) as $user_id => $stamp) {
            $user = Model_User::find_user_light($user_id);
            $dates[Date::format(Date::DMY_SHORT, $stamp)][] = array('user' => $user, 'stamp' => $stamp);
        }
        ob_start();
        foreach ($dates as $date => $users) {
            ?>

<h4><?php 
            echo $date;
            ?>
</h4>
<ul class="block-grid three-up">
	<?php 
            foreach ($users as $user) {
                ?>
	<li>
		<?php 
                echo HTML::avatar($user['user']['avatar'], $user['user']['username']), ' ', HTML::user($user['user']);
                ?>
<br />
		<time class="muted"><?php 
                echo Date::format(Date::TIME, $user['stamp']);
                ?>
</time>
	</li>
	<?php 
            }
            ?>
</ul>

<?php 
        }
        return ob_get_clean();
    }
Esempio n. 9
0
    /**
     * Render newsfeed.
     *
     * @return  string
     */
    public function content()
    {
        if ($items = $this->_items()) {
            ob_start();
            ?>

<ul class="unstyled">

	<?php 
            foreach ($items as $item) {
                ?>
	<li class="row-fluid">
		<?php 
                echo HTML::avatar($item['user']['avatar'], $item['user']['username'], $this->mini);
                ?>
		<?php 
                echo HTML::user($item['user']);
                ?>
 <small class="ago"><?php 
                echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
                ?>
</small>
		<?php 
                echo $item['text'];
                ?>
	</li>
	<?php 
            }
            ?>

</ul>

<?php 
            return ob_get_clean();
        }
        return __('Whoa, we are totally out of news items for you!');
    }
Esempio n. 10
0
File: user.php Progetto: anqh/anqh
 /**
  * Build user page with generic parameters.
  *
  * @param   Model_User  $user
  * @return  View_Page
  */
 public static function _set_page(Model_User $user)
 {
     // Build page
     $view = new View_Page($user->display_name);
     if ($user->name) {
         //			$this->view->title_html = HTML::chars($user->username) . ' <small>' . HTML::chars($user->name) . '</small>';
     }
     if ($user->title) {
         $view->subtitle = HTML::chars($user->title);
     }
     $view->title_icon = HTML::avatar($user->avatar_url, $user->username);
     // Set actions
     if (Visitor::$user) {
         // Friend actions
         if (Permission::has($user, Model_User::PERMISSION_FRIEND)) {
             if (Visitor::$user->is_friend($user)) {
                 $view->actions[] = array('link' => URL::user($user, 'unfriend') . '?token=' . Security::csrf(), 'text' => '<i class="fa fa-heart-o"></i> ' . __('Remove friend'), 'class' => 'btn-default friend-delete');
             } else {
                 $view->actions[] = array('link' => URL::user($user, 'friend') . '?token=' . Security::csrf(), 'text' => '<i class="fa fa-heart"></i> ' . __('Add to friends'), 'class' => 'btn-lovely friend-add');
             }
         }
         // Ignore actions
         if (Permission::has($user, Model_User::PERMISSION_IGNORE)) {
             if (Visitor::$user->is_ignored($user)) {
                 $view->actions[] = array('link' => URL::user($user, 'unignore') . '?token=' . Security::csrf(), 'text' => '<i class="fa fa-ban"></i> ' . __('Unignore'), 'class' => 'btn-default ignore-delete');
             } else {
                 $view->actions[] = array('link' => URL::user($user, 'ignore') . '?token=' . Security::csrf(), 'text' => '<i class="fa fa-ban"></i> ' . __('Ignore'));
             }
         }
         $view->tabs['profile'] = array('link' => URL::user($user), 'text' => __('Profile'));
         $view->tabs['favorites'] = array('link' => URL::user($user, 'favorites'), 'text' => __('Favorites'));
         // Photographer profile
         $view->tabs['galleries'] = array('link' => Route::url('profile_galleries', array('username' => urlencode($user->username))), 'text' => __('Galleries'));
         // Artist profile
         $view->tabs['music'] = array('link' => Route::url('profile_music', array('username' => urlencode($user->username))), 'text' => __('Music'));
         // Blog
         $view->tabs['blog'] = array('link' => Route::url('blog_user', array('username' => urlencode($user->username))), 'text' => __('Blog'));
         // Friends
         $view->tabs['friends'] = array('link' => URL::user($user, 'friends'), 'text' => __('Friends'));
         // Owner / admin actions
         if (Permission::has($user, Model_User::PERMISSION_UPDATE)) {
             $view->tabs['ignores'] = array('link' => URL::user($user, 'ignores'), 'text' => __('Ignores'));
             $view->actions[] = array('link' => URL::user($user, 'image'), 'text' => '<i class="fa fa-picture-o"></i> ' . __('Add image'));
             $view->actions[] = array('link' => URL::user($user, 'settings'), 'text' => '<i class="fa fa-cog"></i> ' . __('Settings'));
         }
     }
     return $view;
 }
Esempio n. 11
0
File: post.php Progetto: anqh/forum
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<div class="pull-left">

	<?php 
        if ($this->author) {
            ?>
		<?php 
            echo HTML::avatar($this->author->avatar, $this->author->username);
            ?>

		<p>
			<small><?php 
            echo __('Posts: :posts', array(':posts' => '<var>' . Num::format($this->author->post_count, 0) . '</var>'));
            ?>
</small>
		</p>
	<?php 
        } else {
            ?>
		<?php 
            echo HTML::avatar(false);
            ?>

	<?php 
        }
        ?>

</div>

<div class="arrow"></div>

<div class="media-body">
	<header<?php 
        echo $this->forum_post->id == $this->forum_topic->last_post_id ? ' id="last"' : '';
        ?>
>
		<small class="ago">
			<?php 
        echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic))) . '#post-' . $this->forum_post->id, '#' . $this->nth, array('title' => __('Permalink')));
        ?>

			&bull;

			<?php 
        if (Permission::has($this->forum_post, Model_Forum_Post::PERMISSION_UPDATE, self::$_user)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'edit')), __('Edit'), array('class' => 'post-edit')) . ' &bull; ';
        }
        ?>

			<?php 
        if (Permission::has($this->forum_post, Model_Forum_Post::PERMISSION_DELETE, self::$_user)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'delete')) . '?token=' . Security::csrf(), __('Delete'), array('class' => 'post-delete')) . ' &bull; ';
        }
        ?>

			<?php 
        if (Permission::has($this->forum_topic, Model_Forum_Topic::PERMISSION_POST, self::$_user)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'quote')), __('Reply'), array('class' => 'post-quote')) . ' &bull; ';
        }
        ?>

			<?php 
        echo HTML::time(Date::short_span($this->forum_post->created, true, true), $this->forum_post->created);
        ?>
		</small>

		<?php 
        if ($this->author) {
            echo HTML::user($this->author->light_array());
            if ($this->author->title) {
                echo ' <small>&ldquo;' . HTML::chars($this->author->title) . '&rdquo;</small>';
            }
        } else {
            echo $this->forum_post->author_name;
            echo ' <small>&ldquo;' . __('Guest') . '&rdquo;</small>';
        }
        ?>
	</header>

	<?php 
        if ($this->forum_post->parent_id) {
            echo __('Replying to :parent', array(':parent' => HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => Route::model_id($this->forum_topic), 'id' => $this->forum_post->parent_id)) . '#post-' . $this->forum_post->parent_id, HTML::chars($this->forum_post->parent()->topic()->name))));
        }
        ?>

	<?php 
        echo BB::factory($this->forum_post->post)->render();
        ?>

	<footer>
		<?php 
        echo $this->author && $this->author->signature ? BB::factory("\n--\n" . $this->author->signature)->render() : '';
        ?>

		<?php 
        if ($this->forum_post->modify_count > 0) {
            echo '<br /><br />' . __('Edited :ago', array(':ago' => HTML::time(Date::fuzzy_span($this->forum_post->modified), $this->forum_post->modified)));
        }
        ?>
	</footer>
</div>

<?php 
        return ob_get_clean();
    }
Esempio n. 12
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Create form attributes
        $attributes = array('class' => 'form-horizontal small-labels');
        if ($this->form_id) {
            $attributes['id'] = $this->form_id;
        }
        $button = __('Save');
        if (!$this->form_action) {
            switch ($this->mode) {
                case self::QUOTE:
                    $this->form_action = Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => $this->forum_topic->id, 'id' => $this->forum_post->parent_id, 'action' => 'quote'));
                    $button = __('Reply');
                    break;
                case self::REPLY:
                    $this->form_action = Route::model($this->forum_topic, 'reply');
                    $button = __('Reply');
                    break;
                case self::EDIT_POST:
                    $this->form_action = Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => $this->forum_topic->id, 'id' => $this->forum_post->id, 'action' => 'edit'));
                    break;
            }
        }
        echo Form::open($this->form_action ? $this->form_action : null, $attributes);
        // Progressively add content, note that we don't break
        switch ($this->mode) {
            // Adding new topic
            case self::NEW_TOPIC:
                // Editing an old topic
            // Editing an old topic
            case self::EDIT_TOPIC:
                $is_admin = self::$_user->has_role(array('admin', 'moderator', 'forum moderator'));
                if ($is_admin) {
                    ?>

<fieldset class="row">
	<div class="span3">
		<?php 
                    echo Form::control_group(Form::select('status', array(Model_Forum_Topic::STATUS_NORMAL => __('Normal'), Model_Forum_Topic::STATUS_SINK => __('Sink'), Model_Forum_Topic::STATUS_LOCKED => __('Locked')), $this->forum_topic->status, array('class' => 'input-small')), array('status' => __('Status')), Arr::get($this->errors, 'status'));
                    ?>
	</div>

	<div class="span3">
		<?php 
                    echo Form::control_group(Form::select('sticky', array(Model_Forum_Topic::STICKY_NORMAL => __('Normal'), Model_Forum_Topic::STICKY_STICKY => __('Sticky')), $this->forum_topic->sticky, array('class' => 'input-small')), array('sticky' => __('Stickyness')), Arr::get($this->errors, 'sticky'));
                    ?>
	</div>
</fieldset>

		<?php 
                }
                ?>

	<?php 
                echo Form::control_group(Form::input('name', $this->forum_topic->name, array('class' => 'input-block-level')), array('name' => __('Topic')), Arr::get($this->errors, 'name'));
                ?>

	<?php 
                if ($this->private) {
                    echo Form::control_group(Form::textarea('recipients', $this->recipients, array('rows' => 3, 'placeholder' => __('Required'), 'class' => 'input-block-level'), true), array('recipients' => __('Recipients')), Arr::get($this->errors, 'recipients'));
                }
                ?>

<?php 
                if ($this->mode === self::EDIT_TOPIC && !$is_admin) {
                    break;
                }
                // Replying to a topic
            // Replying to a topic
            case self::REPLY:
            case self::QUOTE:
                ?>

<div class="pull-left">
	<?php 
                echo HTML::avatar(self::$_user->avatar, self::$_user->username);
                ?>
</div>

<div class="arrow"></div>

<?php 
                // Editing old post
            // Editing old post
            case self::EDIT_POST:
                ?>

<div class="post-edit media-body form-vertical">
	<header>
		<?php 
                echo HTML::user(self::$_user);
                ?>
	</header>

	<fieldset>
		<?php 
                echo Form::control_group(Form::textarea_editor('post', $this->forum_post->post, array('id' => uniqid(), 'class' => 'input-block-level'), true), null, Arr::get($this->errors, 'post'));
                ?>
	</fieldset>

	<fieldset class="form-actions">
		<?php 
                echo Form::button('save', $button, array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
                ?>
		<?php 
                echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
                ?>

		<?php 
                echo Form::csrf();
                ?>
	</fieldset>

</div>

<?php 
        }
        echo Form::close();
        // Auto-complete recipients
        if ($this->private) {
            ?>

<script>
head.ready('anqh', function() {
	$('textarea[name=recipients]').autocompleteUser({ user: <?php 
            echo self::$_user_id;
            ?>
, maxUsers: 100 });
});
</script>

<?php 
        }
        return ob_get_clean();
    }
Esempio n. 13
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
/**
 * Visitor card
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2010 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
if ($user) {
    // Member
    echo __(':user <var class="uid">[#:id]</var>', array(':id' => $user->id, ':user' => HTML::user($user))), '<br />';
    echo HTML::avatar($user->avatar, $user->username);
    ?>
<ul>
	<li><?php 
    echo HTML::anchor(URL::user($user, 'settings'), __('Settings'));
    ?>
</li>
	<li><?php 
    echo HTML::anchor(Route::get('sign')->uri(array('action' => 'out')), __('Sign out'));
    ?>
</li>
</ul>
<?php 
    $new_comments = $user->find_new_comments();
    if (!empty($new_comments)) {
        ?>
<ul class="new-messages">
Esempio n. 14
0
 * Friendlist
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
?>
<ul>
	<?php 
foreach ($friends as $friend) {
    ?>

	<li class="group">
		<?php 
    echo HTML::avatar($friend['avatar'], $friend['username']);
    ?>
		<?php 
    echo HTML::user($friend);
    ?>
		<?php 
    if (isset($friend['last_login'])) {
        echo '<small class="ago">', HTML::time(Date::short_span($friend['last_login'], true, true), $friend['last_login']), '</small>';
    }
    ?>
	</li>
	<?php 
}
?>

</ul>
Esempio n. 15
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $facebook = $this->consumer ? $this->load_facebook() : false;
        $tabs = array('basic' => '<i class="hidden-sm fa fa-fw fa-user"></i> ' . __('Profile'), 'auth' => '<i class="hidden-sm fa fa-fw fa-key"></i> ' . __('Username & Email'), 'facebook' => '<i class="hidden-sm fa fa-fw fa-facebook"></i> ' . 'Facebook', 'forum' => '<i class="hidden-sm fa fa-fw fa-comments"></i> ' . __('Forum'));
        echo Form::open();
        ?>

<?php 
        if ($this->errors) {
            ?>
<div class="alert alert-danger">
	<strong><?php 
            echo __('Error happens!');
            ?>
</strong>
	<ul>
		<?php 
            foreach ((array) $this->errors as $error) {
                ?>
		<li><?php 
                echo $error;
                ?>
</li>
		<?php 
            }
            ?>
	</ul>
</div>
<?php 
        }
        ?>

<ul class="nav nav-pills nav-stacked col-sm-2">
	<?php 
        foreach ($tabs as $tab => $title) {
            ?>
	<li<?php 
            echo $tab == $this->tab ? ' class="active"' : '';
            ?>
>
		<a href="#settings-<?php 
            echo $tab;
            ?>
" data-toggle="tab"><?php 
            echo $title;
            ?>
</a>
	</li>
	<?php 
        }
        ?>
</ul>

<div class="tab-content col-md-10">

	<div id="settings-basic" class="tab-pane<?php 
        echo $this->tab == 'basic' ? ' active' : '';
        ?>
">
		<fieldset id="fields-basic" class="col-sm-6">

			<div class="row">
			<div class="col-sm-10">
				<?php 
        echo Form::input_wrap('avatar', $this->user->avatar_url, null, __('Avatar'), Arr::get($this->errors, 'avatar'));
        ?>
			</div>
			<div class="col-sm-2">
				<?php 
        echo HTML::avatar($this->user->avatar_url, null, null, false);
        ?>
			</div>
			</div>


			<?php 
        echo Form::input_wrap('name', $this->user->name, null, __('Name'), Arr::get($this->errors, 'name'));
        ?>

			<?php 
        echo Form::radios_wrap('name_visibility', array(Model_User::NAME_VISIBLE => __('Visible'), Model_User::NAME_HIDDEN => __('Hidden')), $this->user->setting('user.name'), null, null, null, null, true);
        ?>

			<?php 
        echo Form::input_wrap('homepage', $this->user->homepage, null, __('Homepage'), Arr::get($this->errors, 'homepage'));
        ?>

			<?php 
        echo Form::radios_wrap('gender', array('f' => '<i class="fa fa-female female"></i> ' . __('Female'), 'm' => '<i class="fa fa-male male"></i> ' . __('Male'), 'o' => __('Other')), $this->user->gender, null, __('Gender'), Arr::get($this->errors, 'gender'), null, true);
        ?>

			<?php 
        echo Form::input_wrap('dob', $this->user->dob ? Date::format('DMYYYY', $this->user->dob) : null, array('class' => 'date', 'maxlength' => 10, 'size' => 7, 'placeholder' => 'd.m.yyyy'), __('Date of Birth'), Arr::get($this->errors, 'dob'));
        ?>

			<?php 
        echo Form::radios_wrap('dob_visibility', array(Model_User::DOB_VISIBLE => __('Visible'), Model_User::DOB_DATEONLY => __('Date only in profile'), Model_User::DOB_HIDDEN => __('Hidden')), $this->user->setting('user.dob'), null, null, null, null, true);
        ?>

		</fieldset>

		<fieldset id="fields-location" class="col-md-6">

			<?php 
        echo Form::input_wrap('location', $this->user->location, null, __('Where you at?'), Arr::get($this->errors, 'location'), __('e.g. <em>"Helsinki"</em> or <em>"Asema-aukio, Helsinki"</em>'));
        ?>

			<?php 
        echo Form::input_wrap('city_name', $this->user->city_name, null, __('City'), Arr::get($this->errors, 'city_name'));
        ?>

			<div id="map"></div>
		</fieldset>
	</div>


	<div id="settings-auth" class="tab-pane<?php 
        echo $this->tab == 'auth' ? ' active' : '';
        ?>
">
		<fieldset id="fields-basic" class="col-md-6">

			<?php 
        echo Form::input_wrap('username', $this->user->username, array('required', 'placeholder' => __('Required')), __('Username'), Arr::get($this->errors, 'username'));
        ?>

			<?php 
        echo Form::input_wrap('email', $this->user->email, array('required', 'placeholder' => __('Required')), __('Email'), Arr::get($this->errors, 'email'));
        ?>

			<?php 
        echo Form::password_wrap('password', null, array('placeholder' => __('Optional')), __('New password'), Arr::get($this->errors, 'password'), __('Size <em>does</em> matter - the longer, the better.'));
        ?>

			<?php 
        echo Form::password_wrap('current_password', null, array('placeholder' => __('Required')), __('Current password'), Arr::get($this->errors, 'current_password'), __('For your protection we require your current password.'));
        ?>

		</fieldset>
	</div>


	<div id="settings-facebook" class="tab-pane<?php 
        echo $this->tab == 'facebook' ? ' active' : '';
        ?>
">
		<fieldset id="fields-connections" class="col-md-6">

		<?php 
        if (!$this->external || !$this->external->loaded()) {
            ?>

			<?php 
            echo HTML::anchor(Route::url('oauth', array('action' => 'login', 'provider' => 'facebook')), '<i class="fa fa-facebook"></i> ' . __('Connect to Facebook'), array('class' => 'btn btn-primary btn-lg', 'title' => __('Connect with your Facebook account')));
            ?>

		<?php 
        } elseif (is_array($facebook)) {
            $avatar = 'https://graph.facebook.com/' . $facebook['id'] . '/picture';
            ?>

			<div class="media">
				<?php 
            echo HTML::avatar($avatar, null, 'pull-left facebook', false);
            ?>
				<div class="media-body">
					<?php 
            echo HTML::anchor($facebook['link'], HTML::chars($facebook['name']), array('target' => '_blank'));
            ?>
					<?php 
            echo Form::checkbox_wrap('avatar', $avatar, $this->user->avatar_url == $avatar, null, __('Set as your avatar'));
            ?>
					<?php 
            echo Form::checkbox_wrap('picture', $avatar . '?type=large', $this->user->picture == $avatar . '?type=large', null, __('Set as your profile image'));
            ?>
					<?php 
            echo HTML::anchor(Route::url('oauth', array('action' => 'disconnect', 'provider' => 'facebook')), '<i class="icon-facebook"></i> ' . __('Disconnect your Facebook account'), array('class' => 'btn btn-danger facebook-delete', 'title' => __('Disconnect your Facebook account')));
            ?>
				</div>
			</div>

		<?php 
        } elseif ($facebook) {
            ?>

			<?php 
            echo $facebook;
            ?>

			<?php 
            echo HTML::anchor(Route::url('oauth', array('action' => 'disconnect', 'provider' => 'facebook')), '<i class="icon-facebook"></i> ' . __('Disconnect your Facebook account'), array('class' => 'btn btn-danger facebook-delete', 'title' => __('Disconnect your Facebook account')));
            ?>

		<?php 
        }
        ?>

		</fieldset>
	</div>


	<div id="settings-forum" class="tab-pane<?php 
        echo $this->tab == 'forum' ? ' active' : '';
        ?>
">
		<fieldset id="fields-forum" class="col-md-6">

			<?php 
        echo Form::input_wrap('title', $this->user->title, null, __('Title'), Arr::get($this->errors, 'title'));
        ?>

			<?php 
        echo Form::textarea_wrap('signature', $this->user->signature, array('class' => 'monospace', 'rows' => 5), true, __('Signature'), Arr::get($this->errors, 'signature'));
        ?>

		</fieldset>
	</div>

</div>

<div class="row">
	<fieldset class="col-xs-12 text-center">
		<br>
		<?php 
        echo Form::hidden('latitude', $this->user->latitude);
        ?>
		<?php 
        echo Form::hidden('longitude', $this->user->longitude);
        ?>

		<?php 
        echo Form::csrf();
        ?>
		<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-lg'));
        ?>
		<?php 
        echo HTML::anchor(URL::user($this->user), __('Cancel'), array('class' => 'cancel'));
        ?>
	</fieldset>
</div>


<?php 
        echo Form::close();
        echo $this->javascript();
        return ob_get_clean();
    }
Esempio n. 16
0
File: page.php Progetto: anqh/anqh
    /**
     * Render visitor.
     *
     * @return  string
     */
    protected function _visitor()
    {
        ob_start();
        ?>

	<li id="notifications"><?php 
        echo implode(' ', Anqh::notifications(Visitor::$user));
        ?>
</li>

	<li class="hidden-xs">
		<?php 
        echo HTML::avatar(Visitor::$user->avatar_url, Visitor::$user->username, 'small');
        ?>
	</li>

	<li id="visitor" class="dropdown">
		<a class="user dropdown-toggle" href="#menu-profile" data-toggle="dropdown"><?php 
        echo HTML::chars(Visitor::$user->username);
        ?>
 <span class="caret"></span></i></a>
		<ul class="dropdown-menu pull-right" role="menu">
			<?php 
        foreach (Kohana::$config->load('site.menu_visitor') as $item) {
            ?>
			<li role="menuitem"><?php 
            echo HTML::anchor($item['url'], '<i class="' . $item['icon'] . '"></i> ' . $item['text']);
            ?>
</li>
			<?php 
        }
        ?>
			<?php 
        if (Visitor::$user->has_role('admin')) {
            ?>
			<li role="presentation" class="dropdown-header"><?php 
            echo __('Admin functions');
            ?>
</li>
				<?php 
            foreach (Kohana::$config->load('site.menu_admin') as $item) {
                ?>
			<li role="menuitem"><?php 
                echo HTML::anchor($item['url'], '<i class="' . $item['icon'] . '"></i> ' . $item['text'], Arr::get($item, 'attributes'));
                ?>
</li>
				<?php 
            }
            ?>
			<?php 
        }
        ?>
		</ul>
	</li>

<?php 
        return ob_get_clean();
    }
Esempio n. 17
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
/**
 * Ignorelist
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
?>
<ul>
	<?php 
foreach ($ignores as $ignore) {
    ?>

	<li class="group">
		<?php 
    echo HTML::avatar($ignore['avatar'], $ignore['username']);
    ?>
		<?php 
    echo HTML::user($ignore);
    ?>
	</li>
	<?php 
}
?>

</ul>
Esempio n. 18
0
        $classes[] = 'owner';
    }
    ?>

<article id="comment-<?php 
    echo $comment->id;
    ?>
" class="<?php 
    echo implode(' ', $classes);
    ?>
">


	<header>
		<?php 
    echo HTML::avatar($comment->author->avatar, $comment->author->username, true);
    ?>
		<?php 
    echo HTML::user($comment->author, $comment->author->username);
    ?>
		<small class="ago"><?php 
    echo HTML::time(Date::short_span($comment->created, true, true), $comment->created);
    ?>
</small>

		<?php 
    if ($user && $comment->user->id == $user->id || $mine) {
        ?>
		<span class="actions alt">
			<?php 
        if ($private && !$comment->private) {
Esempio n. 19
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Create form attributes
        $attributes = array('class' => 'media');
        if ($this->form_id) {
            $attributes['id'] = $this->form_id;
        }
        $button = __('Save');
        $author = Visitor::$user;
        if (!$this->form_action) {
            switch ($this->mode) {
                case self::QUOTE:
                    $this->form_action = Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => $this->forum_topic->id, 'id' => $this->forum_post->parent_id, 'action' => 'quote'));
                    $button = __('Reply');
                    break;
                case self::REPLY:
                    $this->form_action = Route::model($this->forum_topic, 'reply');
                    $button = __('Reply');
                    break;
                case self::EDIT_POST:
                    $this->form_action = Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => $this->forum_topic->id, 'id' => $this->forum_post->id, 'action' => 'edit'));
                    $author = $this->forum_post->author();
                    break;
            }
        }
        echo Form::open($this->form_action ? $this->form_action : null, $attributes);
        // Progressively add content, note that we don't break
        switch ($this->mode) {
            // Adding new topic
            case self::NEW_TOPIC:
                // Editing an old topic
            // Editing an old topic
            case self::EDIT_TOPIC:
                $is_admin = Visitor::$user->has_role(array('admin', 'moderator', 'forum moderator'));
                if ($is_admin) {
                    // Build available areas list
                    $areas = array();
                    foreach (Model_Forum_Group::factory()->find_all() as $_group) {
                        $areas[$_group->name] = array();
                        foreach ($_group->areas() as $_area) {
                            $areas[$_group->name][$_area->id] = $_area->name;
                        }
                    }
                    ?>

<div class="panel panel-danger">
	<header class="panel-heading"><?php 
                    echo __('Admin tools');
                    ?>
</header>
	<fieldset class="form-horizontal panel-body">
		<div class="col-md-6">
			<?php 
                    echo Form::radios_wrap('sticky', array(Model_Forum_Topic::STICKY_NORMAL => __('Normal'), Model_Forum_Topic::STICKY_STICKY => '<i class="fa fa-thumb-tack text-warning"></i> ' . __('Pinned')), (int) $this->forum_topic->sticky, array('class' => 'radios'), __('Pinning'), Arr::get($this->errors, 'sticky'), null, true);
                    ?>
		</div>

		<div class="col-md-6">
			<?php 
                    echo Form::radios_wrap('status', array(Model_Forum_Topic::STATUS_NORMAL => __('Normal'), Model_Forum_Topic::STATUS_SINK => '<i class="fa fa-unlock text-muted"></i> ' . __('Sink'), Model_Forum_Topic::STATUS_LOCKED => '<i class="fa fa-lock text-muted"></i> ' . __('Locked')), (int) $this->forum_topic->status, array('class' => 'radios'), __('Status'), Arr::get($this->errors, 'status'), null, true);
                    ?>
		</div>

		<div class="col-md-12">
			<?php 
                    if (!$this->private) {
                        echo Form::select_wrap('forum_area_id', $areas, $this->forum_topic->forum_area_id, null, __('Area'), Arr::get($this->errors, 'forum_area_id'));
                    }
                    ?>
		</div>

	</fieldset>
</div>

		<?php 
                }
                // admin
                ?>

	<?php 
                echo Form::input_wrap('name', $this->forum_topic->name, null, __('Topic'), Arr::get($this->errors, 'name'));
                ?>

	<?php 
                if ($this->private) {
                    echo Form::textarea_wrap('recipients', $this->recipients, array('rows' => 3, 'placeholder' => __('Required')), true, __('Recipients'), Arr::get($this->errors, 'recipients'));
                }
                ?>

	<?php 
                if ($this->mode === self::EDIT_TOPIC && !$is_admin) {
                    ?>

<fieldset>
	<?php 
                    echo Form::button('save', $button, array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
                    ?>
	<?php 
                    echo Form::button('preview', __('Preview'), array('class' => 'btn btn-default btn-large'));
                    ?>
	<?php 
                    echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
                    ?>

	<?php 
                    echo Form::csrf();
                    ?>
</fieldset>

<?php 
                    break;
                }
                // Replying to a topic
            // Replying to a topic
            case self::REPLY:
            case self::QUOTE:
                ?>

<div class="pull-left">
	<?php 
                echo HTML::avatar(Visitor::$user->avatar_url, Visitor::$user->username);
                ?>
</div>

<?php 
                // Editing old post
            // Editing old post
            case self::EDIT_POST:
                ?>

<div class="post-edit media-body panel panel-success form-vertical">
	<header class="panel-heading">
		<?php 
                echo $author ? HTML::user($author) : HTML::chars($this->forum_post->author_name);
                ?>
	</header>

	<fieldset class="panel-body">
		<?php 
                echo Form::textarea_wrap('post', $this->forum_post->post, array('id' => uniqid()), true, null, Arr::get($this->errors, 'post'), null, true);
                ?>
	</fieldset>

	<fieldset class="panel-body">
		<?php 
                echo Form::button('save', $button, array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
                ?>
		<?php 
                echo Form::button('preview', __('Preview'), array('class' => 'btn btn-default btn-large'));
                ?>
		<?php 
                echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
                ?>

		<?php 
                echo Form::csrf();
                ?>
	</fieldset>
</div>

<?php 
        }
        ?>


<?php 
        echo Form::close();
        // Auto-complete recipients
        if ($this->private) {
            ?>

<script>
head.ready('anqh', function() {
	$('textarea[name=recipients]').autocompleteUser({
		user:     <?php 
            echo Visitor::$user->id;
            ?>
,
		maxUsers: 100
	});
});
</script>

<?php 
        }
        return ob_get_clean();
    }
Esempio n. 20
0
File: oauth.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<div class="alert alert-info">
	<?php 
        echo __("You haven't connected your accounts using :email yet. Please enter your password for :username and we will do the connecting for you!", array(':email' => '<strong>' . $this->external_user['email'] . '</strong>', ':username' => '<strong>' . HTML::chars($this->user->username) . '</strong>'));
        ?>
</div>

<div class="row">

	<br />

	<div class="media span3">
		<?php 
        echo HTML::avatar('https://graph.facebook.com/' . $this->external_user['id'] . '/picture', null, 'pull-left facebook');
        ?>
		<div class="media-body">
			<?php 
        echo HTML::anchor($this->external_user['link'], HTML::chars($this->external_user['name']), array('target' => '_blank'));
        ?>
		</div>
	</div>

	<div class="span1">
		<br />
		<i class="text-info icon-link"></i>
	</div>

	<div class="media span3">
		<?php 
        echo HTML::avatar($this->user->avatar_url, $this->user->username, 'pull-left');
        ?>
		<div class="media-body">
			<?php 
        echo HTML::user($this->user);
        ?>
		</div>
	</div>

</div>

<br />

<div class="form-actions">

	<?php 
        echo Form::open(Route::url('sign', array('action' => 'in')), array('class' => 'form-inline'));
        ?>

	<div class="input-append">
		<?php 
        echo Form::password('password', null, array('class' => 'input-small', 'placeholder' => __('Password')));
        ?>
		<?php 
        echo Form::button(null, __('Sign in') . ' <i class="icon-signin"></i>', array('class' => 'btn btn-primary', 'title' => __('Sign in and connect accounts')));
        ?>
	</div>

	<?php 
        echo Form::hidden('username', $this->user->username);
        ?>
	<?php 
        echo Form::hidden('external', 'facebook');
        ?>
	<?php 
        echo Form::hidden('remember', 'true');
        ?>
	<?php 
        echo Form::close();
        ?>

</div>

<?php 
        return ob_get_clean();
    }
Esempio n. 21
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Comment form
        echo $this->form();
        // Pagination
        if ($this->pagination) {
            echo $this->pagination->render();
        }
        ?>

<ul class="media-list">

<?php 
        $new_comments = isset($new_comments) ? (int) $new_comments : 0;
        foreach ($this->comments as $comment) {
            /** @var  Model_Comment  $comment */
            $author = $comment->author();
            // Ignore
            if (Visitor::$user && Visitor::$user->is_ignored($author)) {
                continue;
            }
            $classes = array('media');
            // Private comment?
            if ($comment->private) {
                $classes[] = 'private';
            }
            // Viewer's post
            if (Visitor::$user && $author['id'] == Visitor::$user->id) {
                $classes[] = 'my';
            }
            // Topic author's post
            if ($author['id'] == $comment->user_id) {
                $classes[] = 'owner';
            }
            // New comment?
            if ($new_comments-- > 0) {
                $classes[] = 'new';
            }
            ?>

	<li class="<?php 
            echo implode(' ', $classes);
            ?>
" id="comment-<?php 
            echo $comment->id;
            ?>
">
		<div class="pull-left">
			<?php 
            echo HTML::avatar($author['avatar'], $author['username']);
            ?>
		</div>
		<div class="arrow"></div>
		<div class="media-body">
			<small class="pull-right">
				<?php 
            if (Visitor::$user && $comment->user_id == Visitor::$user->id || in_array('my', $classes)) {
                if ($this->private && !$comment->private) {
                    echo HTML::anchor(sprintf($this->private, $comment->id), __('Set as private'), array('class' => 'comment-private')) . ' &bull; ';
                }
                if ($this->delete) {
                    echo HTML::anchor(sprintf($this->delete, $comment->id), __('Delete'), array('class' => 'comment-delete')) . ' &bull; ';
                }
            }
            ?>

				<?php 
            echo in_array('new', $classes) ? __('New') : '';
            ?>
 <?php 
            echo HTML::time(Date::short_span($comment->created, true, true), $comment->created);
            ?>
			</small>
			<?php 
            echo HTML::user($author);
            ?>
<br />
			<?php 
            echo $comment->private ? '<span class="label label-special" title="' . __('Private comment') . '">' . __('Priv') . '</span>: ' : '';
            ?>
			<?php 
            echo Text::smileys(Text::auto_link_urls(HTML::chars($comment->comment)));
            ?>
		</div>
	</li>

	<?php 
        }
        ?>

</ul>

<?php 
        // Pagination
        if ($this->pagination) {
            echo $this->pagination->render();
        }
        return ob_get_clean();
    }
Esempio n. 22
0
/**
 * Blog entries
 *
 * @package    Blog
 * @author     Antti Qvickström
 * @copyright  (c) 2010-2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
foreach ($entries as $entry) {
    $author = $entry->author();
    ?>

<article>
	<header>
		<?php 
    echo HTML::avatar($author['avatar'], $author['username']);
    ?>
		<h4><?php 
    echo HTML::anchor(Route::model($entry), HTML::chars($entry->name), array('title' => $entry->name));
    ?>
</h4>
		<span class="details">
		<?php 
    echo __('By :user :ago', array(':user' => HTML::user($author), ':ago' => HTML::time(Date::fuzzy_span($entry->created), $entry->created)));
    ?>
		</span>
	</header>
</article>

<?php 
}
Esempio n. 23
0
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2010 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
?>

<ul>
	<?php 
foreach ($newsfeed as $item) {
    ?>

		<li class="group">
			<?php 
    echo HTML::avatar($item['user']->avatar, $item['user']->username, isset($mini) && $mini);
    ?>
			<?php 
    echo HTML::user($item['user']);
    ?>
			<small class="ago"><?php 
    echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
    ?>
</small>
			<?php 
    echo $item['text'];
    ?>
		</li>
	<?php 
}
?>
Esempio n. 24
0
</li>
	</ul>

	<div id="newsfeed-all">
<?php 
}
?>

		<ul>
			<?php 
foreach ($newsfeed as $item) {
    ?>

				<li class="group">
					<?php 
    echo HTML::avatar($item['user']['avatar'], $item['user']['username'], isset($mini) && $mini);
    ?>
					<?php 
    echo HTML::user($item['user']);
    ?>
					<small class="ago"><?php 
    echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
    ?>
</small>
					<?php 
    echo $item['text'];
    ?>
				</li>
			<?php 
}
?>
Esempio n. 25
0
File: page.php Progetto: anqh/core
    /**
     * Render visitor.
     *
     * @return  string
     */
    protected function _visitor()
    {
        ob_start();
        /*
        // Sunrise
        if (self::$_user && self::$_user->latitude && self::$_user->longitude) {
        	$latitude  = self::$_user->latitude;
        	$longitude = self::$_user->longitude;
        } else {
        	$latitude  = 60.1829;
        	$longitude = 24.9549;
        }
        $sun = date_sun_info(time(), $latitude, $longitude);
        $sunrise = __(':day, week :week | Sunrise: :sunrise | Sunset: :sunset', array(
        	':day'     => strftime('%A'),
        	':week'    => strftime('%V'),
        	':sunrise' => Date::format(Date::TIME, $sun['sunrise']),
        	':sunset'  => Date::format(Date::TIME, $sun['sunset'])
        ));
        */
        ?>

	<nav id="visitor" class="navbar-text">
		<ul class="nav" role="menubar">
			<li class="menuitem-notifications"><span><?php 
        echo implode(' ', Anqh::notifications(self::$_user));
        ?>
</span></li>
			<li role="menuitem" class="menuitem-profile"><?php 
        echo HTML::avatar(self::$_user->avatar, self::$_user->username, true);
        ?>
</li>

			<li class="dropdown menu-me" role="menuitem" aria-haspopup="true">
				<a class="dropdown-toggle" href="#" data-toggle="dropdown"><?php 
        echo HTML::chars(self::$_user->username);
        ?>
 <b class="caret"></b></a>
				<ul class="dropdown-menu pull-right" role="menu">
					<li role="menuitem"><?php 
        echo HTML::anchor(URL::user(self::$_user->username), '<i class="icon-user icon-white"></i> ' . __('Profile'));
        ?>
<li>
					<li role="menuitem"><?php 
        echo HTML::anchor(Forum::private_messages_url(), '<i class="icon-envelope icon-white"></i> ' . __('Private messages'));
        ?>
</li>
					<li role="menuitem"><?php 
        echo HTML::anchor(URL::user(self::$_user, 'favorites'), '<i class="icon-calendar icon-white"></i> ' . __('Favorites'));
        ?>
</li>
					<li role="menuitem"><?php 
        echo HTML::anchor(URL::user(self::$_user, 'friends'), '<i class="icon-heart icon-white"></i> ' . __('Friends'));
        ?>
</li>
					<li role="menuitem"><?php 
        echo HTML::anchor(URL::user(self::$_user, 'ignores'), '<i class="icon-ban-circle icon-white"></i> ' . __('Ignores'));
        ?>
</li>
					<li role="menuitem"><?php 
        echo HTML::anchor(URL::user(self::$_user, 'settings'), '<i class="icon-cog icon-white"></i> ' . __('Settings'));
        ?>
</li>
					<?php 
        if (self::$_user->has_role('admin')) {
            ?>
					<li class="divider"></li>
					<li class="nav-header"><?php 
            echo __('Admin functions');
            ?>
</li>
					<li role="menuitem" class="admin"><?php 
            echo HTML::anchor(Route::url('roles'), '<i class="icon-asterisk icon-white"></i> ' . __('Roles'));
            ?>
</li>
					<li role="menuitem" class="admin"><?php 
            echo HTML::anchor(Route::url('tags'), '<i class="icon-tags icon-white"></i> ' . __('Tags'));
            ?>
</li>
					<li role="menuitem" class="admin"><?php 
            echo HTML::anchor('#debug', '<i class="icon-signal icon-white"></i> ' . __('Profiler'), array('onclick' => "\$('div.kohana').toggle();"));
            ?>
</li>
					<?php 
        }
        ?>
					<li class="divider"></li>
					<li role="menuitem">
						<?php 
        echo HTML::anchor(Route::url('sign', array('action' => 'out')), '<i class="icon-off icon-white"></i> ' . __('Sign out'));
        ?>
					</li>
				</ul>
			</li>

			<li class="dropdown menu-search" role="menuitem" aria-haspopup="true">
					<a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="icon-search icon-white"></i> <b class="caret"></b></a>
					<ul class="dropdown-menu pull-right" role="menu">
						<li role="menuitem">
							<?php 
        echo Form::open(null, array('id' => 'form-search-events', 'class' => 'hidden-phone'));
        ?>
							<label class="span2">
								<i class="icon-calendar icon-white"></i>
								<?php 
        echo Form::input('search-events', null, array('class' => 'input-small search-query', 'placeholder' => __('Search events..'), 'title' => __('Enter at least 3 characters')));
        ?>
							</label>
							<?php 
        echo Form::close();
        ?>
						</li>
						<li role="menuitem">
							<?php 
        echo Form::open(null, array('id' => 'form-search-users', 'class' => 'hidden-phone'));
        ?>
							<label class="span2">
								<i class="icon-user icon-white"></i>
								<?php 
        echo Form::input('search-users', null, array('class' => 'input-small search-query', 'placeholder' => __('Search users..'), 'title' => __('Enter at least 2 characters')));
        ?>
							</label>
							<?php 
        echo Form::close();
        ?>
						</li>
					</ul>
			</li>


		</ul>
	</nav><!-- #visitor -->


<?php 
        return ob_get_clean();
    }
Esempio n. 26
0
File: post.php Progetto: anqh/forum
<br />
				<small><?php 
    echo HTML::chars($author['title']);
    ?>
</small>
				<p>
					<small><?php 
    echo __('Posts: :posts', array(':posts' => '<var>' . Num::format($author_full->post_count, 0)));
    ?>
</small>
				</p>
			<?php 
} else {
    ?>
				<?php 
    echo HTML::avatar(false);
    ?>

				<?php 
    echo $post->author_name;
    ?>
<br />
				<small><?php 
    echo __('Guest');
    ?>
</small>
			<?php 
}
?>
		</section>
Esempio n. 27
0
File: index.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if (count($this->topics)) {
            ?>

<table class="table table-condensed table-striped">
	<tbody>

	<?php 
            foreach ($this->topics as $topic) {
                $last_poster = $topic->last_post()->author();
                $area = $this->area ? false : $topic->area();
                ?>

	<tr>

		<td>
			<h4 class="media-heading">
			<?php 
                if ($this->area || $topic->recipient_count) {
                    ?>
				<?php 
                    echo HTML::anchor(Route::model($topic), Forum::topic($topic));
                    ?>
				<small class="transparent"><?php 
                    echo HTML::anchor(Route::model($topic, '?page=last#last'), '<i class="text-muted fa fa-level-down"></i>', array('title' => __('Last post')));
                    ?>
</small>
			<?php 
                } else {
                    ?>
				<?php 
                    echo HTML::anchor(Route::model($topic, '?page=last#last'), Forum::topic($topic));
                    ?>
				<small class="transparent"><?php 
                    echo HTML::anchor(Route::model($topic), '<i class="text-muted fa fa-level-up"></i>', array('title' => __('First post')));
                    ?>
</small>
			<?php 
                }
                ?>
			</h4>

			<?php 
                if ($area) {
                    ?>
			<small class="muted">
				<?php 
                    echo HTML::anchor(Route::model($area), HTML::chars($area->name), array('class' => 'hoverable'));
                    ?>
			</small>
			<?php 
                }
                ?>

		</td>

		<td class="text-right muted nowrap">
			<small title="<?php 
                echo __('Replies');
                ?>
"><?php 
                echo Num::format($topic->post_count - 1, 0);
                ?>
 <i class="fa fa-comment"></i></small>
		</td>

		<td>
			<?php 
                echo HTML::avatar($last_poster ? $last_poster['avatar'] : null, $last_poster ? $last_poster['username'] : null, 'small');
                ?>
			<?php 
                echo $last_poster ? HTML::user($last_poster) : HTML::chars($topic->last_poster);
                ?>
		</td>

		<td>
			<small class="muted pull-right nowrap"><?php 
                echo HTML::time(Date::short_span($topic->last_posted, true, true), $topic->last_posted);
                ?>
</small>
		</td>

	</tr>

	<?php 
            }
            ?>

	</tbody>
</table>

<?php 
        } else {
            // Empty area
            echo new View_Alert(__('Here be nothing yet.'), null, View_Alert::INFO);
        }
        return ob_get_clean();
    }
Esempio n. 28
0
File: post.php Progetto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        $bbcode = BB::factory();
        ob_start();
        if ($this->my) {
            $panel_class = 'panel-success';
        } elseif ($this->owner) {
            $panel_class = 'panel-info';
        } else {
            $panel_class = 'panel-default';
        }
        ?>

<div class="pull-left">

	<?php 
        if ($this->author) {
            ?>
		<?php 
            echo HTML::avatar($this->author->avatar_url, $this->author->username);
            ?>

		<p>
			<small><?php 
            echo __('Posts: :posts', array(':posts' => '<var>' . Num::format($this->author->post_count, 0) . '</var>'));
            ?>
</small>
		</p>
	<?php 
        } else {
            ?>
		<?php 
            echo HTML::avatar(false);
            ?>

	<?php 
        }
        ?>

</div>

<div class="media-body panel <?php 
        echo $panel_class;
        ?>
">
	<header class="panel-heading"<?php 
        echo $this->forum_post->id == $this->forum_topic->last_post_id ? ' id="last"' : '';
        ?>
>
		<small class="pull-right">
			<?php 
        echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic))) . '#post-' . $this->forum_post->id, '#' . $this->nth, array('title' => __('Permalink')));
        ?>

			&bull;

			<?php 
        if (Permission::has($this->forum_post, Model_Forum_Post::PERMISSION_UPDATE)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'edit')), __('Edit'), array('class' => 'post-edit'));
        }
        ?>

			<?php 
        if (Permission::has($this->forum_post, Model_Forum_Post::PERMISSION_DELETE)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'delete')) . '?token=' . Security::csrf(), __('Delete'), array('class' => 'post-delete'));
        }
        ?>

			<?php 
        if (Permission::has($this->forum_topic, Model_Forum_Topic::PERMISSION_POST)) {
            echo HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('id' => Route::model_id($this->forum_post), 'topic_id' => Route::model_id($this->forum_topic), 'action' => 'quote')), __('Reply'), array('class' => 'post-quote'));
        }
        ?>

			&bull;

			<?php 
        echo HTML::time(Date::short_span($this->forum_post->created, true, true), $this->forum_post->created);
        ?>

			<?php 
        if ($this->forum_post->modify_count > 0) {
            ?>
			&bull;
			<span title="<?php 
            echo __($this->forum_post->modify_count == 1 ? ':edits edit, :ago' : ':edits edits, last :ago', array(':edits' => $this->forum_post->modify_count, ':ago' => Date::fuzzy_span($this->forum_post->modified)));
            ?>
"><?php 
            echo __('Edited');
            ?>
</span>
			<?php 
        }
        ?>

		</small>

		<?php 
        if ($this->author) {
            echo HTML::user($this->author->light_array());
            if ($this->author->title) {
                echo ' <small>' . HTML::chars($this->author->title) . '</small>';
            }
        } else {
            echo $this->forum_post->author_name;
            echo ' <small>' . __('Guest') . '</small>';
        }
        ?>
	</header>

	<div class="panel-body">

		<?php 
        if ($this->forum_post->parent_id) {
            echo '<p class="text-muted">' . __('Replying to :parent', array(':parent' => HTML::anchor(Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => Route::model_id($this->forum_topic), 'id' => $this->forum_post->parent_id)) . '#post-' . $this->forum_post->parent_id, HTML::chars($this->forum_post->parent()->topic()->name)))) . ':</p>';
        }
        ?>

		<?php 
        echo $bbcode->render($this->forum_post->post);
        ?>

		<?php 
        if ($this->forum_post->attachment) {
            $attachment = 'images/liitteet/' . $this->forum_post->attachment;
            if (file_exists($attachment)) {
                echo HTML::image($attachment);
            }
        }
        ?>

	</div>

	<?php 
        if ($this->author && $this->author->signature) {
            ?>
	<footer class="panel-body">
		<?php 
            echo $this->author && $this->author->signature ? $bbcode->render("\n--\n" . $this->author->signature, true) : '';
            ?>
	</footer>
	<?php 
        }
        ?>
</div>

<?php 
        return ob_get_clean();
    }