idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
1,300 | protected function renderCTypeShortcut ( PageLayoutView $ parentObject , & $ row ) { $ shortcutContent = '' ; if ( $ row [ 'records' ] ) { $ shortcutItems = explode ( ',' , $ row [ 'records' ] ) ; $ collectedItems = [ ] ; foreach ( $ shortcutItems as $ shortcutItem ) { $ shortcutItem = trim ( $ shortcutItem ) ; if ( st... | renders the HTML output for elements of the CType shortcut |
1,301 | protected function collectContentDataFromPages ( $ shortcutItem , & $ collectedItems , $ recursive = 0 , $ parentUid = 0 , $ language = 0 ) { $ itemList = str_replace ( 'pages_' , '' , $ shortcutItem ) ; if ( $ recursive ) { if ( ! $ this -> tree instanceof QueryGenerator ) { $ this -> tree = GeneralUtility :: makeInst... | Collects tt_content data from a single page or a page tree starting at a given page |
1,302 | public function contentCollapseIcon ( array & $ data , $ sortField , $ level , & $ contentCollapseIcon , DatabaseRecordListXclass $ parentObj ) { if ( $ data [ '_EXPAND_TABLE_' ] === 'tt_content' ) { $ expandTitle = $ this -> languageService -> sL ( 'LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xlf:list... | return content collapse icon |
1,303 | public function checkForAllowedLanguages ( array & $ items , $ gridContainerId ) { if ( ! $ gridContainerId ) { return ; } $ parentContainer = BackendUtility :: getRecordWSOL ( 'tt_content' , $ gridContainerId ) ; if ( ! empty ( $ items ) && ( int ) $ parentContainer [ 'uid' ] > 0 ) { foreach ( $ items as $ item => $ v... | Checks if a language is allowed in this particular container - only this one container defines the allowed languages regardless of any parent |
1,304 | public function columnsItemsProcFunc ( array & $ params ) { $ this -> init ( $ params [ 'row' ] [ 'pid' ] ) ; $ gridContainerId = is_array ( $ params [ 'row' ] [ 'tx_gridelements_container' ] ) ? ( int ) $ params [ 'row' ] [ 'tx_gridelements_container' ] [ 0 ] : ( int ) $ params [ 'row' ] [ 'tx_gridelements_container' ... | ItemProcFunc for columns items |
1,305 | public function containerItemsProcFunc ( array & $ params ) { $ this -> init ( $ params [ 'row' ] [ 'pid' ] ) ; $ possibleContainers = [ ] ; $ this -> removeItemsFromListOfSelectableContainers ( $ params , $ possibleContainers ) ; if ( ! empty ( $ possibleContainers ) ) { $ params [ 'items' ] = array_merge ( $ params [... | ItemProcFunc for container items removes items of the children chain from the list of selectable containers if the element itself already is a container |
1,306 | public function removeItemsFromListOfSelectableContainers ( array & $ params , array & $ possibleContainers ) { $ contentType = is_array ( $ params [ 'row' ] [ 'CType' ] ) ? $ params [ 'row' ] [ 'CType' ] [ 0 ] : $ params [ 'row' ] [ 'CType' ] ; if ( $ contentType === 'gridelements_pi1' && count ( $ params [ 'items' ] ... | removes items of the children chain from the list of selectable containers |
1,307 | public function lookForChildContainersRecursively ( $ containerIds , array & $ possibleContainers ) { if ( ! $ containerIds ) { return ; } $ containerIds = GeneralUtility :: intExplode ( ',' , $ containerIds ) ; $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ childrenOnNextLevel = $ queryBuilder -> select ( 'uid' , ... | Recursive function to remove any container from the list of possible containers that is already a subcontainer on any level of the current container |
1,308 | public function layoutItemsProcFunc ( array & $ params ) { $ this -> init ( $ params [ 'row' ] [ 'pid' ] ) ; $ layoutSelectItems = $ this -> layoutSetup -> getLayoutSelectItems ( isset ( $ params [ 'row' ] [ 'colPos' ] [ 0 ] ) ? $ params [ 'row' ] [ 'colPos' ] [ 0 ] : $ params [ 'row' ] [ 'colPos' ] , $ params [ 'row' ... | ItemProcFunc for layout items removes items that are available for grid boxes on the first level only and items that are excluded for a certain branch or user |
1,309 | public function init ( $ pageId , array $ typoScriptSetup = [ ] ) { $ this -> setLanguageService ( $ GLOBALS [ 'LANG' ] ) ; $ pageId = ( strpos ( $ pageId , 'NEW' ) === 0 ) ? 0 : ( int ) $ pageId ; if ( ( int ) $ pageId < 0 ) { $ pageId = Helper :: getInstance ( ) -> getPidFromUid ( $ pageId ) ; } $ this -> realPid = $... | Load page TSconfig |
1,310 | public function getLayoutColumns ( $ layoutId ) { if ( ! isset ( $ this -> layoutSetup [ $ layoutId ] ) ) { return [ ] ; } if ( empty ( $ GLOBALS [ 'tx_gridelements' ] [ 'ceBackendLayoutData' ] [ $ layoutId ] ) ) { if ( ! empty ( $ this -> layoutSetup [ $ layoutId ] [ 'config' ] [ 'rows.' ] ) ) { $ GLOBALS [ 'tx_gridel... | fetches all available columns for a certain grid container |
1,311 | public function getTypoScriptSetup ( $ layoutId ) { $ typoScriptSetup = [ ] ; if ( $ layoutId == '0' && isset ( $ this -> typoScriptSetup [ 'setup.' ] [ 'default.' ] ) ) { $ typoScriptSetup = $ this -> typoScriptSetup [ 'setup.' ] [ 'default.' ] ; } elseif ( $ layoutId && isset ( $ this -> typoScriptSetup [ 'setup.' ] ... | fetches the setup for each of the columns assigns a default setup if there is none available |
1,312 | public function getLayoutSelectItems ( $ colPos , $ gridColPos = 0 , $ containerId = 0 , $ pageId = 0 ) { $ allowed = [ '*' => '*' ] ; $ disallowed = [ ] ; $ selectItems = [ ] ; if ( $ containerId > 0 ) { $ container = $ this -> cacheCurrentParent ( ( int ) $ containerId , true ) ; if ( ! empty ( $ container ) ) { $ co... | Returns the item array for form field selection . |
1,313 | public function cacheCurrentParent ( $ gridContainerId = 0 , $ doReturn = false ) { if ( $ gridContainerId > 0 ) { if ( empty ( $ GLOBALS [ 'tx_gridelements' ] [ 'parentElement' ] [ $ gridContainerId ] ) ) { $ GLOBALS [ 'tx_gridelements' ] [ 'parentElement' ] [ $ gridContainerId ] = BackendUtility :: getRecordWSOL ( 't... | Caches Container - Records and their setup to avoid multiple selects of the same record during a single request |
1,314 | public function getLayoutSetup ( $ layoutId = '' ) { if ( isset ( $ this -> layoutSetup [ $ layoutId ] ) ) { return $ this -> layoutSetup [ $ layoutId ] ; } return $ this -> layoutSetup ; } | Returns the grid layout setup |
1,315 | public function getFlexformConfiguration ( $ layoutId ) { $ layoutSetup = $ this -> getLayoutSetup ( $ layoutId ) ; if ( $ layoutSetup [ 'pi_flexform_ds_file' ] ) { $ flexformConfiguration = GeneralUtility :: getUrl ( GeneralUtility :: getFileAbsFileName ( $ layoutSetup [ 'pi_flexform_ds_file' ] ) ) ; } elseif ( strpos... | Returns the FlexForm configuration of a grid layout |
1,316 | public function setLanguageService ( LanguageService $ languageService = null ) { $ this -> languageService = $ languageService instanceof LanguageService ? $ languageService : GeneralUtility :: makeInstance ( LanguageService :: class ) ; if ( $ this -> getBackendUser ( ) ) { $ this -> languageService -> init ( $ this ... | setter for languageService object |
1,317 | protected function addHeaderRowToCSV ( ) { $ fieldArray = array_combine ( $ this -> fieldArray , $ this -> fieldArray ) ; $ hooks = $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'SC_OPTIONS' ] [ __CLASS__ ] [ 'customizeCsvHeader' ] ?? [ ] ; if ( ! empty ( $ hooks ) ) { $ hookParameters = [ 'fields' => & $ fieldArray , ] ; foreach ... | Add header line with field names as CSV line |
1,318 | protected function addToCSV ( array $ row = [ ] ) { $ rowReducedByControlFields = self :: removeControlFieldsFromFieldRow ( $ row ) ; $ fieldArray = array_intersect_key ( array_flip ( $ this -> fieldArray ) , $ rowReducedByControlFields ) ; $ rowReducedToSelectedColumns = array_replace ( $ fieldArray , array_intersect_... | Adds selected columns of one table row as CSV line . |
1,319 | public function setCsvRow ( $ csvRow ) { $ csvDelimiter = $ this -> modTSconfig [ 'properties' ] [ 'csvDelimiter' ] ?? ',' ; $ csvQuote = $ this -> modTSconfig [ 'properties' ] [ 'csvQuote' ] ?? '"' ; $ this -> csvLines [ ] = CsvUtility :: csvValues ( $ csvRow , $ csvDelimiter , $ csvQuote ) ; } | Adds input row of values to the internal csvLines array as a CSV formatted line |
1,320 | public function recPath ( $ pid ) { if ( ! isset ( $ this -> recPath_cache [ $ pid ] ) ) { $ this -> recPath_cache [ $ pid ] = BackendUtility :: getRecordPath ( $ pid , $ this -> perms_clause , 20 ) ; } return $ this -> recPath_cache [ $ pid ] ; } | Returns the path for a certain pid The result is cached internally for the session thus you can call this function as much as you like without performance problems . |
1,321 | public function addActionToCellGroup ( & $ cells , $ action , $ actionKey ) { $ cellsMap = [ 'primary' => [ 'view' , 'edit' , 'hide' , 'delete' , 'stat' , ] , 'secondary' => [ 'viewBig' , 'history' , 'perms' , 'new' , 'move' , 'moveUp' , 'moveDown' , 'moveLeft' , 'moveRight' , 'version' , ] , ] ; $ classification = in_... | add action into correct section |
1,322 | public function makeLocalizationPanel ( $ table , $ row ) { $ out = [ 0 => '' , 1 => '' , ] ; $ this -> translations = [ ] ; $ out [ 0 ] = $ this -> languageFlag ( $ row [ $ GLOBALS [ 'TCA' ] [ $ table ] [ 'ctrl' ] [ 'languageField' ] ] ) ; if ( ( int ) $ row [ $ GLOBALS [ 'TCA' ] [ $ table ] [ 'ctrl' ] [ 'languageFiel... | Creates the localization panel |
1,323 | public function getDataStructureIdentifierPreProcess ( array $ tca , $ tableName , $ fieldName , array $ row ) { if ( $ tableName === 'tt_content' && $ fieldName === 'pi_flexform' && $ row [ 'CType' ] === 'gridelements_pi1' ) { if ( ! empty ( $ row [ 'tx_gridelements_backend_layout' ] ) ) { $ pageUid = $ row [ 'pid' ] ... | Method to find flex form configuration of a tt_content gridelements content element . |
1,324 | public function cleanupWorkspacesAfterFinalizing ( ) { $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ constraints = [ $ queryBuilder -> expr ( ) -> andX ( $ queryBuilder -> expr ( ) -> eq ( 'pid' , $ queryBuilder -> createNamedParameter ( - 1 , \ PDO :: PARAM_INT ) ) , $ queryBuilder -> expr ( ) -> eq ( 't3ver_wsid... | Function to remove any remains of versioned records after finalizing a workspace action via Discard or Publish commands |
1,325 | public function doGridContainerUpdate ( $ containerUpdateArray = [ ] ) { if ( is_array ( $ containerUpdateArray ) && ! empty ( $ containerUpdateArray ) ) { $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ currentContainers = $ queryBuilder -> select ( 'uid' , 'tx_gridelements_children' ) -> from ( 'tt_content' ) -> w... | Function to handle record actions between different grid containers |
1,326 | public function processFieldArrayForTtContent ( array & $ fieldArray , $ id = 0 , $ new = false ) { $ pid = ( int ) GeneralUtility :: _GET ( 'DDinsertNew' ) ; if ( abs ( $ pid ) > 0 ) { $ this -> setDefaultFieldValues ( $ fieldArray , $ pid ) ; $ this -> getDefaultFlexformValues ( $ fieldArray ) ; } $ this -> setFieldE... | process field array for table tt_content |
1,327 | public function setDefaultFieldValues ( array & $ fieldArray , $ uidPid = 0 ) { $ newRow = [ ] ; $ TCAdefaultOverride = ( array ) ( $ this -> getBackendUser ( ) -> getTSConfig ( ) [ 'TCAdefaults' ] ?? [ ] ) ; if ( is_array ( $ TCAdefaultOverride [ 'tt_content.' ] ) ) { foreach ( $ TCAdefaultOverride [ 'tt_content.' ] a... | set default field values for new records |
1,328 | public function getDefaultFlexformValues ( array & $ fieldArray ) { foreach ( $ GLOBALS [ 'TCA' ] [ 'tt_content' ] [ 'columns' ] [ 'pi_flexform' ] [ 'config' ] [ 'ds' ] as $ key => $ dataStructure ) { $ types = GeneralUtility :: trimExplode ( ',' , $ key ) ; if ( ( $ types [ 0 ] === $ fieldArray [ 'list_type' ] || $ ty... | checks for default flexform values for new records and sets them accordingly |
1,329 | public function extractDefaultDataFromDataStructure ( $ dataStructure ) { $ returnXML = '' ; $ sheetArray = [ ] ; if ( $ dataStructure ) { $ structureArray = GeneralUtility :: xml2array ( $ dataStructure ) ; if ( ! isset ( $ structureArray [ 'sheets' ] ) && isset ( $ structureArray [ 'ROOT' ] ) ) { $ structureArray [ '... | extracts the default data out of a given XML data structure |
1,330 | public function setFieldEntries ( array & $ fieldArray , $ contentId = 0 , $ new = false ) { $ containerUpdateArray = [ ] ; if ( isset ( $ fieldArray [ 'tx_gridelements_container' ] ) ) { if ( ( int ) $ fieldArray [ 'tx_gridelements_container' ] > 0 && $ new ) { $ containerUpdateArray [ ( int ) $ fieldArray [ 'tx_gride... | set initial entries to field array |
1,331 | public function checkForRootColumn ( $ contentId ) { $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ queryBuilder -> getRestrictions ( ) -> removeAll ( ) ; $ parent = $ queryBuilder -> select ( 't1.colPos' , 't1.tx_gridelements_container' ) -> from ( 'tt_content' , 't1' ) -> join ( 't1' , 'tt_content' , 't2' , $ que... | Function to recursively determine the colPos of the root container so that an element that has been removed from any container will still remain in the same major page column |
1,332 | public function checkForAllowedCTypes ( array & $ items , $ pageId , $ pageColumn , $ gridContainerId , $ gridColumn ) { $ allowed = [ ] ; $ disallowed = [ ] ; if ( ( int ) $ pageColumn >= 0 || ( int ) $ pageColumn === - 2 ) { $ column = $ pageColumn ? $ pageColumn : 0 ; $ layout = $ this -> getSelectedBackendLayout ( ... | Checks if a CType is allowed in this particular page or grid column - only this one column defines the allowed CTypes regardless of any parent column |
1,333 | public function getPluginFlexFormData ( & $ child = [ ] ) { if ( ! empty ( $ child ) ) { $ cObjData = $ child ; } else { $ cObjData = $ this -> cObj -> data ; } $ pluginFlexForm = $ cObjData [ 'pi_flexform' ] ; if ( is_array ( $ pluginFlexForm ) && is_array ( $ pluginFlexForm [ 'data' ] ) ) { foreach ( $ pluginFlexForm... | fetches values from the grid flexform and assigns them to virtual fields in the data array |
1,334 | public function getFlexFormValue ( $ T3FlexForm_array , $ fieldName , $ sheet = 'sDEF' , $ language = 'lDEF' , $ value = 'vDEF' ) { $ sheetArray = is_array ( $ T3FlexForm_array ) ? $ T3FlexForm_array [ 'data' ] [ $ sheet ] [ $ language ] : '' ; if ( is_array ( $ sheetArray ) ) { return $ this -> getFlexFormValueFromShe... | Return value from somewhere inside a FlexForm structure |
1,335 | public function renderChildrenIntoParentColumns ( $ typoScriptSetup = [ ] , $ sortColumns = [ ] ) { $ currentParentGrid = $ this -> copyCurrentParentGrid ( ) ; $ columns = $ this -> getUsedColumns ( $ sortColumns ) ; $ parentGridData = $ this -> getParentGridData ( $ currentParentGrid [ 'data' ] ) ; $ parentGridData [ ... | renders the children of the grid container and puts them into their respective columns |
1,336 | public function user_getTreeList ( ) { $ pidList = $ this -> getTSFE ( ) -> register [ 'tt_content_shortcut_recursive' ] ? $ this -> cObj -> getTreeList ( $ this -> cObj -> data [ 'uid' ] , $ this -> getTSFE ( ) -> register [ 'tt_content_shortcut_recursive' ] ) : '' ; $ this -> getTSFE ( ) -> register [ 'pidInList' ] =... | renders a recursive pidList to reference content from a list of pages |
1,337 | public function itemsProcFunc ( array & $ params ) { $ this -> init ( ) ; if ( $ params [ 'row' ] [ 'pid' ] > 0 ) { $ contentType = is_array ( $ params [ 'row' ] [ 'CType' ] ) ? $ params [ 'row' ] [ 'CType' ] [ 0 ] : $ params [ 'row' ] [ 'CType' ] ; $ listType = is_array ( $ params [ 'row' ] [ 'list_type' ] ) ? $ param... | ItemProcFunc for colpos items |
1,338 | public function getPidFromUid ( $ uid = 0 ) { $ queryBuilder = self :: getQueryBuilder ( ) ; $ triggerElement = $ queryBuilder -> select ( 'pid' ) -> from ( 'tt_content' ) -> where ( $ queryBuilder -> expr ( ) -> eq ( 'uid' , $ queryBuilder -> createNamedParameter ( abs ( $ uid ) , \ PDO :: PARAM_INT ) ) ) -> execute (... | converts tt_content uid into a pid |
1,339 | protected function processChildRecord ( $ record ) { $ id = ( int ) $ record [ 'uid' ] ; $ this -> checkOptions ( $ record ) ; $ recordContentObjectRenderer = GeneralUtility :: makeInstance ( ContentObjectRenderer :: class ) ; $ recordContentObjectRenderer -> start ( $ record , 'tt_content' ) ; $ this -> processedRecor... | Processes child records recursively to get other children into the same array |
1,340 | public function manipulateWizardItems ( & $ wizardItems , & $ parentObject ) { if ( ! $ this -> getBackendUser ( ) -> checkAuthMode ( 'tt_content' , 'CType' , 'gridelements_pi1' , $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'BE' ] [ 'explicitADmode' ] ) ) { return ; } $ pageID = $ parentObject -> id ; $ this -> init ( $ pageID )... | Processes the items of the new content element wizard and inserts necessary default values for items created within a grid |
1,341 | public function removeDisallowedWizardItems ( array $ allowed , array $ disallowed , array & $ wizardItems ) { foreach ( $ wizardItems as $ key => $ wizardItem ) { if ( ! $ wizardItems [ $ key ] [ 'header' ] ) { if ( ( ! empty ( $ allowed [ 'CType' ] ) && ! isset ( $ allowed [ 'CType' ] [ $ wizardItems [ $ key ] [ 'tt_... | remove disallowed content elements from wizard items |
1,342 | public function getExcludeLayouts ( $ container , NewContentElementController $ parentObject ) { $ excludeLayouts = 0 ; $ excludeArray = [ ] ; $ pageID = $ parentObject -> id ; $ TSconfig = BackendUtility :: getPagesTSconfig ( $ pageID ) ; if ( $ container && $ TSconfig [ 'TCEFORM.' ] [ 'tt_content.' ] [ 'tx_gridelemen... | retrieve layouts to exclude from pageTSconfig |
1,343 | public function addGridValuesToWizardItems ( array & $ wizardItems , $ container , $ column ) { foreach ( $ wizardItems as $ key => $ wizardItem ) { if ( ! $ wizardItems [ $ key ] [ 'header' ] ) { if ( $ container !== 0 ) { $ wizardItems [ $ key ] [ 'tt_content_defValues' ] [ 'tx_gridelements_container' ] = ( int ) $ c... | initializes wizard items |
1,344 | public function removeEmptyHeadersFromWizard ( array & $ wizardItems ) { $ headersWithElements = [ ] ; foreach ( $ wizardItems as $ key => $ wizardItem ) { $ isElement = strpos ( $ key , '_' , 1 ) ; if ( $ isElement ) { $ headersWithElements [ substr ( $ key , 0 , $ isElement ) ] = true ; } } foreach ( $ wizardItems as... | remove unnecessary headers from wizard items |
1,345 | public function adjustValuesAfterWorkspaceOperations ( array $ fieldArray , $ uid , DataHandler $ parentObj ) { $ workspace = $ this -> getBackendUser ( ) -> workspace ; if ( $ workspace && ( isset ( $ fieldArray [ 'colPos' ] ) || isset ( $ fieldArray [ 'tx_gridelements_container' ] ) || isset ( $ fieldArray [ 'tx_grid... | Function to adjust colPos container and grid column of an element after it has been moved out of or into a container during a workspace operation |
1,346 | public function saveCleanedUpFieldArray ( array $ changedFieldArray ) { unset ( $ changedFieldArray [ 'pi_flexform' ] ) ; if ( isset ( $ changedFieldArray [ 'tx_gridelements_backend_layout' ] ) && $ this -> getTable ( ) === 'tt_content' || isset ( $ changedFieldArray [ 'backend_layout' ] ) && $ this -> getTable ( ) ===... | save cleaned up field array |
1,347 | public function getAvailableColumns ( $ layout = '' , $ table = '' , $ id = 0 ) { $ tcaColumns = '' ; if ( $ layout && $ table === 'tt_content' ) { $ tcaColumns = $ this -> layoutSetup -> getLayoutColumns ( $ layout ) ; $ tcaColumns = '-2,-1,' . $ tcaColumns [ 'CSV' ] ; } elseif ( $ table === 'pages' ) { $ tcaColumns =... | fetches all available columns for a certain grid container based on TCA settings and layout records |
1,348 | public static function isRequest ( $ msg ) : bool { return is_object ( $ msg ) && property_exists ( $ msg , 'id' ) && isset ( $ msg -> method ) ; } | A message is considered a Request if it has an ID and a method . |
1,349 | public static function parse ( string $ msg ) : Message { $ decoded = json_decode ( $ msg ) ; if ( json_last_error ( ) !== JSON_ERROR_NONE ) { throw new Error ( json_last_error_msg ( ) , ErrorCode :: PARSE_ERROR ) ; } if ( Notification :: isNotification ( $ decoded ) ) { $ obj = new Notification ( $ decoded -> method ,... | Returns the appropriate Message subclass |
1,350 | public static function isNotification ( $ msg ) : bool { return is_object ( $ msg ) && ! property_exists ( $ msg , 'id' ) && isset ( $ msg -> method ) ; } | A message is considered a Notification if it has a method but no ID . |
1,351 | protected function getParser ( $ path = null ) { $ path = is_null ( $ path ) ? join ( DIRECTORY_SEPARATOR , array ( 'build' , 'logs' , 'clover.xml' ) ) : $ path ; return new CloverParser ( $ path ) ; } | Get parser of current format type . |
1,352 | protected function getCommitHash ( $ hash = null ) { if ( ! $ hash ) { $ gClient = new GitClient ( getcwd ( ) ) ; return $ gClient -> getHashOfLatestCommit ( ) ; } if ( strlen ( $ hash ) != 40 ) { throw new \ InvalidArgumentException ( sprintf ( "Invalid git commit hash %s specified" , $ hash ) ) ; } return urlencode (... | Get Git commit hash of project |
1,353 | private function getRelativePath ( \ SimpleXMLElement $ fileName ) { $ dirOfSrcFiles = $ this -> element -> project -> directory [ "name" ] ; $ projectRoot = $ this -> rootDir ; $ dirFromProjectRoot = substr ( $ dirOfSrcFiles , strlen ( $ projectRoot ) + 1 ) ; $ relativeFilePath = substr ( ( string ) $ fileName , 0 , -... | The PhpUnit XML Coverage format does not save the full path of the filename We can get the filename by combining the path of the first directory with the href attribute of each file . |
1,354 | protected function setThemeNameSelectorOptions ( ) { $ elementUri = tao_helpers_Uri :: encode ( DeliveryThemeDetailsProvider :: DELIVERY_THEME_ID_URI ) ; if ( ! $ this -> form -> hasElement ( $ elementUri ) ) { return false ; } $ themeService = ServiceManager :: getServiceManager ( ) -> get ( ThemeService :: SERVICE_ID... | Sets the theme name selector options . |
1,355 | private function usage ( ) { if ( empty ( $ this -> params ) ) { $ usageHelper = \ common_report_Report :: createInfo ( 'USAGE: What you could do here:' ) ; $ usageHelper -> add ( \ common_report_Report :: createSuccess ( 'Please, Note that sections must not intersect otherwise it will work according to priority' ) ) ;... | how it works |
1,356 | private function counter ( ) { if ( ! $ this -> done && in_array ( '--count-deliveries-by-user' , $ this -> params ) ) { $ this -> done = true ; $ counterReport = \ common_report_Report :: createInfo ( 'List of Users:' ) ; $ helper = new ConsoleTableHelper ( ) ; $ helper -> addHeader ( [ 'TestTaker' , 'Deliveries' , 'E... | First section with general information about users |
1,357 | private function detailed ( ) { if ( ! $ this -> done && in_array ( '--detailed-report' , $ this -> params ) ) { $ this -> done = true ; $ details = $ this -> getDetailsForUser ( ! in_array ( '--open-out' , $ this -> params ) ) ; if ( $ details !== false ) { $ counterReport = \ common_report_Report :: createInfo ( 'Det... | Second section with detailed information about the specified user |
1,358 | private function getResourceFromParameter ( $ prefix = '--unique-prefix' ) { $ resource = null ; $ hasParameter = false ; $ val = $ this -> getParameterValue ( $ prefix ) ; if ( $ val ) { $ hasParameter = true ; $ resource = $ this -> getResource ( $ val ) ; if ( ! $ resource -> exists ( ) ) { $ resource = null ; } } r... | Get parameter from the list of parameters as Resource |
1,359 | private function cleaner ( ) { if ( ! $ this -> done && in_array ( '--run-cleaner' , $ this -> params ) ) { $ this -> done = true ; $ testTaker = $ this -> getResourceFromParameter ( '--clean-user=' ) ; if ( ! $ testTaker ) { $ this -> report -> add ( \ common_report_Report :: createFailure ( '--clean-user=[userId] is ... | The most dangerous of the sections which will affect on the stored data |
1,360 | protected function getDeliveryExecutionId ( ) { $ request = \ Context :: getInstance ( ) -> getRequest ( ) ; $ deliveryExecutionId = '' ; if ( $ request -> hasParameter ( 'deliveryExecution' ) ) { $ deliveryExecutionId = \ tao_helpers_Uri :: decode ( $ request -> getParameter ( 'deliveryExecution' ) ) ; } elseif ( $ re... | Returns the delivery execution identifier . |
1,361 | public function getDeliveryThemeIdFromDb ( $ deliveryId ) { try { $ delivery = new core_kernel_classes_Resource ( $ deliveryId ) ; $ property = $ delivery -> getProperty ( static :: DELIVERY_THEME_ID_URI ) ; return ( string ) $ delivery -> getOnePropertyValue ( $ property ) ; } catch ( common_exception_Error $ e ) { re... | Returns delivery theme id from database . |
1,362 | protected function getCachePersistence ( ) { if ( is_null ( $ this -> cachePersistence ) && $ this -> hasOption ( static :: OPTION_CACHE_PERSISTENCE ) ) { $ persistenceOption = $ this -> getOption ( static :: OPTION_CACHE_PERSISTENCE ) ; $ this -> cachePersistence = ( is_object ( $ persistenceOption ) ) ? $ persistence... | Returns the cache persistence . |
1,363 | public function getCacheTtl ( ) { if ( $ this -> hasOption ( static :: OPTION_CACHE_PERSISTENCE_TTL ) ) { $ cacheTtl = $ this -> getOption ( static :: OPTION_CACHE_PERSISTENCE_TTL ) ; if ( ! is_null ( $ cacheTtl ) ) { return $ cacheTtl ; } } return static :: CACHE_PERSISTENCE_DEFAULT_TTL ; } | Returns the cache persistence s ttl . |
1,364 | public static function createTask ( $ where = [ ] , $ propertyValues = [ ] ) { $ serviceManager = ServiceManager :: getServiceManager ( ) ; $ action = new self ( ) ; $ action -> setServiceLocator ( $ serviceManager ) ; $ parameters = [ self :: OPTION_WHERE => $ where , self :: OPTION_PARAMETERS => $ propertyValues ] ; ... | Create a task to update a delivery |
1,365 | public static function create ( core_kernel_classes_Class $ deliveryClass , core_kernel_classes_Resource $ test , $ label ) { $ factory = ServiceManager :: getServiceManager ( ) -> get ( DeliveryFactory :: SERVICE_ID ) ; return $ factory -> create ( $ deliveryClass , $ test , $ label ) ; } | Please use DeliveryFactory service |
1,366 | public static function createTask ( \ core_kernel_classes_Resource $ test , \ core_kernel_classes_Class $ deliveryClass , array $ initialProperties = [ ] ) { $ action = new self ( ) ; $ queueDispatcher = ServiceManager :: getServiceManager ( ) -> get ( QueueDispatcher :: SERVICE_ID ) ; $ parameters = [ 'test' => $ test... | Create a task to compile a delivery into a delivery class |
1,367 | protected function getFileStorage ( ) { if ( ! $ this -> storageService ) { $ this -> storageService = $ this -> getServiceManager ( ) -> get ( \ tao_models_classes_service_FileStorage :: SERVICE_ID ) ; } return $ this -> storageService ; } | Return the file storage |
1,368 | public function deleteInstance ( core_kernel_classes_Resource $ assembly ) { if ( $ this -> deleteDeliveryRuntime ( $ assembly ) === false ) { \ common_Logger :: i ( 'Fail to delete runtimes assembly, process aborted' ) ; } if ( $ this -> deleteDeliveryDirectory ( $ assembly ) === false ) { \ common_Logger :: i ( 'Fail... | Delete delivery by deleting runtime directories & ontology record |
1,369 | protected function deleteDeliveryRuntime ( core_kernel_classes_Resource $ assembly ) { $ deliveryAssignement = $ this -> getServiceManager ( ) -> get ( GroupAssignment :: SERVICE_ID ) ; $ deliveryAssignement -> onDelete ( $ assembly ) ; $ runtimeResource = $ assembly -> getUniquePropertyValue ( new core_kernel_classes_... | Delete a runtime of a delivery |
1,370 | public function deleteDeliveryDirectory ( core_kernel_classes_Resource $ assembly ) { $ success = true ; $ deleted = 0 ; $ directories = $ assembly -> getPropertyValues ( new core_kernel_classes_Property ( self :: PROPERTY_DELIVERY_DIRECTORY ) ) ; foreach ( $ directories as $ directory ) { $ instances = $ this -> getRo... | Delete directories related to a delivery don t remove if dir is used by another delivery |
1,371 | public function getRuntime ( core_kernel_classes_Resource $ assembly ) { return $ this -> getServiceLocator ( ) -> get ( RuntimeService :: SERVICE_ID ) -> getRuntime ( $ assembly -> getUri ( ) ) ; } | Gets the service call to run this assembly |
1,372 | public function guest ( ) { common_session_SessionManager :: endSession ( ) ; $ session = new GuestTestTakerSession ( ) ; common_session_SessionManager :: startSession ( $ session ) ; $ returnUrl = $ this -> getServiceLocator ( ) -> get ( ReturnUrlService :: SERVICE_ID ) -> getReturnUrl ( ) ; $ this -> redirect ( $ ret... | Init guest session and redirect to module index |
1,373 | private function deactivate ( ) { $ guestAccess = new GuestAccess ( ) ; try { if ( $ this -> entryPointService -> deactivateEntryPoint ( $ guestAccess -> getId ( ) , EntryPointService :: OPTION_PRELOGIN ) ) { $ rule = new AccessRule ( 'grant' , TaoRoles :: ANONYMOUS , 'oat\taoDeliveryRdf\controller\Guest@guest' ) ; Acl... | Try to deactivate the guest entry point |
1,374 | private function activate ( ) { $ guestAccess = new GuestAccess ( ) ; try { $ this -> entryPointService -> activateEntryPoint ( $ guestAccess -> getId ( ) , EntryPointService :: OPTION_PRELOGIN ) ; $ rule = new AccessRule ( 'grant' , TaoRoles :: ANONYMOUS , 'oat\taoDeliveryRdf\controller\Guest@guest' ) ; AclProxy :: ap... | Try to activate the guest entry point |
1,375 | private function generateNewTmpPath ( $ fileName ) { $ folder = sys_get_temp_dir ( ) . DIRECTORY_SEPARATOR . "tmp" . md5 ( $ fileName . uniqid ( '' , true ) ) . DIRECTORY_SEPARATOR ; if ( ! file_exists ( $ folder ) ) { mkdir ( $ folder ) ; } $ this -> tmpDir = $ folder ; } | generate unique tmp folder based on delivery . |
1,376 | public function generate ( ) { try { if ( ! $ this -> hasRequestParameter ( self :: REST_DELIVERY_TEST_ID ) ) { throw new \ common_exception_MissingParameter ( self :: REST_DELIVERY_TEST_ID , $ this -> getRequestURI ( ) ) ; } $ test = $ this -> getResource ( $ this -> getRequestParameter ( self :: REST_DELIVERY_TEST_ID... | Generate a delivery from test uri Test uri has to be set and existing |
1,377 | public function generateDeferred ( ) { try { if ( ! $ this -> hasRequestParameter ( self :: REST_DELIVERY_TEST_ID ) ) { throw new \ common_exception_MissingParameter ( self :: REST_DELIVERY_TEST_ID , $ this -> getRequestURI ( ) ) ; } $ test = $ this -> getResource ( $ this -> getRequestParameter ( self :: REST_DELIVERY... | Put task to generate a delivery from test uri to the task queue Test uri has to be set and existing |
1,378 | public function deleteDeferred ( ) { try { if ( $ this -> getRequestMethod ( ) !== \ Request :: HTTP_DELETE ) { throw new \ common_exception_NotImplemented ( 'Only delete method is accepted to deleting delivery' ) ; } if ( ! $ this -> hasRequestParameter ( 'uri' ) ) { throw new \ common_exception_MissingParameter ( 'ur... | Delete delivery by URI |
1,379 | public function get ( ) { try { if ( $ this -> getRequestMethod ( ) !== \ Request :: HTTP_GET ) { throw new \ common_exception_NotImplemented ( 'Only get method is accepted to getting deliveries' ) ; } $ limit = 0 ; if ( $ this -> hasRequestParameter ( 'limit' ) ) { $ limit = $ this -> getRequestParameter ( 'limit' ) ;... | List all deliveries or paginated range |
1,380 | public function getStatus ( ) { try { if ( ! $ this -> hasRequestParameter ( self :: TASK_ID_PARAM ) ) { throw new \ common_exception_MissingParameter ( self :: TASK_ID_PARAM , $ this -> getRequestURI ( ) ) ; } $ data = $ this -> getTaskLogReturnData ( $ this -> getRequestParameter ( self :: TASK_ID_PARAM ) , CompileDe... | Action to retrieve test compilation task status from queue |
1,381 | public function createClass ( ) { try { $ class = $ this -> createSubClass ( $ this -> getDeliveryRootClass ( ) ) ; $ result = [ 'message' => __ ( 'Class successfully created.' ) , 'delivery-uri' => $ class -> getUri ( ) , ] ; $ this -> returnSuccess ( $ result ) ; } catch ( \ common_exception_ClassAlreadyExists $ e ) ... | Create a Delivery Class |
1,382 | protected function getDeliveryClassByParameters ( ) { $ rootDeliveryClass = $ this -> getDeliveryRootClass ( ) ; if ( $ this -> hasRequestParameter ( self :: REST_DELIVERY_CLASS_URI ) ) { $ deliveryClass = $ this -> getClass ( $ this -> getRequestParameter ( self :: REST_DELIVERY_CLASS_URI ) ) ; if ( $ deliveryClass ==... | Get a delivery class based on parameters |
1,383 | public function getProviders ( DeliveryExecution $ execution ) { $ serviceManager = $ this -> getServiceManager ( ) ; $ providerService = $ serviceManager -> get ( TestProviderService :: SERVICE_ID ) ; $ providers = $ providerService -> getAllProviders ( ) ; return array_filter ( $ providers , function ( $ provider ) {... | Get the list of providers for the current execution |
1,384 | public function getPlugins ( DeliveryExecution $ deliveryExecution ) { $ serviceManager = $ this -> getServiceManager ( ) ; $ pluginService = $ serviceManager -> get ( TestPluginService :: SERVICE_ID ) ; $ testRunnerFeatureService = $ serviceManager -> get ( TestRunnerFeatureService :: SERVICE_ID ) ; $ allPlugins = $ p... | Get the list of active plugins for the current execution |
1,385 | public function exportCompiledDelivery ( core_kernel_classes_Resource $ compiledDelivery , $ fsExportPath = '' ) { $ this -> logDebug ( "Exporting Delivery Assembly '" . $ compiledDelivery -> getUri ( ) . "'..." ) ; $ fileName = \ tao_helpers_Display :: textCleaner ( $ compiledDelivery -> getLabel ( ) ) . '.zip' ; $ pa... | export a compiled delivery into an archive |
1,386 | protected function doExportCompiledDelivery ( $ path , core_kernel_classes_Resource $ compiledDelivery , \ ZipArchive $ zipArchive ) { $ taoDeliveryVersion = \ common_ext_ExtensionsManager :: singleton ( ) -> getInstalledVersion ( 'taoDelivery' ) ; $ data = array ( 'dir' => array ( ) , 'label' => $ compiledDelivery -> ... | Do Export Compiled Delivery |
1,387 | protected function isUserExcluded ( \ core_kernel_classes_Resource $ delivery , User $ user ) { $ excludedUsers = $ delivery -> getPropertyValues ( new \ core_kernel_classes_Property ( DeliveryContainerService :: PROPERTY_EXCLUDED_SUBJECTS ) ) ; return in_array ( $ user -> getIdentifier ( ) , $ excludedUsers ) ; } | Check if a user is excluded from a delivery |
1,388 | public function getGuestAccessDeliveries ( ) { $ class = new core_kernel_classes_Class ( DeliveryAssemblyService :: CLASS_URI ) ; return $ class -> searchInstances ( array ( DeliveryContainerService :: PROPERTY_ACCESS_SETTINGS => DeliveryAssemblyService :: PROPERTY_DELIVERY_GUEST_ACCESS ) , array ( 'recursive' => true ... | Search for deliveries configured for guest access |
1,389 | protected function hasDeliveryGuestAccess ( core_kernel_classes_Resource $ delivery ) { $ returnValue = false ; $ properties = $ delivery -> getPropertiesValues ( array ( new core_kernel_classes_Property ( DeliveryContainerService :: PROPERTY_ACCESS_SETTINGS ) , ) ) ; $ propAccessSettings = current ( $ properties [ Del... | Check if delivery configured for guest access |
1,390 | protected function areWeInRange ( $ startDate , $ endDate ) { return ( empty ( $ startDate ) || date_create ( ) >= $ startDate ) && ( empty ( $ endDate ) || date_create ( ) <= $ endDate ) ; } | Check if the date are in range |
1,391 | protected function orderAssignments ( array $ assignments ) { usort ( $ assignments , function ( $ a , $ b ) { return $ a -> getDisplayOrder ( ) - $ b -> getDisplayOrder ( ) ; } ) ; return $ assignments ; } | Order Assignments of a given user . |
1,392 | private function helpAction ( $ message = null ) { if ( $ message !== null ) { $ this -> report = new Report ( Report :: TYPE_ERROR , $ message . PHP_EOL ) ; } $ helpReport = new Report ( Report :: TYPE_INFO , "Usage: " . __CLASS__ . " <mode> [<args>]" . PHP_EOL . PHP_EOL . "Available modes:" . PHP_EOL . " list ... | Set help report |
1,393 | protected function createDeliveryResource ( core_kernel_classes_Class $ deliveryClass , \ tao_models_classes_service_ServiceCall $ serviceCall , $ container , $ properties = array ( ) ) { $ properties [ DeliveryAssemblyService :: PROPERTY_DELIVERY_TIME ] = time ( ) ; $ properties [ DeliveryAssemblyService :: PROPERTY_D... | Create a delivery resource based on a successfull compilation |
1,394 | public function getFileInfo ( ) { $ ret = array ( 'uploadId' => $ this -> id , 'mimeType' => $ this -> mime_type , 'filename' => $ this -> filename , 'extension' => $ this -> extension , 'fileSize' => $ this -> getFileSize ( ) , 'hashKey' => $ this -> getHashKey ( ) ) ; if ( ! $ this -> id && is_file ( $ this -> filena... | wird von upload - feld verwendet |
1,395 | protected function _getComponentId ( $ select ) { $ componentId = null ; if ( $ select ) { if ( $ select -> getPart ( Kwf_Model_Select :: WHERE_EQUALS ) ) { foreach ( $ select -> getPart ( Kwf_Model_Select :: WHERE_EQUALS ) as $ k => $ i ) { if ( $ k == 'component_id' ) $ componentId = $ i ; } } } return $ componentId ... | Extracts the component id from select |
1,396 | protected function _getTrlRow ( $ proxiedRow , $ componentId ) { $ row = null ; $ proxyId = $ proxiedRow -> id ; $ select = $ this -> _trlModel -> select ( ) -> whereEquals ( 'component_id' , $ componentId ) -> whereEquals ( 'master_id' , $ proxyId ) ; $ trlRow = $ this -> _trlModel -> getRows ( $ select ) -> current (... | returns the related trl - row |
1,397 | public function getRow ( $ select ) { $ componentId = $ this -> _getComponentId ( $ select ) ; $ masterId = $ this -> _getId ( $ select ) ; if ( $ componentId && $ masterId ) { $ select = new Kwf_Model_Select ( ) ; $ c = Kwf_Component_Data_Root :: getInstance ( ) -> getComponentById ( $ componentId , array ( 'ignoreVis... | Should return the specified row componentId and id has to be defined |
1,398 | protected function _getPseudoPageUrl ( ) { $ data = $ this ; $ filename = '' ; $ hadStaticPage = false ; do { if ( $ hadStaticPage && isset ( $ data -> generator ) && ! $ data -> isPseudoPage && $ data -> generator -> getAddUrlPart ( ) ) { $ filename = $ data -> id . ( $ filename ? ':' : '' ) . $ filename ; } if ( $ da... | Like - > url but also works for pseudoPages |
1,399 | public function getExpandedComponentId ( ) { if ( $ this -> _expandedComponentIdCache ) { return $ this -> _expandedComponentIdCache ; } $ generator = $ this -> generator ; if ( $ generator instanceof Kwc_Root_Category_Generator ) { $ separator = '_' ; } else { $ separator = $ generator -> getIdSeparator ( ) ; } $ this... | Returns component_id with seperate entries from every page in tree |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.