idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
9,900
public function view ( ) { if ( $ this -> viewRequiresJqueryUI ( ) ) { $ this -> requireAsset ( 'jquery/ui' ) ; } $ this -> requireAsset ( 'css' , 'core/frontend/errors' ) ; if ( $ this -> displayCaptcha ) { $ this -> requireAsset ( 'css' , 'core/frontend/captcha' ) ; } }
and we have some block record things we need to check .
9,901
protected function questionVersioning ( $ data = [ ] ) { $ data += [ 'ignoreQuestionIDs' => '' , 'pendingDeleteIDs' => '' , ] ; $ db = Database :: connection ( ) ; $ oldBID = intval ( $ data [ 'bID' ] ) ; $ vals = [ intval ( $ data [ 'oldQsID' ] ) ] ; $ pendingQuestions = $ db -> getAll ( 'SELECT msqID FROM btFormQuest...
Ties the new or edited questions to the new block number . New and edited questions are temporarily given bID = 0 until the block is saved ... painfully complicated .
9,902
public static function incrementParents ( $ cID ) { $ db = Loader :: db ( ) ; $ cParentID = $ db -> GetOne ( "select cParentID from Pages where cID = ?" , array ( $ cID ) ) ; $ q = "update Pages set cChildren = cChildren+1 where cID = ?" ; $ cpc = Page :: getByID ( $ cParentID ) ; $ cpc -> refreshCache ( ) ; $ r = $ db...
For a particular page ID grabs all the pages of this page and increments the cTotalChildren number for them .
9,903
public static function decrementParents ( $ cID ) { $ db = Loader :: db ( ) ; $ cParentID = $ db -> GetOne ( "select cParentID from Pages where cID = ?" , array ( $ cID ) ) ; $ cChildren = $ db -> GetOne ( "select cChildren from Pages where cID = ?" , array ( $ cParentID ) ) ; -- $ cChildren ; if ( $ cChildren < 0 ) { ...
For a particular page ID grabs all the pages of this page and decrements the cTotalChildren number for them .
9,904
public static function getTotalPagesCreated ( $ date ) { $ db = Loader :: db ( ) ; $ num = $ db -> GetOne ( 'select count(Pages.cID) from Pages inner join Collections on Pages.cID = Collections.cID where cDateAdded >= ? and cDateAdded <= ? and siteTreeID > 0 and cIsTemplate = 0' , array ( $ date . ' 00:00:00' , $ date ...
Returns the total number of pages created for a given date .
9,905
public static function create ( $ handle , $ name , Package $ package = null ) { $ result = new static ( ) ; $ result -> setGeolocatorHandle ( $ handle ) -> setGeolocatorName ( $ name ) -> setGeolocatorDescription ( '' ) -> setGeolocatorConfiguration ( [ ] ) -> setGeolocatorPackage ( $ package ) -> setIsActive ( false ...
Create a new Geolocator instance .
9,906
public function getGeolocatorDisplayName ( $ format = 'html' ) { $ value = tc ( 'GeolocatorName' , $ this -> getGeolocatorName ( ) ) ; switch ( $ format ) { case 'html' : return h ( $ value ) ; case 'text' : default : return $ value ; } }
Get the Geolocator display name .
9,907
public function getGeolocatorDisplayDescription ( $ format = 'html' ) { $ value = tc ( 'GeolocatorDescription' , $ this -> getGeolocatorDescription ( ) ) ; switch ( $ format ) { case 'html' : return nl2br ( h ( $ value ) ) ; case 'text' : default : return $ value ; } }
Get the Geolocator display description .
9,908
public function getEntryAssociation ( Association $ association ) { $ id = $ association -> getId ( ) ; foreach ( $ this -> associations as $ entryAssociation ) { if ( $ entryAssociation -> getAssociation ( ) -> getId ( ) === $ id ) { return $ entryAssociation ; } } return null ; }
Get the EntryAssociation for a given association .
9,909
public function getFormElementPath ( ) { $ className = implode ( '' , array_slice ( explode ( '\\' , get_called_class ( ) ) , - 1 ) ) ; $ segment = substr ( $ className , 0 , strpos ( $ className , 'Style' ) ) ; $ element = uncamelcase ( $ segment ) ; $ env = Environment :: get ( ) ; return $ env -> getPath ( DIRNAME_E...
Returns a path to an elements directory for this Style . Might not be used by all styles .
9,910
public function getByOccurrenceID ( $ occurrenceID , $ retrieveVersion = EventService :: EVENT_VERSION_APPROVED ) { if ( $ retrieveVersion == EventService :: EVENT_VERSION_RECENT ) { $ query = $ this -> entityManager -> createQuery ( 'select vo from calendar:CalendarEventVersionOccurrence vo JOIN vo.version v JOIN v...
This code below retrieves based on the occurrence ID which can remain the same across versions .
9,911
public function noFollowHref ( $ input ) { return preg_replace_callback ( '/(?:<a(.*?href.*?)>)/i' , function ( $ matches ) { if ( strpos ( $ matches [ 1 ] , 'rel="nofollow"' ) === false ) { return '<a' . $ matches [ 1 ] . ' rel="nofollow">' ; } else { return $ matches [ 0 ] ; } } , $ input ) ; }
Takes in a string and adds rel = nofollow to any a tags that contain an href attribute .
9,912
public function finalizeScopes ( array $ scopes , $ grantType , ClientEntityInterface $ clientEntity , $ userIdentifier = null ) { $ app = Facade :: getFacadeApplication ( ) ; $ allowedScopes = $ app -> make ( 'config' ) -> get ( 'app.api.scopes' ) ; $ winnowed = [ ] ; foreach ( $ scopes as $ scope ) { if ( in_array ( ...
Given a client grant type and optional user identifier validate the set of scopes requested are valid and optionally append additional scopes or remove requested scopes .
9,913
private function add ( $ param , $ requireInstall = false , callable $ callback = null ) { if ( is_array ( $ param ) ) { foreach ( $ param as $ item ) { $ this -> add ( $ item , $ requireInstall , $ callback ) ; } return null ; } if ( $ requireInstall && ! $ this -> installed ( ) ) { return null ; } $ command = is_stri...
Add a class to the CLI application
9,914
private function installed ( ) { if ( $ this -> installed === null ) { $ this -> installed = $ this -> app -> isInstalled ( ) ; } return $ this -> installed ; }
Determine if the app is currently installed
9,915
public function registerClass ( $ alias , $ class ) { $ classSymbol = new ClassSymbol ( $ alias , $ class ) ; $ this -> classes [ $ alias ] = $ classSymbol ; $ aliasNamespace = $ classSymbol -> getAliasNamespace ( ) ; if ( ! in_array ( $ aliasNamespace , $ this -> aliasNamespaces , true ) ) { $ this -> aliasNamespaces ...
Register a class alias and store it in the classes array .
9,916
public function render ( $ eol = "\n" , $ padding = ' ' , $ methodFilter = null ) { $ lines = [ ] ; $ lines [ ] = '<?php' ; $ lines [ ] = '' ; $ lines [ ] = '// Generated on ' . date ( 'c' ) ; foreach ( $ this -> aliasNamespaces as $ namespace ) { $ lines [ ] = '' ; $ lines [ ] = rtrim ( "namespace {$namespace}" ) ;...
Render the classes .
9,917
public function required_password_upgrade ( ) { $ email = $ this -> post ( 'uEmail' ) ; $ token = $ this -> app -> make ( Token :: class ) ; $ this -> set ( 'token' , $ token ) ; if ( $ email ) { $ errorValidator = Core :: make ( 'helper/validation/error' ) ; $ userInfo = Core :: make ( 'Concrete\Core\User\UserInfoRepo...
Called when a user tries to log in after his password has been reset by Global Password Reset .
9,918
public function format ( $ mask , Entry $ entry ) { return $ this -> formatter -> format ( $ mask , function ( $ key ) use ( $ entry ) { if ( $ key === 'id' ) { return $ entry -> getID ( ) ; } $ attribute = $ entry -> getAttribute ( $ key ) ; if ( $ attribute ) { return $ attribute ; } $ association = $ entry -> getAss...
Format a mask given an entry
9,919
public static function getByName ( $ blockName ) { if ( ! $ blockName ) { return ; } $ app = Application :: getFacadeApplication ( ) ; $ now = $ app -> make ( 'date' ) -> getOverridableNow ( ) ; $ db = Loader :: db ( ) ; $ sql = <<<'EOT'SELECT b.bID, cvb.arHandle, cvb.cIDFROM Blocks AS b INNER JOIN Coll...
Get a block instance given its name .
9,920
public static function populateManually ( $ blockInfo , $ c , $ a ) { $ b = new self ( ) ; $ b -> setPropertiesFromArray ( $ blockInfo ) ; if ( is_object ( $ a ) ) { $ b -> a = $ a ; $ b -> arHandle = $ a -> getAreaHandle ( ) ; } else { if ( $ a != null ) { $ b -> arHandle = $ a ; } } $ b -> cID = $ c -> getCollectionI...
Initialize the instance by manually specifying the data .
9,921
public function getCollectionList ( ) { $ cArray = [ ] ; $ bID = $ this -> getBlockID ( ) ; if ( $ bID ) { $ db = Loader :: db ( ) ; $ q = 'select DISTINCT Pages.cID from CollectionVersionBlocks inner join Pages on (CollectionVersionBlocks.cID = Pages.cID) inner join CollectionVersions on (CollectionVersions.cID = Page...
Gets a list of collections that include this block along with area name etc ... used in the block_details . php page in the admin control panel .
9,922
public function setBlockCollectionObject ( $ c ) { $ this -> c = $ c ; $ this -> cID = $ c ? $ c -> getCollectionID ( ) : null ; }
Set the collection instance containing the block .
9,923
public function setBlockAreaObject ( & $ a ) { $ this -> a = $ a ; $ this -> arHandle = $ a ? $ a -> getAreaHandle ( ) : null ; }
Set the area containing the block .
9,924
public function setAbsoluteBlockDisplayOrder ( $ do ) { $ db = Loader :: db ( ) ; $ cID = $ this -> getBlockCollectionID ( ) ; $ bID = $ this -> getBlockID ( ) ; $ arHandle = $ this -> getAreaHandle ( ) ; $ c = $ this -> getBlockCollectionObject ( ) ; $ cvID = $ c -> getVersionID ( ) ; $ q = 'update CollectionVersionBl...
Set the absolute position of this block regardless other blocks in the same page & area .
9,925
public function isEditable ( ) { $ bv = new BlockView ( $ this ) ; $ path = $ bv -> getBlockPath ( FILENAME_BLOCK_EDIT ) ; if ( file_exists ( $ path . '/' . FILENAME_BLOCK_EDIT ) ) { return true ; } return false ; }
Does this block have an edit user interface?
9,926
public function deactivate ( ) { $ db = Loader :: db ( ) ; $ q = 'update Blocks set bIsActive = 0 where bID = ?' ; $ db -> query ( $ q , [ $ this -> getBlockID ( ) ] ) ; }
Deactivate the block .
9,927
public function activate ( ) { $ db = Loader :: db ( ) ; $ q = 'update Blocks set bIsActive = 1 where bID = ?' ; $ db -> query ( $ q , [ $ this -> getBlockID ( ) ] ) ; }
Activate the block .
9,928
public function isAlias ( $ c = null ) { if ( $ c ) { $ db = Loader :: db ( ) ; $ cID = $ c -> getCollectionID ( ) ; $ vo = $ c -> getVersionObject ( ) ; $ cvID = $ vo -> getVersionID ( ) ; $ q = 'select bID from CollectionVersionBlocks where bID = ? and cID=? and isOriginal = 0 and cvID = ?' ; $ r = $ db -> query ( $ ...
Check if this block instance is an alias .
9,929
public function getNumChildren ( ) { $ db = Loader :: db ( ) ; $ q = 'select count(*) as total from CollectionVersionBlocks where bID = ? and isOriginal = 0' ; $ total = $ db -> getOne ( $ q , [ $ this -> getBlockID ( ) ] ) ; return $ total ; }
Get the number of alias of this block .
9,930
public function isBlockInStack ( ) { $ co = $ this -> getBlockCollectionObject ( ) ; if ( is_object ( $ co ) ) { if ( $ co -> getPageTypeHandle ( ) == STACKS_PAGE_TYPE ) { return true ; } } return false ; }
Is this block inside a stack?
9,931
public function getCustomStyleSetID ( ) { $ db = Loader :: db ( ) ; if ( ! isset ( $ this -> issID ) ) { $ co = $ this -> getBlockCollectionObject ( ) ; $ arHandle = $ this -> getAreaHandle ( ) ; if ( $ arHandle ) { $ a = $ this -> getBlockAreaObject ( ) ; if ( $ a -> isGlobalArea ( ) ) { $ arHandle = STACKS_AREA_NAME ...
Get the ID of the custom style set .
9,932
public function getCustomStyle ( $ force = false ) { if ( $ this -> getCustomStyleSetID ( ) > 0 || $ force ) { $ csr = StyleSet :: getByID ( $ this -> getCustomStyleSetID ( ) ) ; $ theme = $ this -> c -> getCollectionThemeObject ( ) ; switch ( $ this -> getBlockTypeHandle ( ) ) { case BLOCK_HANDLE_LAYOUT_PROXY : $ bs =...
Get the custom style object associated to this block .
9,933
public function setCustomStyleSet ( \ Concrete \ Core \ Entity \ StyleCustomizer \ Inline \ StyleSet $ set ) { $ db = Loader :: db ( ) ; $ c = $ this -> getBlockCollectionObject ( ) ; $ cvID = $ c -> getVersionID ( ) ; $ db -> Replace ( 'CollectionVersionBlockStyles' , [ 'cID' => $ this -> getBlockCollectionID ( ) , 'c...
Set the block custom styles .
9,934
public function resetCustomStyle ( ) { $ db = Loader :: db ( ) ; $ c = $ this -> getBlockCollectionObject ( ) ; $ cvID = $ c -> getVersionID ( ) ; $ db -> Execute ( 'delete from CollectionVersionBlockStyles where cID = ? and cvID = ? and arHandle = ? and bID = ?' , [ $ this -> getBlockCollectionID ( ) , $ cvID , $ this...
Remove the block custom styles .
9,935
public function getBlockCacheSettingsObject ( ) { if ( $ this -> cacheSettings === null ) { $ this -> cacheSettings = CacheSettings :: get ( $ this ) ; } return $ this -> cacheSettings ; }
Get the cache settings instance .
9,936
public function setCustomCacheSettings ( $ enabled , $ enabledOnPost , $ enabledForRegistered , $ lifetime ) { $ db = Loader :: db ( ) ; $ c = $ this -> getBlockCollectionObject ( ) ; $ cvID = $ c -> getVersionID ( ) ; $ enabled = ( bool ) $ enabled ; $ enabledOnPost = ( bool ) $ enabledOnPost ; $ enabledForRegistered ...
Customize the cache settings overriding the values of the block type controller .
9,937
public function resetCustomCacheSettings ( ) { $ db = Loader :: db ( ) ; $ c = $ this -> getBlockCollectionObject ( ) ; $ cvID = $ c -> getVersionID ( ) ; $ db -> update ( 'CollectionVersionBlocks' , [ 'cbOverrideBlockTypeCacheSettings' => 0 ] , [ 'cID' => $ this -> getBlockCollectionID ( ) , 'cvID' => $ cvID , 'arHand...
Reset the cache settings so that concrete5 will use the values of the block type controller .
9,938
public function setBlockCachedOutput ( $ content , $ lifetime , $ area ) { $ db = Loader :: db ( ) ; $ c = $ this -> getBlockCollectionObject ( ) ; $ btCachedBlockOutputExpires = strtotime ( '+5 years' ) ; if ( $ lifetime > 0 ) { $ btCachedBlockOutputExpires = time ( ) + $ lifetime ; } $ arHandle = $ this -> getAreaHan...
Set the output cache .
9,939
public function refreshBlockOutputCache ( ) { $ db = Loader :: db ( ) ; $ cID = $ this -> getBlockCollectionID ( ) ; $ bID = $ this -> getBlockID ( ) ; $ c = $ this -> getBlockCollectionObject ( ) ; $ v = [ $ c -> getCollectionID ( ) , $ c -> getVersionID ( ) , $ this -> getAreaHandle ( ) , $ bID ] ; $ db -> Execute ( ...
Mark the output cache as expired .
9,940
public function refreshBlockRecordCache ( ) { $ app = Application :: getFacadeApplication ( ) ; $ db = $ app -> make ( Connection :: class ) ; $ db -> executeQuery ( 'UPDATE Blocks SET btCachedBlockRecord = NULL WHERE bID = ?' , [ $ this -> getBlockID ( ) , ] ) ; }
Refreshes the block record cache
9,941
public function overrideAreaPermissions ( ) { if ( ! isset ( $ this -> cbOverrideAreaPermissions ) || ! $ this -> cbOverrideAreaPermissions ) { $ this -> cbOverrideAreaPermissions = 0 ; } return $ this -> cbOverrideAreaPermissions ; }
Area permissions are overridden?
9,942
public function revertToAreaPermissions ( ) { $ c = $ this -> getBlockCollectionObject ( ) ; $ db = Loader :: db ( ) ; $ v = [ $ c -> getCollectionID ( ) , $ c -> getVersionID ( ) , $ this -> getBlockID ( ) ] ; $ db -> query ( 'delete from BlockPermissionAssignments where cID = ? and cvID = ? and bID = ?' , $ v ) ; $ v...
Revert the permission of the object to the one of the area that contains the block .
9,943
public function ignorePageThemeGridFrameworkContainer ( ) { if ( $ this -> overrideBlockTypeContainerSettings ( ) ) { return ! $ this -> enableBlockContainer ( ) ; } $ controller = $ this -> getController ( ) ; return $ controller -> ignorePageThemeGridFrameworkContainer ( ) ; }
Should the view ignore the grid container?
9,944
public function overrideBlockTypeContainerSettings ( ) { if ( ! isset ( $ this -> cbOverrideBlockTypeContainerSettings ) || ! $ this -> cbOverrideBlockTypeContainerSettings ) { $ this -> cbOverrideBlockTypeContainerSettings = 0 ; } return $ this -> cbOverrideBlockTypeContainerSettings ; }
Should this instance override the grid container settings of the block controller?
9,945
public function getController ( ) { if ( Config :: get ( 'concrete.cache.blocks' ) && isset ( $ this -> instance ) && $ this -> instance -> cacheBlockRecord ( ) && is_object ( $ this -> instance -> getBlockControllerData ( ) ) ) { $ this -> instance -> __construct ( ) ; } else { $ bt = $ this -> getBlockTypeObject ( ) ...
Get the block type controller .
9,946
public function display ( $ view = 'view' ) { if ( $ this -> getBlockTypeID ( ) < 1 ) { return ; } $ bv = new BlockView ( $ this ) ; $ bv -> render ( $ view ) ; }
Render the block display .
9,947
public function update ( $ data ) { $ db = Loader :: db ( ) ; $ dh = Loader :: helper ( 'date' ) ; $ bDateModified = $ dh -> getOverridableNow ( ) ; $ bID = $ this -> getBlockID ( ) ; $ v = [ $ bDateModified , $ bID ] ; $ q = 'update Blocks set bDateModified = ? where bID = ?' ; $ r = $ db -> prepare ( $ q ) ; $ res = ...
Updates fields common to every block .
9,948
public function updateBlockInformation ( $ data ) { $ db = Loader :: db ( ) ; $ dh = Loader :: helper ( 'date' ) ; $ dt = $ dh -> getOverridableNow ( ) ; $ bName = $ this -> getBlockName ( ) ; $ bFilename = $ this -> getBlockFilename ( ) ; if ( isset ( $ data [ 'bName' ] ) ) { $ bName = $ data [ 'bName' ] ; } if ( isse...
Update the block information like its block filename and block name .
9,949
public function alias ( $ c ) { $ app = Application :: getFacadeApplication ( ) ; $ cloner = $ app -> make ( Cloner :: class ) ; $ cloner -> cloneBlock ( $ this , $ c ) ; }
Create an alias of the block attached to this collection within the CollectionVersionBlocks table . Additionally this command grabs the permissions from the original record in the CollectionVersionBlocks table and attaches them to the new one .
9,950
public function export ( $ node , $ exportType = 'full' ) { if ( ! $ this -> isAliasOfMasterCollection ( ) || ( ( $ this -> c instanceof Page ) && $ this -> c -> isMasterCollection ( ) ) ) { $ blockNode = $ node -> addChild ( 'block' ) ; $ blockNode -> addAttribute ( 'type' , $ this -> getBlockTypeHandle ( ) ) ; $ bloc...
Export the data associated to this block to an XML node .
9,951
public function queueForDefaultsUpdate ( $ data , $ queue , $ includeThisBlock = true ) { $ blocks = [ ] ; $ db = \ Database :: connection ( ) ; $ rows = $ db -> GetAll ( 'select cID, max(cvID) as cvID, cbRelationID from CollectionVersionBlocks where cbRelationID = ? group by cID order by cID' , [ $ this -> getBlockRel...
Populate the queue to be used to work on the block and it aliases .
9,952
public function refreshCache ( ) { $ app = Facade :: getFacadeApplication ( ) ; $ cache = $ app -> make ( 'cache/request' ) ; if ( $ cache -> isEnabled ( ) ) { $ cache -> delete ( 'page/' . $ this -> getCollectionID ( ) ) ; } }
Clear the cache for this collection .
9,953
public static function get ( $ c , $ cvID ) { $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; $ now = $ app -> make ( 'date' ) -> getOverridableNow ( ) ; $ cID = false ; if ( $ c instanceof \ Concrete \ Core \ Page \ Page ) { $ cID = $ c -> getCollectionPointerID ( )...
Get a Version instance given the Collection and a version identifier .
9,954
public function isApprovedNow ( $ when = null ) { if ( ! $ this -> isApproved ( ) ) { return false ; } $ start = $ this -> getPublishDate ( ) ; $ end = $ this -> getPublishEndDate ( ) ; if ( ! $ start && ! $ end ) { return true ; } $ dh = Facade :: getFacadeApplication ( ) -> make ( 'date' ) ; if ( $ when ) { $ when = ...
Is this version approved and in the publish interval?
9,955
public function isMostRecent ( ) { if ( ! isset ( $ this -> isMostRecent ) ) { $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; $ cvID = $ db -> fetchColumn ( 'select cvID from CollectionVersions where cID = ? order by cvID desc' , array ( $ this -> cID ) ) ; $ this -...
Is this the most recent version?
9,956
public function getCustomAreaStyles ( ) { if ( ! isset ( $ this -> customAreaStyles ) ) { $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; $ r = $ db -> fetchAll ( 'select issID, arHandle from CollectionVersionAreaStyles where cID = ? and cvID = ?' , array ( $ this ->...
Get the custom area style IDs .
9,957
public function setComment ( $ comment ) { $ thisCVID = $ this -> getVersionID ( ) ; $ comment = ( $ comment != null ) ? $ comment : "Version {$thisCVID}" ; $ v = array ( $ comment , $ thisCVID , $ this -> cID , ) ; $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; $ q...
Set the collection version comments .
9,958
public function createNew ( $ versionComments ) { $ app = Facade :: getFacadeApplication ( ) ; $ cloner = $ app -> make ( Cloner :: class ) ; $ clonerOptions = $ app -> build ( ClonerOptions :: class ) -> setCopyContents ( false ) -> setVersionComments ( $ versionComments ) ; $ myCollection = Page :: getByID ( $ this -...
Create a new version for the same collection as this collection version .
9,959
public function discard ( ) { if ( $ this -> isNew ( ) ) { $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; $ r = $ db -> executeQuery ( 'select cRelationID, cvRelationID from CollectionVersionRelatedEdits where cID = ? and cvID = ?' , array ( $ this -> cID , $ this -...
Discard my most recent edit that is pending .
9,960
public function canDiscard ( ) { $ result = false ; if ( $ this -> isNew ( ) ) { $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; $ total = $ db -> fetchColumn ( 'select count(cvID) from CollectionVersions where cID = ?' , array ( $ this -> cID , ) ) ; if ( $ total > ...
Check if this collection version can be discarded .
9,961
public function removeNewStatus ( ) { $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; $ db -> executeQuery ( "update CollectionVersions set cvIsNew = 0 where cID = ? and cvID = ?" , array ( $ this -> cID , $ this -> cvID , ) ) ; $ this -> refreshCache ( ) ; }
Mark this collection version as not new .
9,962
public function deny ( ) { $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; $ cvID = $ this -> cvID ; $ cID = $ this -> cID ; $ dh = $ app -> make ( 'helper/date' ) ; $ db -> executeQuery ( 'update Collections set cDateModified = ? where cID = ?' , array ( $ dh -> get...
Mark this collection version as not approved .
9,963
public function getSitemapGenerator ( ) { if ( $ this -> sitemapGenerator === null ) { $ this -> sitemapGenerator = $ this -> app -> make ( SitemapGenerator :: class ) ; } return $ this -> sitemapGenerator ; }
Get the SitemapGenerator instance to be used .
9,964
public function getOutputFilename ( ) { $ result = $ this -> outputFilename ; if ( $ result === '' ) { $ config = $ this -> app -> make ( 'config' ) ; $ relativeName = '/' . ltrim ( str_replace ( DIRECTORY_SEPARATOR , '/' , ( string ) $ config -> get ( 'concrete.sitemap_xml.file' ) ) , '/' ) ; if ( $ relativeName === '...
Get the path to the sitemap to be generated .
9,965
public function getSitemapUrl ( ) { $ outputFilename = $ this -> getOutputFilename ( ) ; if ( strpos ( $ outputFilename , DIR_BASE . '/' ) === 0 ) { $ result = ( string ) $ this -> getSitemapGenerator ( ) -> resolveUrl ( [ substr ( $ outputFilename , strlen ( DIR_BASE ) ) ] ) ; } else { $ result = '' ; } return $ resul...
Get the URL of the sitemap corresponding to the output file name .
9,966
protected function getTemporaryDirectory ( ) { $ result = $ this -> temporaryDirectory ; if ( $ result === '' ) { $ fileHelper = $ this -> app -> make ( 'helper/file' ) ; $ temporaryDirectory = ( string ) $ fileHelper -> getTemporaryDirectory ( ) ; if ( $ temporaryDirectory === '' || ! $ this -> filesystem -> isDirecto...
Get the temporary directory to be used during the sitemap generation .
9,967
public function getEntryDisplayName ( AssociationControl $ control , Entry $ entry ) { $ formatter = $ this -> getEntryFormatter ( ) ; $ name = null ; if ( $ mask = $ control -> getAssociationEntityLabelMask ( ) ) { $ name = $ formatter -> format ( $ mask , $ entry ) ; } $ name = $ entry -> getLabel ( ) ; if ( $ name =...
Get the display label for an entry
9,968
protected function getEntryFormatter ( ) { if ( ! $ this -> entryFormatter ) { $ this -> entryFormatter = Application :: getFacadeApplication ( ) -> make ( EntryFormatterInterface :: class ) ; } return $ this -> entryFormatter ; }
Get the entry formatter to use
9,969
public function getDriver ( ) { $ annotationDriver = new AnnotationDriver ( $ this -> app -> make ( 'orm/cachedAnnotationReader' ) , [ DIR_BASE_CORE . '/' . DIRNAME_CLASSES . '/' . DIRNAME_ENTITIES , ] ) ; return $ annotationDriver ; }
Get the AnnotationDriver
9,970
public static function getList ( $ sorted = false , $ activeOnly = false ) { $ list = [ ] ; $ db = Loader :: db ( ) ; $ q = $ db -> query ( 'SELECT * FROM AuthenticationTypes' . ( $ activeOnly ? ' WHERE authTypeIsEnabled=1 ' : '' ) . ' ORDER BY ' . ( $ sorted ? 'authTypeDisplayOrder' : 'authTypeID' ) ) ; while ( $ row ...
Return a raw list of authentication types .
9,971
public static function load ( $ arr ) { $ extract = [ 'authTypeID' , 'authTypeName' , 'authTypeHandle' , 'authTypeDisplayOrder' , 'authTypeIsEnabled' , 'pkgID' , ] ; $ obj = new self ( ) ; foreach ( $ extract as $ key ) { if ( ! isset ( $ arr [ $ key ] ) ) { return false ; } $ obj -> { $ key } = $ arr [ $ key ] ; } $ o...
Load an AuthenticationType from an array .
9,972
protected function loadController ( ) { $ env = Environment :: get ( ) ; $ r = $ env -> getRecord ( DIRNAME_AUTHENTICATION . '/' . $ this -> authTypeHandle . '/' . FILENAME_CONTROLLER ) ; $ prefix = $ r -> override ? true : $ this -> getPackageHandle ( ) ; $ authTypeHandle = Core :: make ( 'helper/text' ) -> camelcase ...
Load the AuthenticationTypeController into the AuthenticationType .
9,973
public static function getByHandle ( $ atHandle ) { $ db = Loader :: db ( ) ; $ row = $ db -> GetRow ( 'SELECT * FROM AuthenticationTypes WHERE authTypeHandle=?' , [ $ atHandle ] ) ; if ( ! $ row ) { throw new Exception ( t ( 'Invalid Authentication Type Handle' ) ) ; } $ at = self :: load ( $ row ) ; return $ at ; }
Return loaded AuthenticationType with the given handle .
9,974
public static function getByID ( $ authTypeID ) { $ db = Loader :: db ( ) ; $ row = $ db -> GetRow ( 'SELECT * FROM AuthenticationTypes where authTypeID=?' , [ $ authTypeID ] ) ; if ( ! $ row ) { throw new Exception ( t ( 'Invalid Authentication Type ID' ) ) ; } $ at = self :: load ( $ row ) ; $ at -> loadController ( ...
Return loaded AuthenticationType with the given ID .
9,975
public function setAuthenticationTypeName ( $ authTypeName ) { $ db = Loader :: db ( ) ; $ db -> Execute ( 'UPDATE AuthenticationTypes SET authTypeName=? WHERE authTypeID=?' , [ $ authTypeName , $ this -> getAuthenticationTypeID ( ) ] ) ; }
Update the name .
9,976
public function getAuthenticationTypeFilePath ( $ _file ) { $ f = $ this -> mapAuthenticationTypeFilePath ( $ _file ) ; if ( $ f -> exists ( ) ) { return $ f -> url ; } return false ; }
Return the path to a file .
9,977
public function renderForm ( $ element = 'form' , $ params = [ ] ) { $ this -> controller -> requireAsset ( 'javascript' , 'backstretch' ) ; $ form_element = $ this -> mapAuthenticationTypeFilePath ( $ element . '.php' ) ; if ( ! $ form_element -> exists ( ) ) { $ form_element = $ this -> mapAuthenticationTypeFilePath ...
Render the login form for this authentication type .
9,978
public function renderHook ( ) { $ form_hook = $ this -> mapAuthenticationTypeFilePath ( 'hook.php' ) ; if ( method_exists ( $ this -> controller , 'hook' ) || $ form_hook -> exists ( ) ) { ob_start ( ) ; if ( method_exists ( $ this -> controller , 'hook' ) ) { $ this -> controller -> hook ( ) ; } if ( $ form_hook -> e...
Render the hook form for saving the profile settings . All settings are expected to be saved by each individual authentication type .
9,979
public function renderHooked ( ) { $ form_hooked = $ this -> mapAuthenticationTypeFilePath ( 'hooked.php' ) ; if ( method_exists ( $ this -> controller , 'hooked' ) || $ form_hooked -> exists ( ) ) { ob_start ( ) ; if ( method_exists ( $ this -> controller , 'hooked' ) ) { $ this -> controller -> hooked ( ) ; } if ( $ ...
Render the a form to be displayed when the authentication type is already hooked . All settings are expected to be saved by each individual authentication type .
9,980
public function isHooked ( $ user ) { $ result = null ; if ( is_callable ( [ $ this -> controller , 'getBindingForUser' ] ) ) { $ result = $ this -> controller -> getBindingForUser ( $ user ) !== null ; } else { $ result = null ; } return $ result ; }
Is this authentication type already hooked for a specific user?
9,981
public function save ( ) { $ em = Application :: getFacadeApplication ( ) -> make ( EntityManagerInterface :: class ) ; $ em -> persist ( $ this ) ; $ em -> flush ( ) ; }
Save this instance to the database .
9,982
public function getDriver ( ) { $ config = $ this -> config ; if ( $ this -> isLegacy ( ) ) { $ appEntityPath = DIR_APPLICATION . '/' . DIRNAME_CLASSES ; $ reader = $ this -> app -> make ( 'orm/cachedSimpleAnnotationReader' ) ; } else { $ appEntityPath = DIR_APPLICATION . '/' . DIRNAME_CLASSES . '/' . DIRNAME_ENTITIES ...
Return the correct MappingDriver base on the application config
9,983
public function isNativeCommandAvailable ( $ command ) { switch ( $ command ) { case 'zip' : case 'unzip' : break ; default : return false ; } if ( ! isset ( $ this -> availableNativeCommands [ $ command ] ) ) { $ this -> availableNativeCommands [ $ command ] = false ; if ( $ this -> functionInspector -> functionAvaila...
Check if a native command is available .
9,984
public function unzip ( $ zipFile , $ destinationDirectory , array $ options = [ ] ) { $ fs = $ this -> getFilesystem ( ) ; $ normalized = @ realpath ( $ zipFile ) ; if ( $ normalized === false || ! $ fs -> isFile ( $ normalized ) ) { throw new Exception ( t ( 'Unable to find the ZIP file %s' , $ zipFile ) ) ; } $ zipF...
Decompress a ZIP archive to a directory .
9,985
public function zip ( $ sourceDirectory , $ zipFile , array $ options = [ ] ) { $ fs = $ this -> getFilesystem ( ) ; $ normalized = @ realpath ( $ sourceDirectory ) ; if ( $ normalized === false || ! $ fs -> isDirectory ( $ normalized ) ) { throw new Exception ( t ( 'Unable to find the directory %s' , $ sourceDirectory...
Compress the contents of a directory to a ZIP archive .
9,986
public function listContents ( $ zipFile , array $ options = [ ] ) { $ fs = $ this -> getFilesystem ( ) ; if ( ! $ fs -> isFile ( $ zipFile ) ) { throw new Exception ( t ( 'Unable to find the ZIP file %s' , $ zipFile ) ) ; } $ options += [ 'skipCheck' => false , 'excludeDirs' => false , 'excludeFiles' => false , ] ; $ ...
List the contents of a ZIP archive .
9,987
protected function unzipNative ( $ zipFile , $ destinationDirectory , array $ options ) { $ cmd = 'unzip' ; $ cmd .= ' -o' ; $ cmd .= ' -q' ; $ cmd .= ' ' . escapeshellarg ( str_replace ( '/' , DIRECTORY_SEPARATOR , $ zipFile ) ) ; $ cmd .= ' -d ' . escapeshellarg ( str_replace ( '/' , DIRECTORY_SEPARATOR , $ destinati...
Decompress a ZIP archive to a directory using the native unzip command .
9,988
protected function unzipPHP ( $ zipFile , $ destinationDirectory , array $ options ) { if ( ! class_exists ( 'ZipArchive' ) ) { throw new Exception ( 'Unable to unzip files using ZipArchive. Please ensure the Zip extension is installed.' ) ; } $ zip = new ZipArchive ( ) ; try { $ flags = 0 ; if ( ! $ options [ 'skipChe...
Decompress a ZIP archive to a directory using the PHP functions .
9,989
protected function zipPHP ( $ sourceDirectory , $ zipFile , array $ options ) { if ( ! class_exists ( 'ZipArchive' ) ) { throw new Exception ( 'Unable to zip files using ZipArchive. Please ensure the Zip extension is installed.' ) ; } $ zip = new ZipArchive ( ) ; try { $ flags = ZipArchive :: CREATE ; if ( ! $ options ...
Compress the contents of a directory to a ZIP archive using the PHP functions .
9,990
protected function getFilenameForMutexKey ( $ mutexKey ) { $ mutexKeyString = ( is_string ( $ mutexKey ) || is_int ( $ mutexKey ) ) ? ( string ) $ mutexKey : '' ; if ( $ mutexKeyString === '' ) { throw new InvalidMutexKeyException ( $ mutexKey ) ; } if ( preg_match ( '/^[a-zA-Z0-9_\-]{1,50}$/' , $ mutexKeyString ) ) { ...
Get the full path of a temporary file that s unique for the concrete5 application and for the specified mutex key .
9,991
public function filterByTag ( $ tag = '' ) { $ db = Loader :: db ( ) ; $ this -> filter ( false , "( fv.fvTags like " . $ db -> qstr ( "%\n" . $ tag . "\n%" ) . " )" ) ; }
Filters by tag .
9,992
public function get ( $ itemsToGet = 0 , $ offset = 0 ) { $ files = array ( ) ; $ this -> createQuery ( ) ; $ r = parent :: get ( $ itemsToGet , $ offset ) ; foreach ( $ r as $ row ) { $ f = ConcreteFile :: getByID ( $ row [ 'fID' ] ) ; $ files [ ] = $ f ; } return $ files ; }
Returns an array of file objects based on current settings .
9,993
public function register ( $ plugin , $ name = null ) { if ( $ plugin instanceof Plugin ) { $ key = $ plugin -> getKey ( ) ; $ p = $ plugin ; } else { if ( ! $ name ) { throw new Exception ( t ( 'You must specify a plugin key and name.' ) ) ; } $ key = $ plugin ; $ p = new Plugin ( ) ; $ p -> setKey ( $ key ) ; $ p -> ...
Register a new plugin adding it to the list of available plugins .
9,994
public function load_starting ( ) { $ node = $ this -> loadNode ( ) ; $ r = array ( ) ; foreach ( $ node -> getChildNodes ( ) as $ childnode ) { $ json = $ childnode -> getTreeNodeJSON ( ) ; if ( $ json ) { $ r [ ] = $ json ; } } $ node = $ node -> getTreeNodeJSON ( ) ; $ node -> children = $ r ; return new JsonRespons...
This endpoint is meant to be called when we are starting from a particular spot in the tree . It will include the current node and the children while normally loading the node will only return the children .
9,995
public function load ( ) { $ node = $ this -> loadNode ( ) ; $ r = array ( ) ; foreach ( $ node -> getChildNodes ( ) as $ childnode ) { $ json = $ childnode -> getTreeNodeJSON ( ) ; if ( $ json ) { $ r [ ] = $ json ; } } return new JsonResponse ( $ r ) ; }
Returns the child nodes of the current node .
9,996
public function process ( Request $ request , DelegateInterface $ frame ) { \ Concrete \ Core \ Http \ Request :: setInstance ( $ request ) ; $ this -> app -> instance ( 'Concrete\Core\Http\Request' , $ request ) ; return $ frame -> next ( $ request ) ; }
Apply the request instance to the request singleton
9,997
public function filterByAssignable ( ) { if ( Config :: get ( 'concrete.permissions.model' ) != 'simple' ) { $ excludeGroupIDs = [ GUEST_GROUP_ID , REGISTERED_GROUP_ID ] ; $ db = Loader :: db ( ) ; $ r = $ db -> executeQuery ( 'select gID from ' . $ db -> getDatabasePlatform ( ) -> quoteSingleIdentifier ( 'Groups' ) . ...
Only return groups the user has the ability to assign .
9,998
public function hasError ( ) { $ error = $ this -> getError ( ) ; if ( $ error instanceof ErrorList ) { return $ error -> has ( ) ; } if ( $ error instanceof Exception ) { return true ; } return ( string ) $ error !== '' ; }
Does this response contain an error?
9,999
public function getBaseJSONObject ( ) { $ o = new stdClass ( ) ; $ error = $ this -> getError ( ) ; if ( $ error instanceof Exception ) { $ o -> error = true ; $ o -> errors = [ $ error -> getMessage ( ) ] ; } elseif ( $ error instanceof ErrorList && $ error -> has ( ) ) { $ o -> error = true ; $ o -> errors = [ ] ; fo...
Get an stdClass instance containing the serialized data of this instance .