Ejemplo n.º 1
0
 /**
  * @param NavModule $sender
  */
 public function siteNavModule_init_handler($sender)
 {
     // Grab the default route so that we don't add a link to it twice.
     $home = trim(val('Destination', Gdn::router()->getRoute('DefaultController')), '/');
     // Add the site discussion links.
     $sender->addLinkIf($home !== 'categories', t('All Categories', 'Categories'), '/categories', 'main.categories', '', 1, array('icon' => 'th-list'));
     $sender->addLinkIf($home !== 'discussions', t('Recent Discussions'), '/discussions', 'main.discussions', '', 1, array('icon' => 'discussion'));
     $sender->addGroup(t('Favorites'), 'favorites', '', 3);
     if (Gdn::session()->isValid()) {
         $sender->addLink(t('My Bookmarks'), '/discussions/bookmarked', 'favorites.bookmarks', '', array(), array('icon' => 'star', 'badge' => Gdn::session()->User->CountBookmarks));
         $sender->addLink(t('My Discussions'), '/discussions/mine', 'favorites.discussions', '', array(), array('icon' => 'discussion', 'badge' => Gdn::session()->User->CountDiscussions));
         $sender->addLink(t('Drafts'), '/drafts', 'favorites.drafts', '', array(), array('icon' => 'compose', 'badge' => Gdn::session()->User->CountDrafts));
     }
     $user = Gdn::controller()->data('Profile');
     if (!$user) {
         return;
     }
     $sender->addGroupToSection('Profile', t('Posts'), 'posts');
     $sender->addLinkToSection('Profile', t('Discussions'), userUrl($user, '', 'discussions'), 'posts.discussions', '', array(), array('icon' => 'discussion', 'badge' => val('CountDiscussions', $user)));
     $sender->addLinkToSection('Profile', t('Comments'), userUrl($user, '', 'comments'), 'posts.comments', '', array(), array('icon' => 'comment', 'badge' => val('CountComments', $user)));
 }
Ejemplo n.º 2
0
 /**
  * @param array $section
  */
 public function addSectionItems($section)
 {
     if ($groups = val(self::GROUPS_INDEX, $section)) {
         foreach ($groups as $group) {
             parent::addGroup($group['text'], $group['key'], $group['cssClass'], $group['sort'], $group['modifiers']);
         }
     }
     if ($links = val(self::LINKS_INDEX, $section)) {
         foreach ($links as $link) {
             parent::addLink($link['text'], $link['url'], $link['key'], $link['cssClass'], $link['sort'], $link['modifiers'], $link['disabled']);
         }
     }
 }
Ejemplo n.º 3
0
<div class="row form-group">
    <div class="label-wrap-wide">
        <div class="label"><?php 
echo t('Embed My Forum');
?>
</div>
        <div class="label-description"><?php 
echo t('If you want to embed your forum or use Vanilla\'s comments in your blog then you need to enable embedding. If you aren\'t using embedding then we recommend leaving this setting off.');
?>
</div>
    </div>
    <div class="input-wrap-right">
    <span id="plaintext-toggle">
        <?php 
if (c('Garden.Embed.Allow', false)) {
    echo wrap(anchor('<div class="toggle-well"></div><div class="toggle-slider"></div>', 'embed/forum/disable/' . Gdn::session()->TransientKey()), 'span', array('class' => "toggle-wrap toggle-wrap-on"));
} else {
    echo wrap(anchor('<div class="toggle-well"></div><div class="toggle-slider"></div>', 'embed/forum/enable/' . Gdn::session()->TransientKey()), 'span', array('class' => "toggle-wrap toggle-wrap-off"));
}
?>
    </span>
    </div>
</div>
<?php 
$nav = new NavModule();
$nav->addLink(t('Vanilla Plugin for WordPress'), 'embed/wordpress', 'embed.wordpress', '', [], ['icon' => dashboardSymbol('plugin'), 'description' => t('Use Vanilla\'s Wordpress plugin if you want to embed in WordPress site.')]);
$nav->addLink(t('Universal Forum Embed Code'), 'embed/universal', 'embed.universal', '', [], ['icon' => dashboardSymbol('code'), 'description' => t('Use the forum embed code to embed the entire forum in a non-WordPress site.')]);
$nav->addLink(t('Universal Comment Embed Code'), 'embed/comments', 'embed.comments', '', [], ['icon' => dashboardSymbol('code-bubble'), 'description' => t('Use the comment embed code to embed Vanilla comments into a non-WordPress site.')]);
$nav->addLink(t('Embed Settings'), 'embed/settings', 'embed.settings', '', [], ['icon' => dashboardSymbol('settings'), 'description' => t('Use the comment embed code to embed Vanilla comments into a non-WordPress site.')]);
$nav->setView('nav-adventure');
echo $nav;