Пример #1
0
 public static function get_app_navigation($app_post_id)
 {
     return WpakNavigationItemsStorage::get_navigation_items($app_post_id);
 }
    public static function inner_navigation_box($post, $current_box)
    {
        $nav_items = WpakNavigationItemsStorage::get_navigation_items($post->ID);
        ?>
		<div id="navigation-wrapper">
			<p>Menu</p>
			<a href="#" class="add-new-h2" id="add-new-item"><?php 
        _e('Add Component to Menu', WpAppKit::i18n_domain);
        ?>
</a>

			<div id="navigation-feedback" style="display:none"></div>

			<div id="new-item-form" style="display:none">
				<h4><?php 
        _e('New Menu Item', WpAppKit::i18n_domain);
        ?>
</h4>
				<div id="components-available-for-navigation"><?php 
        self::echo_item_form($post->ID);
        ?>
</div>
			</div>

			<table class="wp-list-table widefat fixed" id="navigation-items-table" data-post-id="<?php 
        echo $post->ID;
        ?>
">
				<thead>
					<tr>
						<th><?php 
        _e('Menu Item', WpAppKit::i18n_domain);
        ?>
</th>
						<th><?php 
        _e('Icon Slug', WpAppKit::i18n_domain);
        ?>
</th>
					</tr>
				</thead>
				<tbody>
				<?php 
        if (!empty($nav_items)) {
            ?>
					<?php 
            $i = 0;
            ?>
					<?php 
            foreach ($nav_items as $nav_item_id => $nav_item) {
                ?>
						<?php 
                echo self::get_navigation_row($post->ID, $i++, $nav_item_id, $nav_item);
                ?>
					<?php 
            }
            ?>
				<?php 
        } else {
            ?>
					<tr class="no-component-yet"><td><?php 
            _e('No menu item yet!', WpAppKit::i18n_domain);
            ?>
</td></tr>
				<?php 
        }
        ?>
				</tbody>
			</table>

			<style>
				#navigation-wrapper { margin-top:1em }
				#navigation-items-table{ margin:5px 0 }
				#new-item-form{ margin-bottom:4em }
				.ui-sortable-placeholder{ height: 60px; border-bottom:1px solid #dfdfdf; }
				.ui-sortable-helper{ width:100%; background:#fff; }
				.ui-state-default{ cursor:move }
				#navigation-wrapper #components-feedback{ padding:1em; margin:5px }
				#navigation-feedback { margin-top:15px; margin-bottom:17px; padding-top:12px; padding-bottom:12px; }
			</style>
		</div>
		<?php 
    }