예제 #1
0
        </thead>
        <tbody>
            <?php 
    $c = 0;
    $products = module_faq::get_faq_products_rel();
    foreach ($faqs as $faq_id => $data) {
        $faq = module_faq::get_faq($faq_id);
        ?>
            <tr class="<?php 
        echo $c++ % 2 ? "odd" : "even";
        ?>
">
                <td nowrap="">
                    <?php 
        if (module_faq::can_i('edit', 'FAQ')) {
            echo module_faq::link_open($faq_id, true);
        } else {
            ?>
 <a href="<?php 
            echo str_replace('display_mode=iframe', '', module_faq::link_open_public($faq_id));
            ?>
" target="_blank"><?php 
            echo htmlspecialchars($faq['question']);
            ?>
</a> <?php 
        }
        ?>
                </td>
                <td>
                    <?php 
        foreach ($faq['faq_product_ids'] as $faq_product_id) {
예제 #2
0

	</form>

	<?php 
} else {
    $header = array('title' => _l('FAQs'), 'type' => 'h2', 'main' => true, 'button' => array());
    if (module_faq::can_i('create', 'FAQ')) {
        $header['button'] = array('url' => module_faq::link_open('new'), 'title' => _l('Add New FAQ'), 'type' => 'add');
    }
    print_heading($header);
    $products = module_faq::get_faq_products_rel();
    /** START TABLE LAYOUT **/
    $table_manager = module_theme::new_table_manager();
    $columns = array();
    $columns['question'] = array('title' => _l('Question'), 'callback' => function ($faq) {
        echo module_faq::link_open($faq['faq_id'], true);
    }, 'cell_class' => 'row_action');
    $columns['linked_products'] = array('title' => _l('Linked FAQ Products'), 'callback' => function ($faq) {
        $faq = module_faq::get_faq($faq['faq_id']);
        foreach ($faq['faq_product_ids'] as $faq_product_id) {
            echo module_faq::link_open_faq_product($faq_product_id, true) . " ";
        }
    });
    $table_manager->set_id('faq_list');
    $table_manager->set_columns($columns);
    $table_manager->set_rows($faqs);
    $table_manager->pagination = true;
    $table_manager->print_table();
    /** END TABLE LAYOUT **/
}