<?php /* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } if (!canEdit('system')) { return; } $field_id = (int) w2PgetParam($_POST, 'field_id', 0); $list_value = strip_tags(w2PgetParam($_POST, 'field_value', '')); $list_option_id = (int) w2PgetParam($_POST, 'list_option_id', 0); $delete = (int) w2PgetParam($_POST, 'del', 0); $option_list = new w2p_Core_CustomOptionList($field_id); $option_list->options = array($list_value); $option_list->list_option_id = $list_option_id; //TODO: we should do soething with this result $result = $delete ? $option_list->delete() : $option_list->store(); die;
<input type="text" class="text" name="field_extratags" size="80" value="<?php echo $field_extratags; ?> " /> </td> </tr> <tr id="datarow"> <td><?php echo $AppUI->_('List of Options'); ?> </td> <td> <?php if ($field_htmltype == 'select') { echo '<ul id="optionlist">'; $select_options = new w2p_Core_CustomOptionList($field_id); $select_options->load(); $select_items = $select_options->getOptions(); foreach ($select_items as $id => $item) { echo '<li id="listitem_' . $id . '">'; echo '<a href="javascript:deleteItem(' . $id . ')">'; echo '<img src="' . w2PfindImage('remove.png') . '" /></a> '; echo $item . '</li>'; } echo '<li><input type="text" name="select_newitem" id="select_newitem" class="text" /> <input type="button" value="' . $AppUI->_('Add') . '" onclick="javascript:addItem()" class="text" /></li>'; echo '</ul>'; } ?> </td> </tr>