Asset
5 years ago
HelpTab
5 years ago
Main
5 years ago
Menu
5 years ago
Notice
5 years ago
Preference
5 years ago
ScreenOption
5 years ago
Section
5 years ago
AddonStatus.php
5 years ago
Admin.php
5 years ago
AdminNetwork.php
5 years ago
AdminScripts.php
5 years ago
Banner.php
5 years ago
HelpTab.php
5 years ago
Helpable.php
5 years ago
MainFactory.php
5 years ago
MainFactoryInterface.php
5 years ago
Menu.php
5 years ago
MenuFactory.php
5 years ago
MenuFactoryInterface.php
5 years ago
NetworkRequestHandler.php
5 years ago
Page.php
5 years ago
PageFactory.php
5 years ago
PageFactoryInterface.php
5 years ago
PageRequestHandler.php
5 years ago
RequestHandler.php
5 years ago
RequestHandlerInterface.php
5 years ago
ScreenOption.php
5 years ago
ScreenOptions.php
5 years ago
Section.php
5 years ago
SectionCollection.php
5 years ago
Table.php
5 years ago
Tooltip.php
5 years ago
WpMenuFactory.php
5 years ago
MenuFactory.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Admin; |
| 4 | |
| 5 | use AC\Deprecated\Hooks; |
| 6 | |
| 7 | class MenuFactory implements MenuFactoryInterface { |
| 8 | |
| 9 | /** |
| 10 | * @var string |
| 11 | */ |
| 12 | protected $url; |
| 13 | |
| 14 | public function __construct( $url ) { |
| 15 | $this->url = $url; |
| 16 | } |
| 17 | |
| 18 | public function create( $current ) { |
| 19 | $menu = new Menu( $this->url, $current ); |
| 20 | |
| 21 | $menu->add_item( Main\Columns::NAME, __( 'Columns', 'codepress-admin-columns' ) ) |
| 22 | ->add_item( Main\Settings::NAME, __( 'Settings', 'codepress-admin-columns' ) ) |
| 23 | ->add_item( Main\Addons::NAME, __( 'Add-ons', 'codepress-admin-columns' ) ); |
| 24 | |
| 25 | $hooks = new Hooks(); |
| 26 | |
| 27 | if ( $hooks->get_count() > 0 ) { |
| 28 | $menu->add_item( Main\Help::NAME, sprintf( '%s %s', __( 'Help', 'codepress-admin-columns' ), '<span class="ac-badge">' . $hooks->get_count() . '</span>' ) ); |
| 29 | } |
| 30 | |
| 31 | return $menu; |
| 32 | } |
| 33 | |
| 34 | } |