/**
  * Add the rtl stylesheets to the page.
  *
  * The rtl stylesheets should always be added separately so that they aren't combined with other stylesheets when
  * a non-rtl language is still being displayed.
  *
  * @param Gdn_Controller $Sender
  */
 public function Base_Render_Before(&$Sender)
 {
     $currentLocale = substr(Gdn::Locale()->Current(), 0, 2);
     if (in_array($currentLocale, $this->rtlLocales)) {
         if (InSection('Dashboard')) {
             $Sender->AddCssFile('admin_rtl.css', 'plugins/RightToLeft');
         } else {
             $Sender->AddCssFile('style_rtl.css', 'plugins/RightToLeft');
         }
         $Sender->CssClass .= ' rtl';
     }
 }
 public function Base_Render_Before($Sender)
 {
     if (InSection('Dashboard')) {
         return;
     }
     //GET THE CONFIGURATION VALUES
     $TOS = t('TermsOfService');
     $TOSUrl = Gdn::Config('Garden.TermsOfService', '#');
     // ADD CONTENT TO ASSET
     $Content = '<div><center><a id="TermsOfService" class="Popup" target="terms" href="' . $TOSUrl . '">' . $TOS . '</a></center></div>';
     $Sender->addAsset('Foot', $Content, 'TermsOfServiceLink');
 }
 public function Base_BeforeRenderAsset_Handler($Sender)
 {
     $AssetName = GetValueR('EventArguments.AssetName', $Sender);
     if (InSection("DiscussionList")) {
         if (C('Plugin.PrestigeSlider.RenderCondition') == 'all' or C('Plugin.PrestigeSlider.RenderCondition') == 'DiscussionList') {
             if ($AssetName == "Content") {
                 echo $Sender->FetchView($this->GetView('slider.php'));
             }
         }
     }
     if (InSection("CategoryList")) {
         if (C('Plugin.PrestigeSlider.RenderCondition') == 'all' or C('Plugin.PrestigeSlider.RenderCondition') == 'CategoryList') {
             if ($AssetName == "Content") {
                 echo $Sender->FetchView($this->GetView('slider.php'));
             }
         }
     }
 }
 /**
  *
  *
  * @throws Exception
  */
 public function render()
 {
     $section_found = false;
     // The module contains different links depending on its section.
     foreach ($this->customSections as $section) {
         if (InSection($section)) {
             $this->fireEvent($section);
             $section_found = true;
             break;
         }
     }
     // If a section wasn't found then add the default nav.
     if (!$section_found) {
         $this->fireEvent('default');
     }
     // Fire an event for everything.
     $this->fireEvent('all');
     parent::render();
 }
          <?php 
}
?>
        </div>
      </div>
    </nav>

    <section class="container">
      <div class="row">
        <main class="page-content" role="main">
          <?php 
echo smarty_function_breadcrumbs(array(), $this);
?>

          <?php 
if (InSection(array('CategoryList', 'CategoryDiscussionList', 'DiscussionList'))) {
    ?>
            <div class="well search-form"><?php 
    echo smarty_function_searchbox(array(), $this);
    ?>
</div>
          <?php 
}
?>
          <?php 
echo smarty_function_asset(array('name' => 'Content'), $this);
?>

        </main>

        <aside class="page-sidebar" role="complementary">
Example #6
0
 /** Whether or not this pocket should be processed based on its state.
  *
  *  @Param array $Data Data specific to the request.
  *  @return bool
  */
 public function CanRender($Data)
 {
     if (!$this->ShowInDashboard && InSection('Dashboard')) {
         return FALSE;
     }
     $IsMobile = IsMobile();
     if ($this->MobileOnly && !$IsMobile || $this->MobileNever && $IsMobile) {
         return FALSE;
     }
     if ($this->IsAd() && Gdn::Session()->CheckPermission('Garden.NoAds.Allow')) {
         return FALSE;
     }
     if ($this->EmbeddedNever && strcasecmp(Gdn::Controller()->RequestMethod, 'embed') == 0) {
         return FALSE;
     }
     // Check to see if the pocket is enabled.
     switch ($this->Disabled) {
         case Pocket::DISABLED:
             return FALSE;
         case Pocket::TESTING:
             if (!Gdn::Session()->CheckPermission('Plugins.Pockets.Manage')) {
                 return FALSE;
             }
             break;
     }
     // Check to see if the page matches.
     if ($this->Page && strcasecmp($this->Page, GetValue('PageName', $Data)) != 0) {
         return FALSE;
     }
     // Check to see if this is repeating.
     $Count = GetValue('Count', $Data);
     if ($Count) {
         switch ($this->RepeatType) {
             case Pocket::REPEAT_AFTER:
                 if (strcasecmp($Count, Pocket::REPEAT_AFTER) != 0) {
                     return FALSE;
                 }
                 break;
             case Pocket::REPEAT_BEFORE:
                 if (strcasecmp($Count, Pocket::REPEAT_BEFORE) != 0) {
                     return FALSE;
                 }
                 break;
             case Pocket::REPEAT_ONCE:
                 if ($Count != 1) {
                     return FALSE;
                 }
                 break;
             case Pocket::REPEAT_EVERY:
                 $Frequency = (array) $this->RepeatFrequency;
                 $Every = GetValue(0, $Frequency, 1);
                 if ($Every < 1) {
                     $Every = 1;
                 }
                 $Begin = GetValue(1, $Frequency, 1);
                 if ($Count % $Every != $Begin % $Every) {
                     return FALSE;
                 }
                 break;
             case Pocket::REPEAT_INDEX:
                 if (!in_array($Count, (array) $this->RepeatFrequency)) {
                     return FALSE;
                 }
                 break;
         }
     }
     // If we've passed all of the tests then the pocket can be processed.
     return TRUE;
 }