Adds a non-canonical page path to the current page.
433853
public function addAdditionalPagePath($cPath, $commit = true)
    {
        $db = Database::connection();
        $em = $db->getEntityManager();
        $path = new \Concrete\Core\Page\PagePath();
        $path->setPagePath('/'.trim($cPath, '/'));
        $path->setPageObject($this);
        $em->persist($path);
        if ($commit) {
            $em->flush();
        }

        return $path;
    }
184421
def pages_view(view):
    
    def pages_view_decorator(request, *args, **kwargs):
        # if the current page is already there
        if(kwargs.get('current_page', False) or
                kwargs.get('pages_navigation', False)):
            return view(request, *args, **kwargs)

        path = kwargs.pop('path', None)
        lang = kwargs.pop('lang', None)
        if path:
            from basic_cms.views import details
            response = details(request, path=path, lang=lang,
                only_context=True, delegation=False)
            context = response
            extra_context_var = kwargs.pop('extra_context_var', None)
            if extra_context_var:
                kwargs.update({extra_context_var: context})
            else:
                kwargs.update(context)
        return view(request, *args, **kwargs)
    return pages_view_decorator
195954
def _new_page(self):
        
        self._current_page = Drawing(*self._pagesize)
        if self._bgimage:
            self._current_page.add(self._bgimage)
        self._pages.append(self._current_page)
        self.page_count += 1
        self._position = [1, 0]
660307
public function moveToRoot()
    {
        $db = Database::connection();
        $db->executeQuery('update Pages set cParentID = 0 where cID = ?', [$this->getCollectionID()]);
        $this->cParentID = 0;
        $this->rescanSystemPageStatus();
    }
1222673
def addReplaceDBPage( dbid, pageid, pagename, pagetype, pagebody, ignoreError = nil )

      @dbid, @pageid, @pagename, @pagetype, @pagebody, @ignoreError = dbid, pageid, pagename, pagetype, pagebody, ignoreError

      if pageid
         xmlRequestData = toXML( :pageid, @pageid )
      elsif pagename
         xmlRequestData = toXML( :pagename, @pagename )
      else
         raise "addReplaceDBPage: missing pageid or pagename"
      end

      xmlRequestData << toXML( :pagetype, @pagetype )
      xmlRequestData << toXML( :pagebody, encodeXML( @pagebody ) )
      xmlRequestData << toXML( :ignoreError, "1" ) if @ignoreError

      sendRequest( :addReplaceDBPage, xmlRequestData )

      @pageid = getResponseValue( :pageid )
      @pageid ||= getResponseValue( :pageID ) # temporary

      return self if @chainAPIcalls
      @pageid
    end
908535
def page_url(self) -> str:
        """"""
        url = self.attributes['canonicalurl']
        assert isinstance(url, str)
        return url
66141
def add_page(self, pattern, classname):
        
        if not self._loaded:
            raise PluginManagerNotLoadedException()
        self._app.add_mapping(pattern, classname)
31803
def add_path(searchpath, encoding='utf-8', followlinks=False):
    """"""
    if not _has_jinja:
        raise RuntimeError(_except_text)
    _jload.add_loader(FileSystemLoader(searchpath, encoding, followlinks))
722596
public function addPage ()
    {
        add_menu_page($this->pageTitle, $this->menuTitle, $this->capability, $this->menuSlug, $this->getDisplayFunction(), $this->icon, $this->order);
    }
37705
def addFileAnnot(self, point, buffer, filename, ufilename=None, desc=None):
        """"""
        CheckParent(self)

        val = _fitz.Page_addFileAnnot(self, point, buffer, filename, ufilename, desc)

        if not val: return
        val.thisown = True
        val.parent = weakref.proxy(self)
        self._annot_refs[id(val)] = val

        return val
1090610
def add(self, dist):
        """"""
        new_path = (
            dist.location not in self.paths and (
                dist.location not in self.sitedirs or
                # account for '.' being in PYTHONPATH
                dist.location == os.getcwd()
            )
        )
        if new_path:
            self.paths.append(dist.location)
            self.dirty = True
        Environment.add(self, dist)
539468
public function addAdditionalPagePath($cPath, $commit = true)
    {
        $em = \ORM::entityManager();
        $path = new \Concrete\Core\Entity\Page\PagePath();
        $path->setPagePath('/'.trim($cPath, '/'));
        $path->setPageObject($this);
        $em->persist($path);
        if ($commit) {
            $em->flush();
        }

        return $path;
    }
462040
def add_page_break(self):
        """"""
        paragraph = self.add_paragraph()
        paragraph.add_run().add_break(WD_BREAK.PAGE)
        return paragraph
385614
def addImagePath(new_path):
    
    if os.path.exists(new_path):
        Settings.ImagePaths.append(new_path)
    elif "http://" in new_path or "https://" in new_path:
        request = requests.get(new_path)
        if request.status_code < 400:
            # Path exists
            Settings.ImagePaths.append(new_path)
        else:
            raise OSError("Unable to connect to " + new_path)
    else:
        raise OSError("File not found: " + new_path)
624946
def add(self, path):
        """"""
        
        # sys.path always has absolute paths.
        path = os.path.abspath(path)
        
        # It must exist.
        if not os.path.exists(path):
            return
        
        # It must not already be in sys.path.
        if path in sys.path:
            return

        if self.index is not None:
            sys.path.insert(self.index, path)
            self.index += 1
        else:
            sys.path.append(path)
1247078
public PageRef setPath(Path newPath) {
		if(newPath.equals(path)) {
			return this;
		} else {
			return new PageRef(bookRef, newPath);
		}
	}
687023
def resolve_page(self, request, context, is_staff):
        """"""
        path = context['path']
        lang = context['lang']
        page = Page.objects.from_path(
            path, lang,
            exclude_drafts=(not is_staff))
        if page:
            return page
        # if the complete path didn't worked out properly
        # and if didn't used PAGE_USE_STRICT_URL setting we gonna
        # try to see if it might be a delegation page.
        # To do that we remove the right part of the url and try again
        # to find a page that match
        if not settings.PAGE_USE_STRICT_URL:
            path = remove_slug(path)
            while path is not None:
                page = Page.objects.from_path(
                    path, lang,
                    exclude_drafts=(not is_staff))
                # find a match. Is the page delegating?
                if page:
                    if page.delegate_to:
                        return page
                path = remove_slug(path)

        return None