echo isset($search['faq_product_id']) ? (int) $search['faq_product_id'] : ''; ?> "><?php echo htmlspecialchars($faq['question']); ?> </a> </td> <?php if ($show_product) { ?> <td> <?php $items = array(); foreach ($faq['faq_product_ids'] as $faq_product_id) { if (module_faq::can_i('edit', 'FAQ')) { $items[] = module_faq::link_open_faq_product($faq_product_id, true); } else { $items[] = $products[$faq_product_id]; } } echo implode(', ', $items); ?> </td> <?php } ?> </tr> <?php } ?> </tbody>
</form> <?php } else { $header = array('title' => _l('FAQ Product'), 'type' => 'h2', 'main' => true, 'button' => array()); if (module_faq::can_i('create', 'FAQ')) { $header['button'] = array('url' => module_faq::link_open_faq_product('new'), 'title' => _l('Add New Product'), 'type' => 'add'); } print_heading($header); /** START TABLE LAYOUT **/ $table_manager = module_theme::new_table_manager(); $columns = array(); $columns['product_name'] = array('title' => _l('Product Name'), 'callback' => function ($data) { echo module_faq::link_open_faq_product($data['faq_product_id'], true); }, 'cell_class' => 'row_action'); $columns['department'] = array('title' => _l('Default Type/Department'), 'callback' => function ($data) use($types) { echo isset($types[$data['default_type_id']]) ? htmlspecialchars($types[$data['default_type_id']]['name']) : ''; }); if (class_exists('module_envato', false)) { $columns['envato'] = array('title' => _l('Envato Item'), 'callback' => function ($data) use($all_items_rel) { $linked_items = explode('|', $data['envato_item_ids']); foreach ($linked_items as $id => $linked_item) { if (!strlen(trim($linked_item))) { unset($linked_items[$id]); } if (isset($all_items_rel[$linked_item])) { $linked_items[$id] = $all_items_rel[$linked_item]; } }
} 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) { echo module_faq::link_open_faq_product($faq_product_id, true) . " "; } ?> </td> <?php //if(module_faq::can_i('edit','FAQ')){ ?> <td> <a href="<?php echo str_replace('display_mode=iframe', '', module_faq::link_open_public($faq_id, false)); ?> " target="_blank" onclick="window.parent.jQuery('#new_ticket_message').val(window.parent.jQuery('#new_ticket_message').val() + $(this).attr('href')); window.parent.jQuery('.ui-dialog-content').dialog('close'); return false;"><?php _e('Insert Link'); ?> </a> </td>