コード例 #1
0
        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">&times;</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 
        }
コード例 #2
0
        /**
         * Output the HTML for the Save Plan metabox
         * @param $post
         */
        public function plan_save_meta_box($post)
        {
            $qry = new PlanDbQuery();
            $plan = $qry->get_plan();
            ?>

				<div class="publish">
				<div id="minor-publishing">
					<div class="form-inline">
						<div class="form-group">
							<label for="plan-lock" data-toggle="tooltip" data-placement="left" title="<?php 
            _etfm('Lock the plan so only the owner can make changes');
            ?>
" class="changecolor">
								<?php 
            ForestHelperSingleton::get_instance()->post_lock_icon($post->post_status);
            ?>
								<?php 
            _etfm('Locked');
            ?>
:
							</label>

							<?php 
            ForestHelperSingleton::get_instance()->toogle_button('btn-success', 'btn-danger', $post->post_status == 'publish' ? false : true, 'post-lock-btn');
            ForestHelperSingleton::get_instance()->hidden_field('post_status', $plan->post_status, array('data-id' => 'post_status'));
            ?>

						</div>
					</div>

					<div class="format-setting-label"></div>

					<label for="visibility" data-toggle="tooltip" data-placement="left" title="<?php 
            _etfm('Change visibility level');
            ?>
" class="changecolor"><i class="fa fa-eye text-danger"></i><?php 
            _etfm('Visibility:');
            ?>
</label>
					<div class="form-inline">
						<div class="visibility-radio">
							<?php 
            ForestHelperSingleton::get_instance()->hidden_field('post_visibility', 'private', array('data-meta-id' => 'post_visibility'));
            ?>

							<label class="radio-inline">
								<input type="radio" name="lock-option" value="public"><?php 
            _etfm('Public');
            ?>
							</label>
							<label class="radio-inline">
								<input type="radio" name="lock-option" value="contributors"><?php 
            _etfm('Contributors');
            ?>
							</label>
							<label class="radio-inline">
								<input type="radio" name="lock-option" value="editors" checked="checked"><?php 
            _etfm('Editors');
            ?>
							</label>
						</div>
					</div>

					<div class="format-setting-label"></div>

				</div>
				<div id="major-publishing-actions">
					<div id="delete-action">
						<a class="submitdelete deletion" href="<?php 
            echo get_delete_post_link($post->ID);
            ?>
">Move to Trash</a>
					</div>
					<div id="publishing-action">
						<span class="spinner"></span>
						<button data-action="save" class="btn btn-primary btn-sm" type="button"><?php 
            _etfm('Save');
            ?>
</button>
					</div>
					<div class="clear"></div>
				</div>
			</div>
			<?php 
        }
コード例 #3
0
					</div>
				</div>
			</div>
		</div>
		<ul class="pager wizard">
			<li class="previous first"><a href="#"><?php 
_etfm('First');
?>
</a></li>
			<li class="previous"><a href="#"><?php 
_etfm('Previous');
?>
</a></li>
			<li class="next last"><a href="#"><?php 
_etfm('Last');
?>
</a></li>
			<li class="next"><a href="#"><?php 
_etfm('Next');
?>
</a></li>
			<li class="next finish" style="display:none;">
				<a href="#"><?php 
_etfm('Finish');
?>
</a>
				<span class="spinner"></span>
			</li>
		</ul>
	</div>
</div>
コード例 #4
0
        public function get_modal_post_selection_filter()
        {
            ?>
				<span><?php 
            _e('Filter', 'forest-manager');
            ?>
</span>
				<div class="form-group">
					<label for="plan-title-search" class="sr-only">Title</label>
					<input type="text" class="search-term form-control input-sm" placeholder="<?php 
            _etfm('Search for a tree name');
            ?>
" data-filter="post_title"/>
				</div>

			<?php 
        }