function theme_product_add_list in Commerce Core 7
Displays the list of available product types for product creation.
1 theme call to theme_product_add_list()
- commerce_product_ui_add_page in modules/
product/ includes/ commerce_product_ui.products.inc - Menu callback: display a list of product types that the user can create.
File
- modules/
product/ includes/ commerce_product_ui.products.inc, line 31 - Page callbacks and form builder functions for administering products.
Code
function theme_product_add_list($variables) {
$content = $variables['content'];
$output = '';
if ($content) {
$output = '<dl class="commerce-product-type-list">';
foreach ($content as $item) {
$output .= '<dt>' . l($item['title'], $item['href'], $item['localized_options']) . '</dt>';
$output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';
}
$output .= '</dl>';
}
else {
if (user_access('administer product types')) {
$output = '<p>' . t('You have not created any product types yet. Go to the <a href="@create-product-type">product type creation page</a> to add a new product type.', array(
'@create-product-type' => url('admin/commerce/products/types/add'),
)) . '</p>';
}
else {
$output = '<p>' . t('No product types have been created yet for you to use.') . '</p>';
}
}
return $output;
}