Skip to content
Snippets Groups Projects
index.php 3.27 KiB
Newer Older
  • Learn to ignore specific revisions
  • Jared Hancock's avatar
    Jared Hancock committed
    <?php
    /*********************************************************************
        index.php
    
        Helpdesk landing page. Please customize it to fit your needs.
    
        Peter Rotich <peter@osticket.com>
    
        Copyright (c)  2006-2013 osTicket
    
    Jared Hancock's avatar
    Jared Hancock committed
        http://www.osticket.com
    
        Released under the GNU General Public License WITHOUT ANY WARRANTY.
        See LICENSE.TXT for details.
    
        vim: expandtab sw=4 ts=4 sts=4:
    **********************************************************************/
    
    require('client.inc.php');
    
    
    require_once INCLUDE_DIR . 'class.page.php';
    
    
    $section = 'home';
    require(CLIENTINC_DIR.'header.inc.php');
    ?>
    <div id="landing_page">
    
        <div class="sidebar pull-right">
            <div class="front-page-button flush-right">
    <p>
                <a href="open.php" style="display:block" class="blue button"><?php
                    echo __('Open a New Ticket');?></a>
    </p>
            </div>
            <div class="content">
    <?php
        $faqs = FAQ::getFeatured()->select_related('category')->limit(5);
        if ($faqs->all()) { ?>
                <section><div class="header"><?php echo __('Featured Questions'); ?></div>
    <?php   foreach ($faqs as $F) { ?>
                <div><a href="<?php echo ROOT_PATH; ?>/kb/faq.php?id=<?php
                    echo urlencode($F->getId());
                    ?>"><?php echo $F->getLocalQuestion(); ?></a></div>
    <?php   } ?>
                </section>
    <?php
        }
        $resources = Page::getActivePages()->filter(array('type'=>'other'));
        if ($resources->all()) { ?>
                <section><div class="header"><?php echo __('Other Resources'); ?></div>
    <?php   foreach ($resources as $page) { ?>
                <a href="<?php echo ROOT_PATH; ?>pages/<?php echo $page->getNameAsSlug();
                ?>"><?php echo $page->getLocalName(); ?></a>
    <?php   } ?>
                </section>
    <?php
        } ?>
            </div>
        </div>
    <div class="welcome">
    <?php
    if ($cfg && $cfg->isKnowledgebaseEnabled()) { ?>
    <div class="search-form">
        <form method="get" action="kb/faq.php">
        <input type="hidden" name="a" value="search"/>
        <input type="text" name="q" class="search" placeholder="Search our knowledge base"/>
        <button type="submit" class="green button">Search</button>
        </form>
    </div>
    <?php
    }
    
        if($cfg && ($page = $cfg->getLandingPage()))
    
            echo $page->getBodyWithImages();
    
            echo  '<h1>'.__('Welcome to the Support Center').'</h1>';
    
    </div>
    <div class="clear"></div>
    
    if($cfg && $cfg->isKnowledgebaseEnabled()){
    
        //FIXME: provide ability to feature or select random FAQs ??
    
    <br/><br/>
    <?php
    $cats = Category::getFeatured();
    if ($cats->all()) { ?>
    <h1>Featured Knowledge Base Articles</h1>
    <?php
    }
    
        foreach ($cats as $C) { ?>
        <div class="featured-category front-page">
            <i class="icon-folder-open icon-2x"></i>
            <div class="category-name">
                <?php echo $C->getName(); ?>
            </div>
    <?php foreach ($C->getTopArticles() as $F) { ?>
            <div class="article-headline">
                <div class="article-title"><a href="<?php echo ROOT_PATH;
                    ?>kb/faq.php?id=<?php echo $F->getId(); ?>"><?php
                    echo $F->getQuestion(); ?></a></div>
                <div class="article-teaser"><?php echo $F->getTeaser(); ?></div>
            </div>
    <?php } ?>
        </div>
    
    <?php require(CLIENTINC_DIR.'footer.inc.php'); ?>