Пример #1
0
switch ($action) {
    case 'new_type':
    case 'edit_type':
        $heading[] = array('text' => '<strong>' . ($action == 'edit_type' ? TEXT_HEADING_EDIT_TYPE : TEXT_HEADING_NEW_TYPE) . '</strong>');
        $contents = array('form' => tep_draw_form('types', FILENAME_PARAMETERS, 'action=' . ($action == 'edit_type' ? 'update_type' : 'insert_type') . (tep_not_null($tInfo->products_types_id) ? '&tID=' . $tInfo->products_types_id : ''), 'post') . tep_draw_hidden_field('types_id', $tInfo->products_types_id));
        $contents[] = array('text' => $action == 'edit_type' ? TEXT_EDIT_TYPE_INTRO : TEXT_NEW_TYPE_INTRO);
        $products_types_inputs_string = '';
        $languages = tep_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
            $products_types_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $languages[$i]['image'], $languages[$i]['name'], '', '', 'style="float: left; margin: 4px 4px 0px 0px;"') . tep_draw_input_field('products_types_name[' . $languages[$i]['id'] . ']', tep_get_products_types_info($tInfo->products_types_id, $languages[$i]['id']), 'size="35"');
        }
        $contents[] = array('text' => '<br>' . TEXT_TYPES_NAME . $products_types_inputs_string);
        $products_types_inputs_string = '';
        $languages = tep_get_languages();
        for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
            $products_types_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $languages[$i]['image'], $languages[$i]['name'], '', '', 'style="float: left; margin: 4px 4px 0px 0px;"') . tep_draw_textarea_field('products_types_description[' . $languages[$i]['id'] . ']', 'soft', '35', '3', tep_get_products_types_info($tInfo->products_types_id, $languages[$i]['id'], 'products_types_description'));
        }
        $contents[] = array('text' => '<br>' . TEXT_TYPES_DESCRIPTION . $products_types_inputs_string);
        $contents[] = array('text' => '<br>' . TEXT_TYPES_PATH . '<br>' . tep_draw_input_field('products_types_path', $tInfo->products_types_path, 'size="8"'));
        $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('products_types_letter_search', '1', $tInfo->products_types_letter_search == '1') . TEXT_TYPES_LETTER_SEARCH);
        $contents[] = array('text' => '<br>' . TEXT_EDIT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', $tInfo->sort_order, 'size="2"'));
        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_PARAMETERS, tep_not_null($tInfo->products_types_id) ? 'tID=' . $tInfo->products_types_id : '') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
    case 'delete_type':
        $heading[] = array('text' => '<strong>' . TEXT_HEADING_DELETE_TYPE . '</strong>');
        $contents = array('form' => tep_draw_form('types', FILENAME_PARAMETERS, 'tID=' . $tInfo->products_types_id . '&action=delete_type_confirm') . tep_draw_hidden_field('types_id', $tInfo->products_types_id));
        $contents[] = array('text' => TEXT_DELETE_TYPE_INTRO);
        $contents[] = array('text' => '<br><strong>' . $tInfo->products_types_name . '</strong>');
        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_PARAMETERS, 'tID=' . $tInfo->products_types_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
    default:
Пример #2
0
    ?>
</td>
		  </tr>
<?php 
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        ?>
          <tr valign="top">
            <td class="main" width="250"><?php 
        if ($i == 0) {
            echo TEXT_TYPE_DESCRIPTION;
        }
        ?>
</td>
            <td class="main"><?php 
        echo tep_image(DIR_WS_CATALOG_IMAGES . $languages[$i]['image'], $languages[$i]['name'], '', '', 'style="float: left; margin: 4px 4px 0px 0px;"');
        $field_value = isset($products_types_description[$languages[$i]['id']]) ? $products_types_description[$languages[$i]['id']] : tep_get_products_types_info($tInfo->products_types_id, $languages[$i]['id'], 'products_types_description');
        $field_value = str_replace('\\\\"', '"', $field_value);
        $field_value = str_replace('\\"', '"', $field_value);
        $field_value = str_replace("\\\\'", "\\'", $field_value);
        $field_value = str_replace('="/', '="' . HTTP_SERVER . '/', $field_value);
        $editor = new editor('products_types_description[' . $languages[$i]['id'] . ']');
        $editor->Value = $field_value;
        $editor->Height = '280';
        $editor->Create();
        ?>
</td>
          </tr>
<?php 
    }
    ?>
          <tr>