Ustawia listę ról, które mają dostęp do elementu
@param \Cms\Orm\CmsCategoryRecord $record
@param \Mmi\Navigation\NavigationConfigElement $element
@return \Mmi\Navigation\NavigationConfigElement
961809
protected function _setNavigationElementRoles(CmsCategoryRecord $record, \Mmi\Navigation\NavigationConfigElement $element)
    {
		if ($this->_categoryRole === null) {
			$this->_categoryRole = new \Cms\Model\CategoryRole($record);
		} else {
			$this->_categoryRole->setCategory($record);
		}
		$element->setRoles($this->_categoryRole->allowedFor());
		return $element;
	}
163658
protected function processChildRecord($record)
    {
        $id = (int)$record['uid'];
        $this->checkOptions($record);
        /* @var $recordContentObjectRenderer ContentObjectRenderer */
        $recordContentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class);
        $recordContentObjectRenderer->start($record, 'tt_content');
        $this->processedRecordVariables[$id] = ['data' => $record];
        if (
            (int)$this->options['recursive'] > 0 &&
            $record['CType'] === 'gridelements_pi1' &&
            !empty($record['tx_gridelements_backend_layout'])
        ) {
            $childProcessorConfiguration = $this->containerProcessorConfiguration;
            $childProcessorConfiguration['dataProcessing.']['0.'] = $this->processorConfiguration;
            $childProcessorConfiguration['dataProcessing.']['0.']['recursive'] = (int)$this->options['recursive'] - 1;
            $childProcessorConfiguration['dataProcessing.']['0'] = 'GridElementsTeam\Gridelements\DataProcessing\GridChildrenProcessor';
            $this->processedRecordVariables[$id] = $this->contentDataProcessor->process(
                $recordContentObjectRenderer,
                $childProcessorConfiguration,
                $this->processedRecordVariables[$id]
            );
        } else {
            $this->processedRecordVariables[$id] = $this->contentDataProcessor->process(
                $recordContentObjectRenderer,
                $this->containerProcessorConfiguration,
                $this->processedRecordVariables[$id]
            );
        }
    }
424579
public static function action_course_hide_by_record($courserecordorid) {
        if (is_int($courserecordorid)) {
            $courserecordorid = get_course($courserecordorid);
        }
        $course = new \core_course_list_element($courserecordorid);
        return self::action_course_hide($course);
    }
353200
protected function generateRecordMissingSubdefs(\record_adapter $record)
    {
        $wanted_subdefs = $record->get_missing_subdefs();

        if (!empty($wanted_subdefs)) {
            $this->getSubdefGenerator()->generateSubdefs($record, $wanted_subdefs);

            foreach ($wanted_subdefs as $subdef) {
                $this->container['monolog']->addInfo("generate " . $subdef . " for record " . $record->getRecordId());
            }
        }

        return count($wanted_subdefs);
    }
781564
public function renderCell(\Mmi\Orm\RecordRo $record)
    {
        //inicjalizacja
        if ($this->getIndex() === null) {
            //ustawia wartość domyślną uwzględniając paginator
            $this->setIndex(($this->_grid->getState()->getPage() - 1) * $this->_grid->getState()->getRowsPerPage());
        }
        //podwyższa indeks
        $this->setIndex($this->getIndex() + 1);
        return $this->getIndex();
    }
818395
public function pushRecord(Record $record)
    {
        switch (true) {
            case $record->getType()->isStdout():
                $this->stdout .= $record->getContent();
                break;
            case $record->getType()->isStderr():
                $this->stderr .= $record->getContent();
                break;
            case $record->getType()->isEndRequest():
                return new Response($this->requestId, new StringReader($this->stdout), new StringReader($this->stderr));
                break;
            default:
                throw new \RuntimeException(sprintf('Unknown package type \'%d\'', $record->getType()));
                break;
        }
    }
1222840
protected function _parseParams(array $params, \Mmi\Orm\RecordRo $record)
    {
        //inicjalizacja parametrów
        $parsedParams = [];
        $matches = [];
        //iteracja po parametrach
        foreach ($params as $key => $param) {
            //parametr %pole%
            if (preg_match('/%([a-zA-Z]+)%/', $param, $matches)) {
                $parsedParams[$key] = $record->{$matches[1]};
                continue;
            }
            //w pozostałych przypadkach przepisanie parametru
            $parsedParams[$key] = $param;
        }
        return $parsedParams;
    }
1106564
public function getRecordUrl($record)
    {
        if (isset($this->recordOnClick)) {
            return 'javascript:;';
        }

        if (!isset($this->recordUrl)) {
            return null;
        }

        $url = RouterHelper::replaceParameters($record, $this->recordUrl);
        return Backend::url($url);
    }
314661
public function setRecord($record) {
    $this->resetObject();
    $newRecord = array();
    foreach ($this->fields as $field_name => $field) {
      if (!empty($record[$field_name])) {
        $newRecord[$field_name] = $record[$field_name];
      }
      else {
        $newRecord[$field_name] = ''; //Adds the field but with empty string.
      }
    }
    $this->record = $newRecord;
    $this->fetchedRecord = $record;

    return $this;
  }
50332
private function fixBlockFieldsForPreview($record)
    {
        foreach ($record->contenttype['fields'] as $fieldSlug => $fieldSettings) {
            if ($fieldSettings['type'] === 'block') {
                $fieldValue = $this->getBlockFieldValue($record, $fieldSlug);
                if ($fieldValue) {
                    $newArray = [];
                    foreach ($fieldValue as $item) {
                        if (!empty($item)) {
                            foreach ($item as $k => &$v) {
                                $v['block'] = $k;
                            }
                            $newArray[] = $v;
                        }
                    }
                    $this->setFieldValue($record, $fieldSlug, $newArray);
                }
            }
        }

        return $record;
    }
824823
public function get_document($record, $options = array()) {
        global $PAGE;

        try {
            $context = \context_course::instance($record->instanceid);
        } catch (\moodle_exception $ex) {
            // Notify it as we run here as admin, we should see everything.
            debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document, not all required data is available: ' .
                $ex->getMessage(), DEBUG_DEVELOPER);
            return false;
        }

        $handler = course_handler::create();
        $field = $handler->get_fields()[$record->fieldid];
        $data = data_controller::create(0, $record, $field);

        // Prepare associative array with data from DB.
        $doc = \core_search\document_factory::instance($record->id, $this->componentname, $this->areaname);
        $doc->set('title', content_to_text($field->get('name'), false));
        $doc->set('content', content_to_text($data->export_value(), FORMAT_HTML));
        $doc->set('contextid', $context->id);
        $doc->set('courseid', $context->instanceid);
        $doc->set('owneruserid', \core_search\manager::NO_OWNER_ID);
        $doc->set('modified', $record->timemodified);

        // Check if this document should be considered new.
        if (isset($options['lastindexedtime']) && ($options['lastindexedtime'] < $record->timecreated)) {
            // If the document was created after the last index time, it must be new.
            $doc->set_is_new(true);
        }

        return $doc;
    }
177160
public function get_document($record, $options = array()) {
        try {
            $cm = $this->get_cm('wiki', $record->wikiid, $record->courseid);
            $context = \context_module::instance($cm->id);
        } catch (\dml_missing_record_exception $ex) {
            // Notify it as we run here as admin, we should see everything.
            debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document, not all required data is available: ' .
                $ex->getMessage(), DEBUG_DEVELOPER);
            return false;
        } catch (\dml_exception $ex) {
            // Notify it as we run here as admin, we should see everything.
            debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document: ' . $ex->getMessage(), DEBUG_DEVELOPER);
            return false;
        }

        // Make a page object without extra fields.
        $page = clone $record;
        unset($page->courseid);
        unset($page->wikiid);

        // Conversion based wiki_print_page_content().
        // Check if we have passed the cache time.
        if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
            $content = wiki_refresh_cachedcontent($page);
            $page = $content['page'];
        }
        // Convert to text.
        $content = content_to_text($page->cachedcontent, FORMAT_MOODLE);

        // Prepare associative array with data from DB.
        $doc = \core_search\document_factory::instance($record->id, $this->componentname, $this->areaname);
        $doc->set('title', content_to_text($record->title, false));
        $doc->set('content', $content);
        $doc->set('contextid', $context->id);
        $doc->set('courseid', $record->courseid);
        if ($record->groupid > 0) {
            $doc->set('groupid', $record->groupid);
        }
        $doc->set('owneruserid', \core_search\manager::NO_OWNER_ID);
        $doc->set('modified', $record->timemodified);

        // Check if this document should be considered new.
        if (isset($options['lastindexedtime']) && ($options['lastindexedtime'] < $record->timecreated)) {
            // If the document was created after the last index time, it must be new.
            $doc->set_is_new(true);
        }

        return $doc;
    }
921809
public function get_document($record, $options = array()) {
        try {
            $cm = $this->get_cm('book', $record->bookid, $record->courseid);
            $context = \context_module::instance($cm->id);
        } catch (\dml_missing_record_exception $ex) {
            // Notify it as we run here as admin, we should see everything.
            debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document, not all required data is available: ' .
                $ex->getMessage(), DEBUG_DEVELOPER);
            return false;
        } catch (\dml_exception $ex) {
            // Notify it as we run here as admin, we should see everything.
            debugging('Error retrieving ' . $this->areaid . ' ' . $record->id . ' document: ' . $ex->getMessage(), DEBUG_DEVELOPER);
            return false;
        }

        // Prepare associative array with data from DB.
        $doc = \core_search\document_factory::instance($record->id, $this->componentname, $this->areaname);
        $doc->set('title', content_to_text($record->title, false));
        $doc->set('content', content_to_text($record->content, $record->contentformat));
        $doc->set('contextid', $context->id);
        $doc->set('courseid', $record->courseid);
        $doc->set('owneruserid', \core_search\manager::NO_OWNER_ID);
        $doc->set('modified', $record->timemodified);

        // Check if this document should be considered new.
        if (isset($options['lastindexedtime']) && ($options['lastindexedtime'] < $record->timecreated)) {
            // If the document was created after the last index time, it must be new.
            $doc->set_is_new(true);
        }

        return $doc;
    }
310268
public function fillRecordWithRelations(Record $record)
    {
        foreach ($this->getWith() as $relation) {
            $relation->fillRecord($record);
        }

        return $record;
    }
738023
private function mapSiteroot(\DOMElement $element)
    {
        $urlElements = $element->getElementsByTagName('url');
        $navigationElements = $element->getElementsByTagName('navigation');
        $specialTidElements = $element->getElementsByTagName('specialTid');

        $siteroot = new Siteroot();

        foreach ($urlElements as $urlElement) {
            /* @var $urlElement \DOMElement */
            $url = new Url();
            $url
                ->setSiteroot($siteroot)
                ->setId((bool) $urlElement->getAttribute('id'))
                ->setDefault((bool) $urlElement->getAttribute('default'))
                ->setHostname((string) $urlElement->textContent)
                ->setLanguage((bool) $urlElement->getAttribute('language'))
                ->setTarget((bool) $urlElement->getAttribute('target'));
            $siteroot->addUrl($url);
        }

        foreach ($navigationElements as $navigationElement) {
            /* @var $navigationElement \DOMElement */
            $navigation = new Navigation();
            $navigation
                ->setSiteroot($siteroot)
                ->setTitle((string) $navigationElement->getAttribute('title'))
                ->setStartTreeId((int) $navigationElement->getAttribute('startTreeId'))
                ->setMaxDepth((int) $navigationElement->getAttribute('maxDepth'));
            $siteroot->addNavigation($navigation);
        }

        $specialTids = [];
        foreach ($specialTidElements as $specialTidElement) {
            /* @var $specialTidElement \DOMElement */
            $name = $specialTidElement->getAttribute('name');
            $language = $specialTidElement->getAttribute('language') ?: null;
            $specialTids[] = ['name' => $name, 'language' => $language, 'treeId' => (int) $specialTidElement->textContent];
        }
        $siteroot->setSpecialTids($specialTids);

        return $siteroot;
    }
1073270
protected function prepareRecord($record)
    {
        if ($record[static::REMOVE_FLAG_NAME] == 1) {
            return $record;
        }

        $prepared = [];

        /* @var Field $field */
        foreach ($this->fields as $field) {
            $columns = $field->column();

            $value = $this->fetchColumnValue($record, $columns);

            if (is_null($value)) {
                continue;
            }

            if (method_exists($field, 'prepare')) {
                $value = $field->prepare($value);
            }

            if (($field instanceof \Encore\Admin\Form\Field\Hidden) || $value != $field->original()) {
                if (is_array($columns)) {
                    foreach ($columns as $name => $column) {
                        Arr::set($prepared, $column, $value[$name]);
                    }
                } elseif (is_string($columns)) {
                    Arr::set($prepared, $columns, $value);
                }
            }
        }

        $prepared[static::REMOVE_FLAG_NAME] = $record[static::REMOVE_FLAG_NAME];

        return $prepared;
    }
784946
private function hideRecordIfNotTranslated($recordConfig, $record)
    {
        $language = GeneralUtility::_GET('L');
        if ($this->isRecordNotTranslated($recordConfig, $record, $language)) {
            $record = $this->pageRepository->getRecordOverlay($recordConfig['table'], $record, $language);
            if ((int)$record['l10n_parent'] !== 0) {
                return $record;
            }

            return null;
        }

        return $record;
    }