Assign values to the defined other properties.

@param renderer_base $output The output renderer object.
@return array
@throws coding_exception
@throws dml_exception
@throws moodle_exception
490691
protected function get_other_values(renderer_base $output) {
        $values = [];

        $foruserid = $this->persistent->get('userid');
        $user = core_user::get_user($foruserid, '*', MUST_EXIST);
        $userexporter = new user_summary_exporter($user);
        $values['foruser'] = $userexporter->export($output);

        $requestedbyid = $this->persistent->get('requestedby');
        if ($requestedbyid != $foruserid) {
            $user = core_user::get_user($requestedbyid, '*', MUST_EXIST);
            $userexporter = new user_summary_exporter($user);
            $values['requestedbyuser'] = $userexporter->export($output);
        } else {
            $values['requestedbyuser'] = $values['foruser'];
        }

        if (!empty($this->persistent->get('dpo'))) {
            $dpoid = $this->persistent->get('dpo');
            $user = core_user::get_user($dpoid, '*', MUST_EXIST);
            $userexporter = new user_summary_exporter($user);
            $values['dpouser'] = $userexporter->export($output);
        }

        $values['messagehtml'] = text_to_html($this->persistent->get('comments'));

        $requesttype = $this->persistent->get('type');
        $values['typename'] = helper::get_request_type_string($requesttype);
        $values['typenameshort'] = helper::get_shortened_request_type_string($requesttype);

        $values['canreview'] = false;
        $values['approvedeny'] = false;
        $values['statuslabel'] = helper::get_request_status_string($this->persistent->get('status'));

        switch ($this->persistent->get('status')) {
            case api::DATAREQUEST_STATUS_PENDING:
                $values['statuslabelclass'] = 'badge-info';
                // Request can be manually completed for general enquiry requests.
                $values['canmarkcomplete'] = $requesttype == api::DATAREQUEST_TYPE_OTHERS;
                break;
            case api::DATAREQUEST_STATUS_AWAITING_APPROVAL:
                $values['statuslabelclass'] = 'badge-info';
                // DPO can review the request once it's ready.
                $values['canreview'] = true;
                // Whether the DPO can approve or deny the request.
                $values['approvedeny'] = in_array($requesttype, [api::DATAREQUEST_TYPE_EXPORT, api::DATAREQUEST_TYPE_DELETE]);
                // If the request's type is delete, check if user have permission to approve/deny it.
                if ($requesttype == api::DATAREQUEST_TYPE_DELETE) {
                    $values['approvedeny'] = api::can_create_data_deletion_request_for_other();
                }
                break;
            case api::DATAREQUEST_STATUS_APPROVED:
                $values['statuslabelclass'] = 'badge-info';
                break;
            case api::DATAREQUEST_STATUS_PROCESSING:
                $values['statuslabelclass'] = 'badge-info';
                break;
            case api::DATAREQUEST_STATUS_COMPLETE:
            case api::DATAREQUEST_STATUS_DOWNLOAD_READY:
            case api::DATAREQUEST_STATUS_DELETED:
                $values['statuslabelclass'] = 'badge-success';
                break;
            case api::DATAREQUEST_STATUS_CANCELLED:
                $values['statuslabelclass'] = 'badge-warning';
                break;
            case api::DATAREQUEST_STATUS_REJECTED:
                $values['statuslabelclass'] = 'badge-danger';
                break;
            case api::DATAREQUEST_STATUS_EXPIRED:
                $values['statuslabelclass'] = 'badge-secondary';
                break;
        }

        return $values;
    }
1086529
protected function get_other_values(renderer_base $output) {
        $daytimestamp = $this->calendar->time;
        $timestamp = $this->data[0];
        // Need to account for user's timezone.
        $usernow = usergetdate(time());
        $today = new \DateTimeImmutable();
        // The start time should use the day's date but the current
        // time of the day (adjusted for user's timezone).
        $neweventstarttime = $today->setTimestamp($timestamp)->setTime(
            $usernow['hours'],
            $usernow['minutes'],
            $usernow['seconds']
        );

        $return = [
            'timestamp' => $timestamp,
            'neweventtimestamp' => $neweventstarttime->getTimestamp(),
            'previousperiod' => $this->get_previous_day_timestamp($daytimestamp),
            'nextperiod' => $this->get_next_day_timestamp($daytimestamp),
            'navigation' => $this->get_navigation(),
            'viewdaylink' => $this->url->out(false),
        ];


        $cache = $this->related['cache'];
        $eventexporters = array_map(function($event) use ($cache, $output) {
            $context = $cache->get_context($event);
            $course = $cache->get_course($event);
            $moduleinstance = $cache->get_module_instance($event);
            $exporter = new calendar_event_exporter($event, [
                'context' => $context,
                'course' => $course,
                'moduleinstance' => $moduleinstance,
                'daylink' => $this->url,
                'type' => $this->related['type'],
                'today' => $this->data[0],
            ]);

            return $exporter;
        }, $this->related['events']);

        $return['events'] = array_map(function($exporter) use ($output) {
            return $exporter->export($output);
        }, $eventexporters);

        $return['hasevents'] = !empty($return['events']);

        $return['calendareventtypes'] = array_map(function($exporter) {
            return $exporter->get_calendar_event_type();
        }, $eventexporters);
        $return['calendareventtypes'] = array_values(array_unique($return['calendareventtypes']));

        $return['haslastdayofevent'] = false;
        foreach ($return['events'] as $event) {
            if ($event->islastday) {
                $return['haslastdayofevent'] = true;
                break;
            }
        }

        return $return;
    }
757886
public function export_for_template(renderer_base $output) {
        $tabs = [];
        $secondrow = false;

        foreach ($this->subtree as $tab) {
            $tabs[] = $tab->export_for_template($output);
            if (!empty($tab->subtree) && ($tab->level == 0 || $tab->selected || $tab->activated)) {
                $secondrow = new tabtree($tab->subtree);
            }
        }

        return (object) [
            'tabs' => $tabs,
            'secondrow' => $secondrow ? $secondrow->export_for_template($output) : false
        ];
    }
953943
protected function get_other_values(renderer_base $output) {
        $return = parent::get_other_values($output);

        if ($popovertitle = $this->get_popover_title()) {
            $return['popovertitle'] = $popovertitle;
        }

        return $return;
    }
815313
public function export_for_template(renderer_base $output) {
        $contextlevels = [
            'contextlevelname10' => CONTEXT_SYSTEM,
            'contextlevelname30' => CONTEXT_USER,
            'contextlevelname40' => CONTEXT_COURSECAT,
            'contextlevelname50' => CONTEXT_COURSE,
            'contextlevelname70' => CONTEXT_MODULE,
            'contextlevelname80' => CONTEXT_BLOCK
        ];

        $data = [];
        $context = \context_system::instance();

        foreach ($contextlevels as $levelname => $level) {
            $classname = \context_helper::get_class_for_level($level);
            list($purposevar, $categoryvar) = \tool_dataprivacy\data_registry::var_names_from_context($classname);
            $purposeid = get_config('tool_dataprivacy', $purposevar);
            $categoryid = get_config('tool_dataprivacy', $categoryvar);

            $section = [];
            $section['contextname'] = get_string($levelname, 'tool_dataprivacy');

            if (empty($purposeid)) {
                list($purposeid, $categoryid) =
                        \tool_dataprivacy\data_registry::get_effective_default_contextlevel_purpose_and_category($level);
            }
            if ($purposeid == -1) {
                $purposeid = 0;
            }
            $purpose = new \tool_dataprivacy\purpose($purposeid);
            $export = new \tool_dataprivacy\external\purpose_exporter($purpose, ['context' => $context]);
            $purposedata = $export->export($output);
            $section['purpose'] = $purposedata;

            if (empty($categoryid)) {
                list($purposeid, $categoryid) =
                        \tool_dataprivacy\data_registry::get_effective_default_contextlevel_purpose_and_category($level);
            }
            if ($categoryid == -1) {
                $categoryid = 0;
            }
            $category = new \tool_dataprivacy\category($categoryid);
            $export = new \tool_dataprivacy\external\category_exporter($category, ['context' => $context]);
            $categorydata = $export->export($output);
            $section['category'] = $categorydata;
            $data['contexts'][] = $section;
        }

        // Get activity module plugin info.
        $pluginmanager = \core_plugin_manager::instance();
        $modplugins = $pluginmanager->get_enabled_plugins('mod');

        foreach ($modplugins as $name) {
            $classname = \context_helper::get_class_for_level($contextlevels['contextlevelname70']);
            list($purposevar, $categoryvar) = \tool_dataprivacy\data_registry::var_names_from_context($classname, $name);
            $categoryid = get_config('tool_dataprivacy', $categoryvar);
            $purposeid = get_config('tool_dataprivacy', $purposevar);
            if ($categoryid === false && $purposeid === false) {
                // If no purpose and category has been set for this plugin, then there's no need to show this on the list.
                continue;
            }

            $section = [];
            $section['contextname'] = $pluginmanager->plugin_name('mod_' . $name);

            if ($purposeid == -1) {
                $purposeid = 0;
            }
            $purpose = new \tool_dataprivacy\purpose($purposeid);
            $export = new \tool_dataprivacy\external\purpose_exporter($purpose, ['context' => $context]);
            $purposedata = $export->export($output);
            $section['purpose'] = $purposedata;

            if ($categoryid == -1) {
                $categoryid = 0;
            }
            $category = new \tool_dataprivacy\category($categoryid);
            $export = new \tool_dataprivacy\external\category_exporter($category, ['context' => $context]);
            $categorydata = $export->export($output);
            $section['category'] = $categorydata;

            $data['contexts'][] = $section;
        }

        return $data;
    }
67789
public function export_for_template(renderer_base $output) {
        $data = new stdClass();

        $keyhelp = new help_icon('resourcekey', 'mod_lti');
        $secrethelp = new help_icon('password', 'mod_lti');

        $url = new moodle_url('/mod/lti/typessettings.php', array('sesskey' => sesskey(), 'returnto' => 'toolconfigure'));
        $data->configuremanualurl = $url->out();
        $url = new moodle_url('/admin/settings.php?section=modsettinglti');
        $data->managetoolsurl = $url->out();
        $url = new moodle_url('/mod/lti/toolproxies.php');
        $data->managetoolproxiesurl = $url->out();
        $data->keyhelp = $keyhelp->export_for_template($output);
        $data->secrethelp = $secrethelp->export_for_template($output);
        return $data;
    }
828291
public function export_for_template(\renderer_base $output) {
        global $PAGE;
        $courserenderer = $PAGE->get_renderer('core', 'course');
        $this->displayvalue = $courserenderer->course_section_cm_name_title($this->cm, $this->displayoptions);
        if (strval($this->displayvalue) === '') {
            $this->editable = false;
        }
        return parent::export_for_template($output);
    }
1303035
public function export_for_template(\renderer_base $output) {

        $components = [];

        foreach ($this->models as $componentname => $modelslist) {
            $component = [
                'name' => $this->component_name($componentname),
                'component' => $componentname,
                'models' => [],
            ];

            foreach ($modelslist as $definition) {
                list($target, $indicators) = \core_analytics\manager::get_declared_target_and_indicators_instances($definition);

                if (\core_analytics\model::exists($target, $indicators)) {
                    continue;
                }

                $targetnamelangstring = $target->get_name();

                $model = [
                    'defid' => \core_analytics\manager::model_declaration_identifier($definition),
                    'targetname' => $targetnamelangstring,
                    'targetclass' => $definition['target'],
                    'indicatorsnum' => count($definition['indicators']),
                    'indicators' => [],
                ];

                if (get_string_manager()->string_exists($targetnamelangstring->get_identifier().'_help',
                        $targetnamelangstring->get_component())) {
                    $helpicon = new \help_icon($targetnamelangstring->get_identifier(), $targetnamelangstring->get_component());
                    $model['targethelp'] = $helpicon->export_for_template($output);
                }

                foreach ($indicators as $indicator) {
                    $indicatornamelangstring = $indicator->get_name();
                    $indicatordata = [
                        'name' => $indicatornamelangstring,
                        'classname' => $indicator->get_id(),
                    ];

                    if (get_string_manager()->string_exists($indicatornamelangstring->get_identifier().'_help',
                            $indicatornamelangstring->get_component())) {
                        $helpicon = new \help_icon($indicatornamelangstring->get_identifier(),
                            $indicatornamelangstring->get_component());
                        $indicatordata['indicatorhelp'] = $helpicon->export_for_template($output);
                    }

                    $model['indicators'][] = $indicatordata;
                }

                $component['models'][] = $model;
            }

            if (!empty($component['models'])) {
                $components[] = $component;
            }
        }

        $result = [
            'hasdata' => !empty($components),
            'components' => array_values($components),
            'submiturl' => new \moodle_url('/admin/tool/analytics/restoredefault.php'),
            'backurl' => new \moodle_url('/admin/tool/analytics/index.php'),
            'sesskey' => sesskey(),
        ];

        return $result;
    }
665287
public function export_for_template(renderer_base $output) {
        global $USER;

        $nocoursesurl = $output->image_url('courses', 'block_recentlyaccessedcourses')->out(false);

        return [
            'userid' => $USER->id,
            'nocoursesimgurl' => $nocoursesurl,
            'pagingbar' => [
                'next' => true,
                'previous' => true
            ]
        ];
    }
704640
public function export_for_template(\renderer_base $output) {
        $data = new \stdClass();
        if ($this->prevlink) {
            $data->prevlink = $this->prevlink->export_for_template($output);
        }

        if ($this->nextlink) {
            $data->nextlink = $this->nextlink->export_for_template($output);
        }

        if ($this->activitylist) {
            $data->activitylist = $this->activitylist->export_for_template($output);
        }

        return $data;
    }
453478
public function export_for_template(renderer_base $output) {
        $data = new stdClass();
        $data->pagecontextid = $this->pagecontext->id;
        $data->templates = array();
        foreach ($this->templates as $template) {
            $exporter = new template_exporter($template);
            $data->templates[] = $exporter->export($output);
        }
        $data->pluginbaseurl = (new moodle_url('/admin/tool/lp'))->out(true);
        $data->navigation = array();
        foreach ($this->navigation as $button) {
            $data->navigation[] = $output->render($button);
        }
        $data->canmanage = template::can_manage_context($this->pagecontext);

        return $data;
    }
866709
protected function get_other_values(renderer_base $output) {
        $capabilitymanager = $this->related['capabilitymanager'];
        $urlfactory = $this->related['urlfactory'];
        $user = $this->related['user'];
        $currentgroup = $this->related['currentgroup'];
        $vaultfactory = $this->related['vaultfactory'];
        $discussionvault = $vaultfactory->get_discussions_in_forum_vault();

        return [
            'id' => $this->forum->get_id(),
            'state' => [
                'groupmode' => $this->forum->get_effective_group_mode(),
            ],
            'userstate' => [
                'tracked' => forum_tp_is_tracked($this->get_forum_record(), $this->related['user']),
            ],
            'capabilities' => [
                'viewdiscussions' => $capabilitymanager->can_view_discussions($user),
                'create' => $capabilitymanager->can_create_discussions($user, $currentgroup),
                'subscribe' => $capabilitymanager->can_subscribe_to_forum($user),
            ],
            'urls' => [
                'create' => $urlfactory->get_discussion_create_url($this->forum)->out(false),
                'markasread' => $urlfactory->get_mark_all_discussions_as_read_url($this->forum)->out(false),
                'view' => $urlfactory->get_forum_view_url_from_forum($this->forum)->out(false),
                'sortrepliesasc' => $urlfactory->get_forum_view_url_from_forum($this->forum, null,
                    $discussionvault::SORTORDER_REPLIES_ASC)->out(false),
                'sortrepliesdesc' => $urlfactory->get_forum_view_url_from_forum($this->forum, null,
                    $discussionvault::SORTORDER_REPLIES_DESC)->out(false),
                'sortlastpostasc' => $urlfactory->get_forum_view_url_from_forum($this->forum, null,
                    $discussionvault::SORTORDER_LASTPOST_ASC)->out(false),
                'sortlastpostdesc' => $urlfactory->get_forum_view_url_from_forum($this->forum, null,
                    $discussionvault::SORTORDER_LASTPOST_DESC)->out(false),
                'sortcreatedasc' => $urlfactory->get_forum_view_url_from_forum($this->forum, null,
                    $discussionvault::SORTORDER_CREATED_ASC)->out(false),
                'sortcreateddesc' => $urlfactory->get_forum_view_url_from_forum($this->forum, null,
                    $discussionvault::SORTORDER_CREATED_DESC)->out(false)
            ],
        ];
    }
1359854
public function export_for_template(\renderer_base $output) {
        global $PAGE;
        $step = $this->step;

        $result = (object) [
            'stepid'    => $step->get_id(),
            'title'     => external_format_text(
                    stepsource::get_string_from_input($step->get_title()),
                    FORMAT_HTML,
                    $PAGE->context->id,
                    'tool_usertours'
                )[0],
            'content'   => external_format_text(
                    stepsource::get_string_from_input($step->get_content()),
                    FORMAT_HTML,
                    $PAGE->context->id,
                    'tool_usertours'
                )[0],
            'element'   => $step->get_target()->convert_to_css(),
        ];

        $result->content = str_replace("\n", "<br>\n", $result->content);

        foreach ($step->get_config_keys() as $key) {
            $result->$key = $step->get_config($key);
        }

        return $result;
    }
1017002
protected function get_other_values(renderer_base $output) {
        $timestamp = $this->calendar->time;

        $cache = $this->related['cache'];
        $url = new moodle_url('/calendar/view.php', [
            'view' => 'upcoming',
            'time' => $timestamp,
            'course' => $this->calendar->course->id,
        ]);
        $this->url = $url;
        $return['isloggedin'] = isloggedin();
        $return['events'] = array_map(function($event) use ($cache, $output, $url) {
            $context = $cache->get_context($event);
            $course = $cache->get_course($event);
            $moduleinstance = $cache->get_module_instance($event);
            $exporter = new calendar_event_exporter($event, [
                'context' => $context,
                'course' => $course,
                'moduleinstance' => $moduleinstance,
                'daylink' => $url,
                'type' => $this->related['type'],
                'today' => $this->calendar->time,
            ]);

            $data = $exporter->export($output);

            // We need to override default formatted time because it differs from day view.
            // Formatted time for upcoming view adds a link to the day view.
            $legacyevent = container::get_event_mapper()->from_event_to_legacy_event($event);
            $data->formattedtime = calendar_format_event_time($legacyevent, time(), null);

            return $data;
        }, $this->related['events']);

        if ($context = $this->get_default_add_context()) {
            $return['defaulteventcontext'] = $context->id;
        }
        $return['filter_selector'] = $this->get_course_filter_selector($output);
        $return['courseid'] = $this->calendar->courseid;

        if ($this->calendar->categoryid) {
            $return['categoryid'] = $this->calendar->categoryid;
        }

        return $return;
    }
1046204
protected function get_other_values(renderer_base $output) {
        return [
            'id' => $group->id,
            'urls' => [
                'image' => $imageurl ? $imageurl->out(false) : null
            ]
        ];
    }
1091570
public function export_for_template(renderer_base $output) {
        $related = array(
            'context' => $this->framework->get_context(),
            'framework' => $this->framework,
            'linkedcourses' => $this->courses,
            'relatedcompetencies' => $this->relatedcompetencies,
            'competency' => $this->competency
        );

        $exporter = new competency_summary_exporter($this->competency, $related);
        $data = $exporter->export($output);

        return $data;
    }
1084528
public function export_for_template(renderer_base $output) {
        global $SITE, $CFG;

        $sitename = format_string($SITE->fullname);
        $supportname = $CFG->supportname;
        $supportemail = $CFG->supportemail;

        $context = [
            'sitename' => $sitename,
            'supportname' => $supportname,
            'supportemail' => $supportemail,
            'homelink' => new \moodle_url('/')
        ];

        return $context;
    }