function form($tag) { $category_color = '#FFFFFF'; $category_image = ''; if ($tag != EM_TAXONOMY_CATEGORY) { //not an add new tag form $EM_Category = new EM_Category($tag); $category_color = $EM_Category->get_color(); $category_image = $EM_Category->get_image_url(); $category_image_id = $EM_Category->get_image_id(); } ?> <tr class="form-field"> <th scope="row" valign="top"><label for="category-bgcolor">Calendar Color</label></th> <td> <input type="text" name="category_bgcolor" id="category-bgcolor" class="colorwell" value="<?php echo esc_attr($category_color); ?> " style="width:100px;"/><br /> <p class="description"><?php echo sprintf(__('Choose a color for your category. You can access this using the %s placeholder.', 'dbem'), '<code>#_CATEGORYCOLOR</code>'); ?> </p> <div id="picker" style="position:absolute; display:none; background:#DEDEDE"></div> </td> </tr> <tr class="form-field"> <th scope="row" valign="top"><label for="category-image">Image</label></th> <td> <?php if (!empty($category_image)) { ?> <p><img src="<?php echo $category_image; ?> " /></p> <?php } ?> <input type="text" name="category_image" id="category-image" value="<?php echo esc_attr($category_image); ?> " style="width:300px;" /> <input type="hidden" name="category_image_id" id="category-image-id" value="<?php echo esc_attr($category_image); ?> " /> <input id="upload_image_button" type="button" value="<?php _e('Choose/Upload Image', 'dbem'); ?> " class="button-secondary" style="width:auto;" /><br /> <p class="description"><?php echo sprintf(__('Choose an image for your category, which can be displayed using the %s placeholder.', 'dbem'), '<code>#_CATEGORYIMAGE</code>'); ?> </p> </td> </tr> <?php }