public function get_modal() { ?> <!-- Modal Dialog--> <div class="modal fade" id="<?php echo $this->id; ?> " tabindex="-1" role="dialog" aria-labelledby="add-title-label"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="add-title-label"> <?php echo $this->title; ?> </h4> </div> <div class="modal-body"> <div class="filter-box bg-info form-inline <?php echo $this->has_filter ? '' : 'hidden'; ?> "> <?php do_action('modal_post_selection_filter'); ?> <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-filter"></i></button> </div> <div class="plan-items"> <table class="post-type-table table table-hover table-condensed table-striped" data-chk-id="chk_item_select"> <caption> <div class="river-waiting"> <span class="spinner"></span> </div> <em><?php _etfc('Loading...'); ?> </em> </caption> <thead> <?php $this->get_column_headers($this->columns, $this->sort_by); ?> </thead> <tbody> <?php $rows = apply_filters('get_modal_post_selection_rows', $this->current_page); if (!isset($this->columns) || !is_array($this->columns) || count($this->columns) < 1) { throw new Exception('missing column definition'); } if (!isset($rows) || !is_array($rows) || count($rows) == 0) { ?> <tr> <td colspan="<?php echo $this->get_column_count(); ?> " class="message no-items"><?php _e('No items', 'forest-manager'); ?> </td> </tr> <?php } else { foreach ($rows as $row) { echo '<tr>'; echo '<td><input type="radio" name="chk_item_select" value="' . $row[$this->row_id] . '"/></td>'; foreach ($this->columns as $column_id => $column_title) { echo '<td>' . $row[$column_id] . '</td>'; } echo '</tr>'; } } ?> </tbody> <tfoot> <tr> <td colspan="<?php echo count($this->columns); ?> "> <div class="pagination-container"> <?php $this->get_bootstrap_pagination(); ?> </div> </td> </tr> </tfoot> </table> </div> </div><!--modal body end--> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal"><?php _etfm('Close'); ?> </button> <button type="button" class="btn btn-primary"><?php _etfm('Select'); ?> </button> </div> </div> </div> </div> <?php $labels = array('NoItemsFound' => _tfc('No items found')); ?> <script type="application/javascript"> jQuery(document).ready(function(){ try { var modalSelection = new ForestModalPostSelection( '<?php echo $this->id; ?> ', <?php echo ForestUtils::get_instance()->get_js_object($this->post_types); ?> , <?php echo ForestUtils::get_instance()->get_js_object($this->sort_by); ?> , <?php echo $this->has_filter ? 'true' : 'false'; ?> , <?php echo ForestUtils::get_instance()->get_js_object($this->columns); ?> , <?php echo ForestUtils::get_instance()->get_js_object($this->ajax); ?> , <?php echo ForestUtils::get_instance()->get_js_object($labels); ?> ); modalSelection.init(); } catch(e){ console.log(e.message); } }); </script> <?php }
public function tree_shapes_select($id, $value = '', $attr = '') { $html_attributes = ''; if (is_array($attr)) { foreach ($attr as $item => $item_value) { $html_attributes .= ' ' . $item . '="' . $item_value . '"'; } } elseif (isset($attr) && !empty($attr)) { $html_attributes = $attr; } ?> <select<?php echo !empty($id) ? ' id="' . $id . '"' . $html_attributes : $html_attributes; ?> value="<?php echo $value; ?> "> <option id="columnar"><?php _etfc('Columnar'); ?> </option> <option id="fountain"><?php _etfc('Fountain'); ?> </option> <option id="oval"><?php _etfc('Oval'); ?> </option> <option id="open"><?php _etfc('Open'); ?> </option> <option id="pyramidal"><?php _etfc('Pyramidal'); ?> </option> <option id="spreading"><?php _etfc('Spreading'); ?> </option> <option id="weeping"><?php _etfc('Weeping'); ?> </option> <option id="umbrella"><?php _etfc('Umbrella'); ?> </option> </select> <?php }