Internal function to generate the menu for "users" actions
@return mixed Array with links, title and title options
162273
public function users()
    {
        //Only admins and managers can access this controller
        if (!$this->Auth->isGroup(['admin', 'manager'])) {
            return;
        }

        $links[] = [__d('me_cms', 'List users'), [
            'controller' => 'Users',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Add user'), [
            'controller' => 'Users',
            'action' => 'add',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admins can access these actions
        if ($this->Auth->isGroup('admin')) {
            $links[] = [__d('me_cms', 'List groups'), [
                'controller' => 'UsersGroups',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add group'), [
                'controller' => 'UsersGroups',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        return [$links, I18N_USERS, ['icon' => 'users']];
    }
303570
function admin_menu()
	{
		// add page
		$page = add_submenu_page('edit.php?post_type=acf', __('Add-ons','acf'), __('Add-ons','acf'), 'manage_options', 'acf-addons', array($this,'html'));
		
		
		// actions
		add_action('load-' . $page, array($this,'load'));
		add_action('admin_print_scripts-' . $page, array($this, 'admin_print_scripts'));
		add_action('admin_print_styles-' . $page, array($this, 'admin_print_styles'));
		add_action('admin_head-' . $page, array($this,'admin_head'));
	}
432729
public function actions() {

		$user = Yii::$app->core->getUser();

		return [
			// Avatar
			'assign-avatar' => [ 'class' => 'cmsgears\core\common\actions\content\avatar\Assign', 'model' => $user ],
			'clear-avatar' => [ 'class' => 'cmsgears\core\common\actions\content\avatar\Clear', 'model' => $user ],
			// Banner
			'assign-banner' => [ 'class' => 'cmsgears\core\common\actions\content\banner\Assign', 'model' => $user ],
			'clear-banner' => [ 'class' => 'cmsgears\core\common\actions\content\banner\Clear', 'model' => $user ],
			// Video
			'assign-video' => [ 'class' => 'cmsgears\core\common\actions\content\video\Assign', 'model' => $user ],
			'clear-video' => [ 'class' => 'cmsgears\core\common\actions\content\video\Clear', 'model' => $user ],
			// Gallery
			'update-gallery' => [ 'class' => 'cmsgears\core\common\actions\gallery\Update', 'model' => $user ],
			'get-gallery-item' => [ 'class' => 'cmsgears\core\common\actions\gallery\item\Read', 'model' => $user ],
			'add-gallery-item' => [ 'class' => 'cmsgears\core\common\actions\gallery\item\Create', 'model' => $user ],
			'update-gallery-item' => [ 'class' => 'cmsgears\core\common\actions\gallery\item\Update', 'model' => $user ],
			'delete-gallery-item' => [ 'class' => 'cmsgears\core\common\actions\gallery\item\Delete', 'model' => $user ],
			// Options
			'assign-option' => [ 'class' => 'cmsgears\core\common\actions\option\Assign', 'model' => $user ],
			'remove-option' => [ 'class' => 'cmsgears\core\common\actions\option\Remove', 'model' => $user ],
			'delete-option' => [ 'class' => 'cmsgears\core\common\actions\option\Delete', 'model' => $user ],
			'toggle-option' => [ 'class' => 'cmsgears\core\common\actions\option\Toggle', 'model' => $user ],
			// Metas
			'add-meta' => [ 'class' => 'cmsgears\core\common\actions\meta\Create', 'model' => $user ],
			'update-meta' => [ 'class' => 'cmsgears\core\common\actions\meta\Update', 'model' => $user ],
			'toggle-meta' => [ 'class' => 'cmsgears\core\common\actions\meta\Toggle', 'model' => $user ],
			'delete-meta' => [ 'class' => 'cmsgears\core\common\actions\meta\Delete', 'model' => $user ],
			'settings' => [ 'class' => 'cmsgears\core\common\actions\meta\UpdateMultiple', 'model' => $user ],
			// Address
			'get-address' => [ 'class' => 'cmsgears\core\common\actions\address\Read', 'model' => $user ],
			'add-address' => [ 'class' => 'cmsgears\core\common\actions\address\Create', 'model' => $user ],
			'update-address' => [ 'class' => 'cmsgears\core\common\actions\address\Update', 'model' => $user ],
			'delete-address' => [ 'class' => 'cmsgears\core\common\actions\address\Delete', 'model' => $user ],
			// Data Object - Use current logged in user to update the config and settings
			'set-data' => [ 'class' => 'cmsgears\core\common\actions\data\data\Set', 'model' => $user ],
			'remove-data' => [ 'class' => 'cmsgears\core\common\actions\data\data\Remove', 'model' => $user ],
			'set-attribute' => [ 'class' => 'cmsgears\core\common\actions\data\attribute\Set', 'model' => $user ],
			'remove-attribute' => [ 'class' => 'cmsgears\core\common\actions\data\attribute\Remove', 'model' => $user ],
			'set-config' => [ 'class' => 'cmsgears\core\common\actions\data\config\Set', 'model' => $user ],
			'remove-config' => [ 'class' => 'cmsgears\core\common\actions\data\config\Remove', 'model' => $user ],
			'set-setting' => [ 'class' => 'cmsgears\core\common\actions\data\setting\Set', 'model' => $user ],
			'remove-setting' => [ 'class' => 'cmsgears\core\common\actions\data\setting\Remove', 'model' => $user ]
		];
	}
1245061
public function actionUrls()
    {
        $urls = DpAdminMenu::getUrlsByParentId($this->identity->is_super, $this->menuIdList, null);

        $urls = array_merge($urls, [
            'admin.public.login' => Url::toRoute('/admin/public/login'),
            'admin.public.logout' => Url::toRoute('/admin/public/logout'),
            'admin.common.tree' => Url::toRoute('/admin/common/tree'),
            'admin.common.urls' => Url::toRoute('/admin/common/urls'),

            'admin.config.save' => Url::toRoute('/admin/config/save'),
            'admin.config.options' => Url::toRoute('/admin/config/options'),
            'admin.group.save' => Url::toRoute('/admin/group/save'),
            'admin.group.update-status' => Url::toRoute('/admin/group/update-status'),
            'admin.group.del' => Url::toRoute('/admin/group/del'),
            'admin.user.save' => Url::toRoute('/admin/user/save'),
            'admin.user.update-status' => Url::toRoute('/admin/user/update-status'),
            'admin.user.del' => Url::toRoute('/admin/user/del'),
            'admin.menu.save' => Url::toRoute('/admin/menu/save'),
            'admin.menu.update-status' => Url::toRoute('/admin/menu/update-status'),
            'admin.menu.del' => Url::toRoute('/admin/menu/del'),
            'admin.menu-url.save' => Url::toRoute('/admin/menu-url/save'),
            'admin.menu-url.update-status' => Url::toRoute('/admin/menu-url/update-status'),
            'admin.menu-url.del' => Url::toRoute('/admin/menu-url/del'),
            'admin.menu-url-link.save' => Url::toRoute('/admin/menu-url-link/save'),
            'admin.menu-url-link.update-status' => Url::toRoute('/admin/menu-url-link/update-status'),
            'admin.menu-url-link.del' => Url::toRoute('/admin/menu-url-link/del'),
            'admin.menu-url-rule.save' => Url::toRoute('/admin/menu-url-rule/save'),
            'admin.menu-url-rule.update-status' => Url::toRoute('/admin/menu-url-rule/update-status'),
            'admin.menu-url-rule.del' => Url::toRoute('/admin/menu-url-rule/del'),
        ], DpAdminMenu::getUrlsByParentId($this->identity->is_super, $this->menuIdList, null));

        return [
            'data' => $urls,
        ];
    }
1171194
def admin_menu 
      @admin_menu ||= [
        ['overview', :dashboard, {controller: 'gricer/dashboard', action: 'overview'}],
        ['visitors', :menu, [
          ['entry_pages', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'entry_path'}],
          ['referers', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'referer_host'}],
          ['search_engines', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'search_engine'}],
          ['search_terms', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'search_query'}],
          ['countries', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'country'}],
          ['domains', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'domain'}],
          ['locales', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'requested_locale_major'}]
        ] ],
        ['pages', :menu, [
          ['views', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'path'}],
          ['hosts', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'host'}],
          ['methods', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'method'}],
          ['protocols', :spread, {controller: 'gricer/requests', action: 'spread_stats', field: 'protocol'}],
        ] ],
        ['browsers', :menu, [
          ['browsers', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'agent.name'}],
          ['operating_systems', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'agent.os'}],
          ['engines', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'agent.engine_name'}],
          ['javascript', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'javascript'}],
          ['java', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'java'}],
          ['silverlight', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'silverlight_major_version'}],
          ['flash', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'flash_major_version'}],
          ['screen_sizes', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'screen_size'}],
          ['color_depths', :spread, {controller: 'gricer/sessions', action: 'spread_stats', field: 'screen_depth'}]
        ] ]
      ]
    end
1036741
public function createAdminMenu() {
        $connection = \Yii::$app->db;
        $query = new Query;
        if(!$this->singleMenu) {
            $menu_name = $this->friendly($this->getController());
            $menu = $query->from('AdminMenu')
                ->where('internal=:internal', [':internal'=>$this->menu])
                ->one();

            if(!$menu) {
                $query = new Query;
                // compose the query
                $last_main_menu = $query->from('AdminMenu')
                    ->where('AdminMenu_id IS NULL')
                    ->orderby('order DESC')          
                    ->one();

                $this->insert('AdminMenu', [
                    "name" => $this->menu,
                    "internal" => $this->menu,
                    "url" => '',
                    "ap" => 'read::'.$this->getController(),
                    "order" => $last_main_menu ? $last_main_menu['order'] + 1 : 1
                ]);
                $menu_id = $connection->getLastInsertID();
            } else {
                $menu_id = $menu['id'];
            }
        } else {
            $menu_id = NULL;
            $menu_name = $this->menu;
        }
        $query = new Query;

        $last_menu = $query->from('AdminMenu')
                ->from('AdminMenu')
                ->where('AdminMenu_id=:AdminMenu_id', [':AdminMenu_id'=>$menu_id])
                ->orderby('order DESC')
                ->one();

        $this->insert('AdminMenu', [
            "AdminMenu_id" => $menu_id,
            "name" => $menu_name,
            "internal" => $this->getController() . 'Controller',
            "url" => ($this->module ? '/' . $this->module : '' ) . '/'. strtolower(trim(preg_replace("([A-Z])", "-$0", $this->getController()), '-')).'/',
            "ap" => 'read::'.$this->getController(),
            "order" => $last_menu ? $last_menu['order'] + 1 : 1
        ]);
    }
583189
public function admin_menu() {

		$advanced_content_types = PodsMeta::$advanced_content_types;
		$taxonomies             = PodsMeta::$taxonomies;
		$settings               = PodsMeta::$settings;

		$all_pods = pods_api()->load_pods( array( 'count' => true ) );

		if ( ! PodsInit::$upgrade_needed || ( pods_is_admin() && 1 === (int) pods_v( 'pods_upgrade_bypass' ) ) ) {
			$submenu_items = array();

			if ( ! empty( $advanced_content_types ) ) {
				$submenu = array();

				$pods_pages = 0;

				foreach ( (array) $advanced_content_types as $pod ) {
					if ( ! isset( $pod['name'] ) || ! isset( $pod['options'] ) || empty( $pod['fields'] ) ) {
						continue;
					} elseif ( ! pods_is_admin(
						array(
							'pods',
							'pods_content',
							'pods_add_' . $pod['name'],
							'pods_edit_' . $pod['name'],
							'pods_delete_' . $pod['name'],
						)
					) ) {
						continue;
					}

					$pod_name = $pod['name'];

					$pod = apply_filters( "pods_advanced_content_type_pod_data_{$pod_name}", $pod, $pod['name'] );
					$pod = apply_filters( 'pods_advanced_content_type_pod_data', $pod, $pod['name'] );

					if ( 1 === (int) pods_v( 'show_in_menu', $pod['options'], 0 ) ) {
						$page_title = pods_v( 'label', $pod, ucwords( str_replace( '_', ' ', $pod['name'] ) ), true );
						$page_title = apply_filters( 'pods_admin_menu_page_title', $page_title, $pod );

						$menu_label = pods_v( 'menu_name', $pod['options'], $page_title, true );
						$menu_label = apply_filters( 'pods_admin_menu_label', $menu_label, $pod );

						$singular_label = pods_v( 'label_singular', $pod['options'], pods_v( 'label', $pod, ucwords( str_replace( '_', ' ', $pod['name'] ) ), true ), true );
						$plural_label   = pods_v( 'label', $pod, ucwords( str_replace( '_', ' ', $pod['name'] ) ), true );

						$menu_location        = pods_v( 'menu_location', $pod['options'], 'objects' );
						$menu_location_custom = pods_v( 'menu_location_custom', $pod['options'], '' );

						$menu_position = pods_v( 'menu_position', $pod['options'], '', true );
						$menu_icon     = pods_evaluate_tags( pods_v( 'menu_icon', $pod['options'], '', true ), true );

						if ( empty( $menu_position ) ) {
							$menu_position = null;
						}

						$parent_page = null;

						if ( pods_is_admin(
							array(
								'pods',
								'pods_content',
								'pods_edit_' . $pod['name'],
								'pods_delete_' . $pod['name'],
							)
						) ) {
							if ( ! empty( $menu_location_custom ) ) {
								if ( ! isset( $submenu_items[ $menu_location_custom ] ) ) {
									$submenu_items[ $menu_location_custom ] = array();
								}

								$submenu_items[ $menu_location_custom ][] = array(
									$menu_location_custom,
									$page_title,
									$menu_label,
									'read',
									'pods-manage-' . $pod['name'],
									array( $this, 'admin_content' ),
								);

								continue;
							} else {
								$pods_pages ++;

								$page        = 'pods-manage-' . $pod['name'];
								$parent_page = $page;

								if ( empty( $menu_position ) ) {
									$menu_position = null;
								}
								add_menu_page( $page_title, $menu_label, 'read', $parent_page, '', $menu_icon, $menu_position );

								$all_title = $plural_label;
								$all_label = pods_v( 'label_all_items', $pod['options'], __( 'All', 'pods' ) . ' ' . $plural_label );

								if ( pods_v( 'page' ) === $page ) {
									if ( 'edit' === pods_v( 'action', 'get', 'manage' ) ) {
										$all_title = pods_v( 'label_edit_item', $pod['options'], __( 'Edit', 'pods' ) . ' ' . $singular_label );
									} elseif ( 'add' === pods_v( 'action', 'get', 'manage' ) ) {
										$all_title = pods_v( 'label_add_new_item', $pod['options'], __( 'Add New', 'pods' ) . ' ' . $singular_label );
									}
								}

								add_submenu_page(
									$parent_page, $all_title, $all_label, 'read', $page, array(
										$this,
										'admin_content',
									)
								);
							}//end if
						}//end if

						if ( pods_is_admin( array( 'pods', 'pods_content', 'pods_add_' . $pod['name'] ) ) ) {
							$page = 'pods-add-new-' . $pod['name'];

							if ( null === $parent_page ) {
								$pods_pages ++;

								$parent_page = $page;

								if ( empty( $menu_position ) ) {
									$menu_position = null;
								}
								add_menu_page( $page_title, $menu_label, 'read', $parent_page, '', $menu_icon, $menu_position );
							}

							$add_title = pods_v( 'label_add_new_item', $pod['options'], __( 'Add New', 'pods' ) . ' ' . $singular_label );
							$add_label = pods_v( 'label_add_new', $pod['options'], __( 'Add New', 'pods' ) );

							add_submenu_page(
								$parent_page, $add_title, $add_label, 'read', $page, array(
									$this,
									'admin_content',
								)
							);
						}//end if
					} else {
						$submenu[] = $pod;
					}//end if
				}//end foreach

				$submenu = apply_filters( 'pods_admin_menu_secondary_content', $submenu );

				if ( ! empty( $submenu ) && ( ! defined( 'PODS_DISABLE_CONTENT_MENU' ) || ! PODS_DISABLE_CONTENT_MENU ) ) {
					$parent_page = null;

					foreach ( $submenu as $item ) {
						$singular_label = pods_v( 'label_singular', $item['options'], pods_v( 'label', $item, ucwords( str_replace( '_', ' ', $item['name'] ) ), true ), true );
						$plural_label   = pods_v( 'label', $item, ucwords( str_replace( '_', ' ', $item['name'] ) ), true );

						if ( pods_is_admin(
							array(
								'pods',
								'pods_content',
								'pods_edit_' . $item['name'],
								'pods_delete_' . $item['name'],
							)
						) ) {
							$page = 'pods-manage-' . $item['name'];

							if ( null === $parent_page ) {
								$parent_page = $page;

								add_menu_page( 'Pods', 'Pods', 'read', $parent_page, null, 'dashicons-pods', '58.5' );
							}

							$all_title = $plural_label;
							$all_label = __( 'Manage', 'pods' ) . ' ' . $plural_label;

							if ( pods_v( 'page' ) === $page ) {
								if ( 'edit' === pods_v( 'action', 'get', 'manage' ) ) {
									$all_title = __( 'Edit', 'pods' ) . ' ' . $singular_label;
								} elseif ( 'add' === pods_v( 'action', 'get', 'manage' ) ) {
									$all_title = __( 'Add New', 'pods' ) . ' ' . $singular_label;
								}
							}

							add_submenu_page(
								$parent_page, $all_title, $all_label, 'read', $page, array(
									$this,
									'admin_content',
								)
							);
						} elseif ( current_user_can( 'pods_add_' . $item['name'] ) ) {
							$page = 'pods-add-new-' . $item['name'];

							if ( null === $parent_page ) {
								$parent_page = $page;

								add_menu_page( 'Pods', 'Pods', 'read', $parent_page, null, 'dashicons-pods', '58.5' );
							}

							$add_title = __( 'Add New', 'pods' ) . ' ' . $singular_label;
							$add_label = __( 'Manage', 'pods' ) . ' ' . $plural_label;

							add_submenu_page(
								$parent_page, $add_title, $add_label, 'read', $page, array(
									$this,
									'admin_content',
								)
							);
						}//end if
					}//end foreach
				}//end if
			}//end if

			if ( ! empty( $taxonomies ) ) {
				foreach ( (array) $taxonomies as $pod ) {
					// Default taxonomy capability
					$capability = 'manage_categories';

					if ( ! empty( $pod['options']['capability_type'] ) ) {
						if ( 'custom' === $pod['options']['capability_type'] && ! empty( $pod['options']['capability_type_custom'] ) ) {
							$capability = 'manage_' . (string) $pod['options']['capability_type_custom'] . '_terms';
						}
					}

					if ( ! pods_is_admin(
						array(
							'pods',
							'pods_content',
							'pods_edit_' . $pod['name'],
							$capability,
						)
					) ) {
						continue;
					}

					// Check UI settings
					if ( 1 !== (int) pods_v( 'show_ui', $pod['options'], 0 ) || 1 !== (int) pods_v( 'show_in_menu', $pod['options'], 0 ) ) {
						continue;
					}

					$page_title = pods_v( 'label', $pod, ucwords( str_replace( '_', ' ', $pod['name'] ) ), true );
					$page_title = apply_filters( 'pods_admin_menu_page_title', $page_title, $pod );

					$menu_label = pods_v( 'menu_name', $pod['options'], $page_title, true );
					$menu_label = apply_filters( 'pods_admin_menu_label', $menu_label, $pod );

					$menu_position = pods_v( 'menu_position', $pod['options'], '', true );
					$menu_icon     = pods_evaluate_tags( pods_v( 'menu_icon', $pod['options'], '', true ), true );

					if ( empty( $menu_position ) ) {
						$menu_position = null;
					}

					$menu_slug            = 'edit-tags.php?taxonomy=' . $pod['name'];
					$menu_location        = pods_v( 'menu_location', $pod['options'], 'default' );
					$menu_location_custom = pods_v( 'menu_location_custom', $pod['options'], '' );

					if ( 'default' === $menu_location ) {
						continue;
					}

					$taxonomy_data = get_taxonomy( $pod['name'] );

					foreach ( (array) $taxonomy_data->object_type as $post_type ) {
						if ( 'post' === $post_type ) {
							remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=' . $pod['name'] );
						} elseif ( 'attachment' === $post_type ) {
							remove_submenu_page( 'upload.php', 'edit-tags.php?taxonomy=' . $pod['name'] . '&amp;post_type=' . $post_type );
						} else {
							remove_submenu_page( 'edit.php?post_type=' . $post_type, 'edit-tags.php?taxonomy=' . $pod['name'] . '&amp;post_type=' . $post_type );
						}
					}

					if ( 'settings' === $menu_location ) {
						add_options_page( $page_title, $menu_label, 'read', $menu_slug );
					} elseif ( 'appearances' === $menu_location ) {
						add_theme_page( $page_title, $menu_label, 'read', $menu_slug );
					} elseif ( 'objects' === $menu_location ) {
						if ( empty( $menu_position ) ) {
							$menu_position = null;
						}
						add_menu_page( $page_title, $menu_label, 'read', $menu_slug, '', $menu_icon, $menu_position );
					} elseif ( 'top' === $menu_location ) {
						add_menu_page( $page_title, $menu_label, 'read', $menu_slug, '', $menu_icon, $menu_position );
					} elseif ( 'submenu' === $menu_location && ! empty( $menu_location_custom ) ) {
						if ( ! isset( $submenu_items[ $menu_location_custom ] ) ) {
							$submenu_items[ $menu_location_custom ] = array();
						}

						$submenu_items[ $menu_location_custom ][] = array(
							$menu_location_custom,
							$page_title,
							$menu_label,
							'read',
							$menu_slug,
							'',
						);
					}//end if
				}//end foreach
			}//end if

			if ( ! empty( $settings ) ) {
				foreach ( (array) $settings as $pod ) {
					if ( ! pods_is_admin( array( 'pods', 'pods_content', 'pods_edit_' . $pod['name'] ) ) ) {
						continue;
					}

					$page_title = pods_v( 'label', $pod, ucwords( str_replace( '_', ' ', $pod['name'] ) ), true );
					$page_title = apply_filters( 'pods_admin_menu_page_title', $page_title, $pod );

					$menu_label = pods_v( 'menu_name', $pod['options'], $page_title, true );
					$menu_label = apply_filters( 'pods_admin_menu_label', $menu_label, $pod );

					$menu_position = pods_v( 'menu_position', $pod['options'], '', true );
					$menu_icon     = pods_evaluate_tags( pods_v( 'menu_icon', $pod['options'], '', true ), true );

					if ( empty( $menu_position ) ) {
						$menu_position = null;
					}

					$menu_slug            = 'pods-settings-' . $pod['name'];
					$menu_location        = pods_v( 'menu_location', $pod['options'], 'settings' );
					$menu_location_custom = pods_v( 'menu_location_custom', $pod['options'], '' );

					if ( 'settings' === $menu_location ) {
						add_options_page(
							$page_title, $menu_label, 'read', $menu_slug, array(
								$this,
								'admin_content_settings',
							)
						);
					} elseif ( 'appearances' === $menu_location ) {
						add_theme_page(
							$page_title, $menu_label, 'read', $menu_slug, array(
								$this,
								'admin_content_settings',
							)
						);
					} elseif ( 'objects' === $menu_location ) {
						if ( empty( $menu_position ) ) {
							$menu_position = null;
						}
						add_menu_page(
							$page_title, $menu_label, 'read', $menu_slug, array(
								$this,
								'admin_content_settings',
							), $menu_icon, $menu_position
						);
					} elseif ( 'top' === $menu_location ) {
						add_menu_page(
							$page_title, $menu_label, 'read', $menu_slug, array(
								$this,
								'admin_content_settings',
							), $menu_icon, $menu_position
						);
					} elseif ( 'submenu' === $menu_location && ! empty( $menu_location_custom ) ) {
						if ( ! isset( $submenu_items[ $menu_location_custom ] ) ) {
							$submenu_items[ $menu_location_custom ] = array();
						}

						$submenu_items[ $menu_location_custom ][] = array(
							$menu_location_custom,
							$page_title,
							$menu_label,
							'read',
							$menu_slug,
							array( $this, 'admin_content_settings' ),
						);
					}//end if
				}//end foreach
			}//end if

			foreach ( $submenu_items as $items ) {
				foreach ( $items as $item ) {
					call_user_func_array( 'add_submenu_page', $item );
				}
			}

			$admin_menus = array(
				'pods'            => array(
					'label'    => __( 'Edit Pods', 'pods' ),
					'function' => array( $this, 'admin_setup' ),
					'access'   => 'pods',
				),
				'pods-add-new'    => array(
					'label'    => __( 'Add New', 'pods' ),
					'function' => array( $this, 'admin_setup' ),
					'access'   => 'pods',
				),
				'pods-components' => array(
					'label'    => __( 'Components', 'pods' ),
					'function' => array( $this, 'admin_components' ),
					'access'   => 'pods_components',
				),
				'pods-settings'   => array(
					'label'    => __( 'Settings', 'pods' ),
					'function' => array( $this, 'admin_settings' ),
					'access'   => 'pods_settings',
				),
				'pods-help'       => array(
					'label'    => __( 'Help', 'pods' ),
					'function' => array( $this, 'admin_help' ),
				),
			);

			if ( empty( $all_pods ) ) {
				unset( $admin_menus['pods'] );
			}

			add_filter( 'parent_file', array( $this, 'parent_file' ) );
		} else {
			$admin_menus = array(
				'pods-upgrade'  => array(
					'label'    => __( 'Upgrade', 'pods' ),
					'function' => array( $this, 'admin_upgrade' ),
					'access'   => 'manage_options',
				),
				'pods-settings' => array(
					'label'    => __( 'Settings', 'pods' ),
					'function' => array( $this, 'admin_settings' ),
					'access'   => 'pods_settings',
				),
				'pods-help'     => array(
					'label'    => __( 'Help', 'pods' ),
					'function' => array( $this, 'admin_help' ),
				),
			);

			add_action( 'admin_notices', array( $this, 'upgrade_notice' ) );
		}//end if

		/**
		 * Add or change Pods Admin menu items
		 *
		 * @param array $admin_menus The submenu items in Pods Admin menu.
		 *
		 * @since  unknown
		 */
		$admin_menus = apply_filters( 'pods_admin_menu', $admin_menus );

		$parent = false;

		// PODS_LIGHT disables all Pods components so remove the components menu
		if ( defined( 'PODS_LIGHT' ) && true === PODS_LIGHT ) {
			unset( $admin_menus['pods-components'] );
		}

		if ( ! empty( $admin_menus ) && ( ! defined( 'PODS_DISABLE_ADMIN_MENU' ) || ! PODS_DISABLE_ADMIN_MENU ) ) {
			foreach ( $admin_menus as $page => $menu_item ) {
				if ( ! pods_is_admin( pods_v( 'access', $menu_item ) ) ) {
					continue;
				}

				// Don't just show the help page
				if ( false === $parent && 'pods-help' === $page ) {
					continue;
				}

				if ( ! isset( $menu_item['label'] ) ) {
					$menu_item['label'] = $page;
				}

				if ( false === $parent ) {
					$parent = $page;

					$menu = __( 'Pods Admin', 'pods' );

					if ( 'pods-upgrade' === $parent ) {
						$menu = __( 'Pods Upgrade', 'pods' );
					}

					add_menu_page( $menu, $menu, 'read', $parent, null, 'dashicons-pods' );
				}

				add_submenu_page( $parent, $menu_item['label'], $menu_item['label'], 'read', $page, $menu_item['function'] );

				if ( 'pods-components' === $page && is_object( PodsInit::$components ) ) {
					PodsInit::$components->menu( $parent );
				}
			}//end foreach
		}//end if
	}
762376
public function getFormActions()
    {
        $submitText = ($this->controller->SubmitButtonText)
            ? $this->controller->SubmitButtonText
            : _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.SUBMITBUTTON', 'Submit');
        $clearText = ($this->controller->ClearButtonText)
            ? $this->controller->ClearButtonText
            : _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.CLEARBUTTON', 'Clear');

        $actions = FieldList::create(FormAction::create('process', $submitText));

        if ($this->controller->ShowClearButton) {
            $actions->push(FormAction::create('clearForm', $clearText)->setAttribute('type', 'reset'));
        }

        $this->extend('updateFormActions', $actions);
        $actions->setForm($this);
        return $actions;
    }
177964
public function newAction()
    {
        $entity = new Menu();
        $form   = $this->createForm('menu', $entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }
566184
function admin_menu()
	{
		
		// validate page
		if( ! $this->validate_page() )
		{
			return;
		}
		
		
		// actions
		add_action('admin_print_scripts', array($this,'admin_print_scripts'));
		add_action('admin_print_styles', array($this,'admin_print_styles'));
		add_action('admin_footer', array($this,'admin_footer'));
		
		
		// columns
		add_filter( 'manage_edit-acf_columns', array($this,'acf_edit_columns'), 10, 1 );
		add_action( 'manage_acf_posts_custom_column' , array($this,'acf_columns_display'), 10, 2 );
		
	}
119363
public static function getMenuNotAllowAll(): array
    {
        $setor = !empty($_SESSION['userlogin']) ? $_SESSION['userlogin']['setor'] : "0";
        $path = "public/dash/-menu.json";
        $pathSession = !empty($setor) ? "public/dash/{$setor}/-menu.json" : "";
        $file = [];

        //public base
        if (file_exists(PATH_HOME . $path))
            $file = self::addNotShow(PATH_HOME . $path, $file);

        //public session
        if (!empty($pathSession) && file_exists(PATH_HOME . $pathSession))
            $file = self::addNotShow(PATH_HOME . $pathSession, $file);

        //para cada biblioteca
        foreach (Helper::listFolder(PATH_HOME . VENDOR) as $lib) {
            $base = PATH_HOME . VENDOR . "{$lib}/";

            //lib base
            if (file_exists($base . $path))
                $file = self::addNotShow($base . $path, $file, $base);

            //lib session
            if (!empty($pathSession) && file_exists($base . $pathSession))
                $file = self::addNotShow($base . $pathSession, $file, $base);
        }

        return $file;
    }
1303300
public function indexAction()
    {
        $this->html->h2($this->getTopicTitle());

        $displayColumns = array('link'     => '',
                                'context'  => $this->_('Context'),
                                'maxLevel' => $this->_('Max level'),
                                'level'    => $this->_('Level'));

        foreach($this->_upgrades->getUpgradesInfo() as $row) {
            $menuItem = $this->menu->findAllowedController($this->_getParam('controller'), 'show');
            if ($menuItem) {
                $row['link'] = $menuItem->toActionLinkLower($this->getRequest(), $row);
            }
            $data[] = $row;
        }
        $this->addSnippet('SelectiveTableSnippet', 'data', $data, 'class', 'browser table', 'columns', $displayColumns);
        $this->html->br();
        $this->compatibilityReportAction();
    }
1357617
public function secondaryMenuActions()
    {
        if ($this->secondaryMenuActions === null) {
            $ident    = $this->ident();
            $metadata = $this->adminSecondaryMenu();
            if (isset($metadata[$ident]['actions'])) {
                $actions = $metadata[$ident]['actions'];
            } else {
                $actions = [];
            }
            $this->setSecondaryMenuActions($actions);
        }

        if ($this->parsedSecondaryMenuActions === false) {
            $this->parsedSecondaryMenuActions = true;
            $this->secondaryMenuActions = $this->createSecondaryMenuActions($this->secondaryMenuActions);
        }

        return $this->secondaryMenuActions;
    }
1310715
public function adminRender()
    {
        $result = '';
        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $ctrl = new Menus_Controller_Admin($this, $page);
        switch (true)
        {
            case !is_null(arg('id')):
                $result = $ctrl->editAction();
                break;
            case arg('action') == 'create':
                $result = $ctrl->addAction();
                break;
            case !is_null(arg('toggle')):
                $ctrl->toggleAction(arg('toggle', 'int'));
                break;
            case !is_null(arg('delete')):
                $ctrl->deleteAction(arg('delete', 'dbsafe'));
                break;
            default:
                $result = $ctrl->listAction();
        }
        return $result;
    }
299616
protected function createAdminMenu(): void
    {
        $menu = $this->menu();
        $events = $this->app->make('events');

        $handlers = [
            UserMenuHandler::class,
            ExtensionMenuHandler::class,
            SettingMenuHandler::class,
        ];

        $menu->add('home')
            ->title(\trans('orchestra/foundation::title.home'))
            ->link($this->handles('orchestra::/'))
            ->icon('home');

        foreach ($handlers as $handler) {
            $events->listen('orchestra.started: admin', $handler);
        }
    }
595989
public function menu()
    {
        if (!empty($this->menu)) {
            return $this->menu;
        }

        $menuModel = config('admin.database.menu_model');

        return $this->menu = (new $menuModel())->toTree();
    }
11741
protected function menu()
    {

        $this->Benchmark->start('getMenu');
        try {
            $menu = $this->CMSNavItemService->getMenu();
        } catch (Exception $e) {
            return '';
        }
        $this->Benchmark->end('getMenu');

        $this->Benchmark->start('buildMenu');
        $dom_id    = $this->getParameter('id');
        $dom_class = $this->getParameter('class');

        $this->matchedCurrentURI = false;

        $root_options = array();
        if (!empty($dom_id))
            $root_options[] = "id='{$dom_id}'";
        if (!empty($dom_class))
            $root_options[] = "class='{$dom_class}'";

        $family_tree = "<ul " . join(' ', $root_options). ">\n";

        $this->requestURI = ltrim($this->Request->getAdjustedRequestURI(), '/');

        foreach ( $menu as $parent ) {
            $family_tree .= $this->_buildMenuTree($parent, "parent", "<span>%s</span>", true);
        }

        $family_tree .= "</ul>\n";
        $this->Benchmark->end('buildMenu');

        return $family_tree;
    }