Calculates admin settings menu slug.
If plugin's menu slug is a file (e.g. CPT), uses plugin's slug as the menu slug.

@author Vova Feldman (@svovaf)
@since  1.1.3

@param string $page

@return string
168618
function get_slug( $page = '' ) {
			return ( ( false === strpos( $this->_menu_slug, '.php?' ) ) ?
				$this->_menu_slug :
				$this->_module_unique_affix ) . ( empty( $page ) ? '' : ( '-' . $page ) );
		}
905010
protected function generatePageText($page)
	{
		if($this->pageTextFormat!==null)
			return sprintf($this->pageTextFormat,$page+1);
		else
			return $page+1;
	}
1269099
public function admin_enqueue_scripts($page){
		if( 'tools_page_wpametu-batch' == $page ){
			wp_enqueue_script('wpametu-batch-helper');
			wp_localize_script('wpametu-batch-helper', 'WpametuBatch', [
				'confirm' => $this->__('Are you sure to execute this?'),
				'alert' => $this->__('No Batch is selected.'),
				'done' => $this->__('[DONE] Batch process done.')
			]);
			wp_enqueue_style('wpametu-batch-screen');
		}
	}
1224182
public static function getBySectionOfSite($page)
    {
        $identifier = sprintf('/multilingual/section/%s', $page->getCollectionID());
        $cache = \Core::make('cache/request');
        $item = $cache->getItem($identifier);
        if (!$item->isMiss()) {
            $returnID = $item->get();
        } else {

            $item->lock();

            $returnID = false;

            if ($page->isPageDraft()) {
                $tree = false;
                if ($page->getPageDraftTargetParentPageID()) {
                    $cParentID = $page->getPageDraftTargetParentPageID();
                    if ($cParentID) {
                        $parent = Page::getByID($cParentID);
                        $tree = $parent->getSiteTreeObject();
                    }
                }
            }

            if (!isset($tree)) {
                $tree = $page->getSiteTreeObject();
            }

            if ($tree instanceof SiteTree) {
                $returnID = $tree->getSiteHomePageID();
            }

            $cache->save($item->set($returnID));
        }

        if ($returnID) {
            return static::getByID($returnID);
        }
    }
1219848
public function sitemap($page = null)
    {
        $ret = '';

        $pageLimit = 10000;

        if (isset($this->tsSetup['pageLimit']) && $this->tsSetup['pageLimit'] != '') {
            $pageLimit = (int)$this->tsSetup['pageLimit'];
        }

        $pageItems     = count($this->sitemapPages);
        $pageItemBegin = $pageLimit * ($page - 1);

        if ($pageItemBegin <= $pageItems) {
            $this->sitemapPages = array_slice($this->sitemapPages, $pageItemBegin, $pageLimit);

            $ret = $this->createSitemapPage();
        }

        return $ret;
    }
222424
def pages_sub_menu(context, page, url='/'):
    
    lang = context.get('lang', pages_settings.PAGE_DEFAULT_LANGUAGE)
    page = get_page_from_string_or_id(page, lang)
    if page:
        root = page.get_root()
        children = root.get_children_for_frontend()
        context.update({'children': children, 'page': page})
    return context
948376
public function setPage($page)
    {
        if (empty($page)) {
            return $this->clearPage();
        }

        session()->put($this->getSessionKey(static::TYPE_PAGE), $page);

        return $this;
    }
322050
private function updatePageMenuPosition(Page $page)
    {
        $pageMenuRepository = $this->doctrine->getRepository('FulgurioLightCMSBundle:PageMenu');
        $em = $this->doctrine->getManager();
        $data = $this->request->get('page');
        if (isset($data['availableMenu']))
        {
            if (!is_null($page->getId()))
            {
                $menus = $page->getMenu();
                $alreadyInMenu = array();
                foreach ($menus as $menu)
                {
                    if (!in_array($menu->getLabel(), $data['availableMenu']))
                    {
                        $pageMenuRepository->upMenuPagesPosition($menu->getLabel(), $menu->getPosition() + 1);
                        $em->remove($menu);
                    }
                    else
                    {
                        $alreadyInMenu[] = $menu->getLabel();
                    }
                }
            }
            foreach ($data['availableMenu'] as $menuLabel)
            {
                // If it s a new page, or if it a page which we had a new menu
                if (!isset($alreadyInMenu) || !in_array($menuLabel, $alreadyInMenu))
                {
                    $menu = new PageMenu();
                    $menu->setPosition($pageMenuRepository->getNextMenuPosition($menuLabel));
                    $menu->setLabel($menuLabel);
                    $menu->setPage($page);
                    $em->persist($menu);
                }
            }
        }
        else if (!is_null($page->getId()))
        {
            $menus = $page->getMenu();
            foreach ($menus as $menu)
            {
                $pageMenuRepository->upMenuPagesPosition($menu->getLabel(), $menu->getPosition() + 1);
                $em->remove($menu);
            }
        }
    }
1249171
protected function addSuffixNumber($slug, Page $page, $number = 0)
    {
        $slugTmp = $number > 0 ? $slug . $this->slugSuffixSeparator . $number : $slug;
        $parentFullpath = $page->getParent()->getFullpath();
        $foundedPage = $this->doctrine->getRepository('FulgurioLightCMSBundle:Page')->findOneBy(array(
                'fullpath' => ($parentFullpath !== '' ? ($parentFullpath . '/') : '') . $slugTmp
        ));
        if ($foundedPage && $foundedPage != $page)
        {
            return $this->addSuffixNumber($slug, $page, $number + 1);
        }
        return $slugTmp;
    }
688775
private function generateAddUrl(array $page): string
    {
        $event = new GenerateFrontendUrlEvent($page, null, $page['language']);

        $this->dispatcher->dispatch(ContaoEvents::CONTROLLER_GENERATE_FRONTEND_URL, $event);

        $url = UrlBuilder::fromUrl($event->getUrl() . '?')
            ->setQueryParameter('act', 'create');

        return $url->getUrl();
    }
1201229
protected function calculateCurrentPage($lastPage)
	{
		$page = $this->env->getCurrentPage();

		// The page number will get validated and adjusted if it either less than one
		// or greater than the last page available based on the count of the given
		// items array. If it's greater than the last, we'll give back the last.
		if (is_numeric($page) && $page > $lastPage)
		{
			return $lastPage > 0 ? $lastPage : 1;
		}

		return $this->isValidPageNumber($page) ? (int) $page : 1;
	}
155513
private function override_plugin_menu_with_activation() {
            $this->_logger->entrance();

            $hook = false;

            if ( ! $this->has_settings_menu() ) {
                // Add the opt-in page without a menu item.
                $hook = FS_Admin_Menu_Manager::add_subpage(
                    null,
                    $this->get_plugin_name(),
                    $this->get_plugin_name(),
                    'manage_options',
                    $this->_slug,
                    array( &$this, '_connect_page_render' )
                );
            } else if ( $this->_menu->is_top_level() ) {
                if ( $this->_menu->is_override_exact() ) {
                    // Make sure the current page is matching the activation page.
                    if ( ! $this->is_matching_url( $this->get_activation_url() ) ) {
                        return;
                    }
                }

                $hook = $this->_menu->override_menu_item( array( &$this, '_connect_page_render' ) );

                if ( false === $hook ) {
                    // Create new menu item just for the opt-in.
                    $hook = FS_Admin_Menu_Manager::add_page(
                        $this->get_plugin_name(),
                        $this->get_plugin_name(),
                        'manage_options',
                        $this->_menu->get_slug(),
                        array( &$this, '_connect_page_render' )
                    );
                }
            } else {
                $menus = array( $this->_menu->get_parent_slug() );

                if ( $this->_menu->is_override_exact() ) {
                    // Make sure the current page is matching the activation page.
                    if ( ! $this->is_matching_url( $this->get_activation_url() ) ) {
                        return;
                    }
                }

                foreach ( $menus as $parent_slug ) {
                    $hook = $this->_menu->override_submenu_action(
                        $parent_slug,
                        $this->_menu->get_raw_slug(),
                        array( &$this, '_connect_page_render' )
                    );

                    if ( false !== $hook ) {
                        // Found plugin's submenu item.
                        break;
                    }
                }
            }

            if ( $this->is_activation_page() ) {
                // Clean admin page from distracting content.
                self::_clean_admin_content_section();
            }

            if ( false !== $hook ) {
                if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) {
                    $this->_install_with_current_user();
                } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) {
                    $this->_install_with_new_user();
                }
            }
        }
544428
public function createUri($page)
    {
        $queryString   = $this->query;
        $queryString[] = "page={$page}";
        $queryString   = implode('&', $queryString);

        return Request::pathInfo() . "?{$queryString}";
    }
289106
public function pageAction( $page = 1 )
    {
        $sitemap               = new DOMDocument( "1.0", "UTF-8" );
        $root                  = $sitemap->createElement( "urlset" );
        $sitemap->formatOutput = true;
        $root->setAttribute( "xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9" );
        $sitemap->appendChild( $root );
        $query         = $this->getQuery();
        $query->limit  = static::PACKET_MAX;
        $query->offset = static::PACKET_MAX * ( $page - 1 );

        $searchService = $this->get( "ezpublish.api.repository" )->getSearchService();

        $results = $searchService->findLocations( $query );
        $this->fillSitemap( $sitemap, $root, $results );

        $response = new Response( $sitemap->saveXML(), 200, [ "Content-type" => "text/xml" ] );
        $response->setSharedMaxAge( 24 * 3600 );

        return $response;
    }
132172
public function postAdd(Page $page)
    {
        $this->authorize('add', $page);

        $parent = $page->getAddPageParent();
        $newPage = $this->dispatch(new CreatePage($parent));

        return PageFacade::find($newPage->getId());
    }
1138796
public function Moderation($Page = '') {
      $this->Permission('Garden.Moderation.Manage');
      
      $Where = array('Operation' => array('Moderate', 'Pending'));
      
      // Filter by category menu
      if ($CategoryID = Gdn::Request()->GetValue('CategoryID')) { 
         $this->SetData('ModerationCategoryID', $CategoryID);
         $Where['CategoryID'] = $CategoryID;
      }
      
      list($Offset, $Limit) = OffsetLimit($Page, 10);
      $this->SetData('Title', T('Moderation Queue'));      
      
      $RecordCount = $this->LogModel->GetCountWhere($Where);
      $this->SetData('RecordCount', $RecordCount);
      if ($Offset >= $RecordCount)
         $Offset = $RecordCount - $Limit;

      $Log = $this->LogModel->GetWhere($Where, 'LogID', 'Desc', $Offset, $Limit);
      $this->SetData('Log', $Log);

      if ($this->DeliveryType() == DELIVERY_TYPE_VIEW)
         $this->View = 'Table';

      $this->AddSideMenu('dashboard/log/moderation');
      $this->Render();
   }
1346763
public function base($page) {
        if (!$this->urls) {
            $urls = [];
            if ($this->ogpath) {
                $urls [0] = implode('', [WWWROOT_DIR, $this->ogpath, '/', $this->ogname]);
            } else {
                $urls [0] = implode('', [WWWROOT_DIR, $this->ogname]);
            }
            $urls [1] = '';
            $suffix   = [];
            if ($this->ext) {
                $suffix [] = '.';
                $suffix [] = $this->ext;
            }
            if ($this->params) {
                $suffix [] = '?';
                $suffix [] = http_build_query($this->params, 'n');
            }
            if ($suffix) {
                $urls[2] = implode('', $suffix);
            }
            $this->urls = $urls;
        }
        if ($page > 1 || $page == 'all') {
            $this->urls [1] = '_' . $page;
        }
        $url            = implode('', $this->urls);
        $this->urls [1] = '';

        return $url;
    }