concrete/src/Page/Single.php
public static function addGlobal($cPath, $pkg = null)
    {
        $pathToFile = static::getPathToNode($cPath, $pkg);
        $txt = Loader::helper('text');
        $c = CorePage::getByPath($cPath);
        if ($c->isError() && $c->getError() == COLLECTION_NOT_FOUND) {
            // create the page at that point in the tree

            $data = array();
            $data['handle'] = trim($cPath, '/');
            $data['name'] = $txt->unhandle($data['handle']);
            $data['filename'] = $pathToFile;
            $data['uID'] = USER_SUPER_ID;
            if ($pkg != null) {
                $data['pkgID'] = $pkg->getPackageID();
            }

            $c = Page::addStatic($data, null);
            $c->moveToRoot();
            return $c;
        }
    }
public static function addGlobal($cPath, $pkg = null)
    {
        $pathToFile = static::getPathToNode($cPath, $pkg);
        $txt = Loader::helper('text');
        $c = CorePage::getByPath($cPath);
        if ($c->isError() && $c->getError() == COLLECTION_NOT_FOUND) {
            // create the page at that point in the tree

            $data = array();
            $data['handle'] = trim($cPath, '/');
            $data['name'] = $txt->unhandle($data['handle']);
            $data['filename'] = $pathToFile;
            $data['uID'] = USER_SUPER_ID;
            if ($pkg != null) {
                $data['pkgID'] = $pkg->getPackageID();
            }

            $c = Page::addStatic($data, null);
            $c->moveToRoot();
            return $c;
        }
    }
public static function addGlobal ( $ cPath , $ pkg = null ) { $ pathToFile = static :: getPathToNode ( $ cPath , $ pkg ) ; $ txt = Loader :: helper ( 'text' ) ; $ c = CorePage :: getByPath ( $ cPath ) ; if ( $ c -> isError ( ) && $ c -> getError ( ) == COLLECTION_NOT_FOUND ) { // create the page at that point in the tree $ data = array ( ) ; $ data [ 'handle' ] = trim ( $ cPath , '/' ) ; $ data [ 'name' ] = $ txt -> unhandle ( $ data [ 'handle' ] ) ; $ data [ 'filename' ] = $ pathToFile ; $ data [ 'uID' ] = USER_SUPER_ID ; if ( $ pkg != null ) { $ data [ 'pkgID' ] = $ pkg -> getPackageID ( ) ; } $ c = Page :: addStatic ( $ data , null ) ; $ c -> moveToRoot ( ) ; return $ c ; } }
Adds a single page outside of any site trees. The global=true declaration in content importer XML must come at
on the first URL segment, so we don't have to be smart and check to see if the parents already eixst.
@param $cPath
@param null $pkg
@return mixed
Adds a single page outside of any site trees . The global = true declaration in content importer XML must come at on the first URL segment so we don t have to be smart and check to see if the parents already eixst .