Esempio n. 1
0
    function writeListItem($Row, $Depth = 1)
    {
        $Children = $Row['Children'];
        $WriteChildren = FALSE;
        if (!empty($Children)) {
            if ($Depth + 1 >= c('Vanilla.Categories.MaxDisplayDepth')) {
                $WriteChildren = 'list';
            } else {
                $WriteChildren = 'items';
            }
        }
        $H = 'h' . ($Depth + 1);
        ?>
        <li id="Category_<?php 
        echo $Row['CategoryID'];
        ?>
" class="<?php 
        echo CssClass($Row);
        ?>
">
            <div class="ItemContent Category">
                <?php 
        echo GetOptions($Row);
        echo '<' . $H . ' class="CategoryName TitleWrap">';
        echo CategoryPhoto($Row);
        echo anchor(htmlspecialchars($Row['Name']), $Row['Url'], 'Title');
        Gdn::controller()->EventArguments['Category'] = $Row;
        Gdn::controller()->fireEvent('AfterCategoryTitle');
        echo '</' . $H . '>';
        ?>

                <div class="CategoryDescription">
                    <?php 
        echo $Row['Description'];
        ?>
                </div>

                <?php 
        if ($WriteChildren === 'list') {
            ?>
                    <div class="ChildCategories">
                        <?php 
            echo wrap(t('Child Categories') . ': ', 'b');
            echo CategoryString($Children, $Depth + 1);
            ?>
                    </div>
                <?php 
        }
        ?>

                <div class="Meta">
            <span class="MItem RSS"><?php 
        echo anchor(' ', '/categories/' . rawurlencode($Row['UrlCode']) . '/feed.rss', 'SpRSS');
        ?>
</span>

            <span class="MItem MItem-Count DiscussionCount"><?php 
        printf(PluralTranslate($Row['CountAllDiscussions'], '%s discussion html', '%s discussions html', t('%s discussion'), t('%s discussions')), BigPlural($Row['CountAllDiscussions'], '%s discussion'));
        ?>
</span>

            <span class="MItem MItem-Count CommentCount"><?php 
        printf(PluralTranslate($Row['CountAllComments'], '%s comment html', '%s comments html', t('%s comment'), t('%s comments')), BigPlural($Row['CountAllComments'], '%s comment'));
        ?>
</span>

            <span class="MItem LastestPost LastDiscussionTitle"><?php 
        echo MostRecentString($Row);
        ?>
</span>
                </div>
            </div>
        </li>
        <?php 
        if ($WriteChildren === 'items') {
            foreach ($Children as $ChildRow) {
                WriteListItem($ChildRow, $Depth + 1);
            }
        }
    }
Esempio n. 2
0
    function WriteListItem($Row, $Depth = 1)
    {
        $Children = $Row['Children'];
        $WriteChildren = FALSE;
        if (!empty($Children)) {
            if ($Depth + 1 >= C('Vanilla.Categories.MaxDisplayDepth')) {
                $WriteChildren = 'list';
            } else {
                $WriteChildren = 'items';
            }
        }
        $H = 'h' . ($Depth + 1);
        ?>
   <li id="Category_<?php 
        echo $Row['CategoryID'];
        ?>
" class="<?php 
        echo CssClass($Row);
        ?>
">
      <div class="ItemContent Category">
         <?php 
        echo GetOptions($Row);
        ?>
         
         <?php 
        echo Wrap(Anchor($Row['Name'], $Row['Url'], 'Title'), $H, array('class' => 'CategoryName TitleWrap'));
        ?>
         
         <div class="CategoryDescription">
            <?php 
        echo $Row['Description'];
        ?>
         </div>
         
         <?php 
        if ($WriteChildren === 'list') {
            ?>
         <div class="ChildCategories">
            <?php 
            echo Wrap(T('Child Categories') . ': ', 'b');
            echo CategoryString($Children, $Depth + 1);
            ?>
         </div>
         <?php 
        }
        ?>
         
         <div class="Meta">
            <span class="MItem RSS"><?php 
        echo Anchor(' ', '/categories/' . rawurlencode($Row['UrlCode']) . '/feed.rss', 'SpRSS');
        ?>
</span>
            
            <span class="MItem MItem-Count DiscussionCount"><?php 
        printf(PluralTranslate($Row['CountDiscussions'], '%s discussion html', '%s discussions html', '%s discussion', '%s discussions'), BigPlural($Row['CountDiscussions'], '%s discussion'));
        ?>
</span>
            
            <span class="MItem MItem-Count CommentCount"><?php 
        printf(PluralTranslate($Row['CountComments'], '%s comment html', '%s comments html', '%s comment', '%s comments'), BigPlural($Row['CountComments'], '%s comment'));
        ?>
</span>
            
            <span class="MItem LastestPost LastDiscussionTitle"><?php 
        echo MostRecentString($Row);
        ?>
</span>
         </div>
      </div>
   </li>
   <?php 
        if ($WriteChildren === 'items') {
            foreach ($Children as $ChildRow) {
                WriteListItem($ChildRow, $Depth + 1);
            }
        }
    }