Returns an array of properties suitable for generating a quickforms element
@param base_task $task
@param renderer_base $output
@return array (element, name, label, options, attributes)
4918
public function get_element_properties(base_task $task = null, renderer_base $output = null) {
        return ['element' => 'defaultcustom'] + parent::get_element_properties($task, $output);
    }
1218897
public function export_for_template(renderer_base $output) {
        $data = new stdClass();

        $planstoreview = array();
        foreach ($this->planstoreview['plans'] as $plandata) {
            $planexporter = new plan_exporter($plandata->plan, array('template' => $plandata->template));
            $userexporter = new user_summary_exporter($plandata->owner);
            $planstoreview[] = array(
                'plan' => $planexporter->export($output),
                'user' => $userexporter->export($output),
            );
        }

        $data = array(
            'plans' => $planstoreview,
            'pluginbaseurl' => (new moodle_url('/blocks/lp'))->out(false),
        );

        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;
    }
459159
public function export_for_template(renderer_base $output) {
        $data = new stdClass();

        $compstoreview = array();
        foreach ($this->compstoreview['competencies'] as $compdata) {
            $ucexporter = new user_competency_exporter($compdata->usercompetency,
                array('scale' => $compdata->competency->get_scale()));
            $compexporter = new competency_exporter($compdata->competency,
                array('context' => $compdata->competency->get_context()));
            $userexporter = new user_summary_exporter($compdata->user);
            $compstoreview[] = array(
                'usercompetency' => $ucexporter->export($output),
                'competency' => $compexporter->export($output),
                'user' => $userexporter->export($output),
            );
        }

        $data = array(
            'competencies' => $compstoreview,
            'pluginbaseurl' => (new moodle_url('/blocks/lp'))->out(false),
        );

        return $data;
    }
966519
public function export_for_template(\renderer_base $output) {
        $listofroles = [];
        $roleids = json_decode($this->value);
        $viewableroleids = array_intersect($roleids, array_merge($this->viewableroles, $this->assignableroles));

        foreach ($viewableroleids as $id) {
            // If this is a student, we only show a subset of the roles.
            if ($this->editable || array_key_exists($id, $this->profileroles)) {
                $listofroles[] = format_string($this->courseroles[$id]->localname, true, ['context' => $this->context]);
            }
        }

        if (!empty($listofroles)) {
            $this->displayvalue = implode($listofroles, ', ');
        } else if (!empty($roleids) && empty($viewableroleids)) {
            $this->displayvalue = get_string('novisibleroles', 'role');
        } else {
            $this->displayvalue = get_string('noroles', 'role');
        }
        return parent::export_for_template($output);
    }
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;
    }
1019296
protected function get_other_values(renderer_base $output) {
        $context = $this->related['context'];
        $endorsement = $this->related['endorsement'];
        $alignments = $this->related['alignments'];
        $relatedbadges = $this->related['relatedbadges'];

        $values = array(
            'badgeurl' => moodle_url::make_webservice_pluginfile_url($context->id, 'badges', 'badgeimage', $this->data->id, '/',
                'f1')->out(false),
            'alignments' => array(),
            'relatedbadges' => array(),
        );

        if ($endorsement) {
            $endorsementexporter = new endorsement_exporter($endorsement, array('context' => $context));
            $values['endorsement'] = $endorsementexporter->export($output);
        }

        if (!empty($alignments)) {
            foreach ($alignments as $alignment) {
                $alignmentexporter = new alignment_exporter($alignment, array('context' => $context));
                $values['alignments'][] = $alignmentexporter->export($output);
            }
        }

        if (!empty($relatedbadges)) {
            foreach ($relatedbadges as $badge) {
                $relatedexporter = new related_info_exporter($badge, array('context' => $context));
                $values['relatedbadges'][] = $relatedexporter->export($output);
            }
        }

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

        $data->nostrings = $output->notification(get_string('nostringsfound', 'tool_customlang'));
        $data->formurl = $this->translator->handler;
        $data->currentpage = $this->translator->currentpage;
        $data->sesskey = sesskey();
        $data->strings = [];

        if (!empty($this->translator->strings)) {
            $data->hasstrings = true;
            foreach ($this->translator->strings as $string) {
                // Find strings that use placeholders.
                if (preg_match('/\{\$a(->.+)?\}/', $string->master)) {
                    $string->placeholderhelp = $output->help_icon('placeholder', 'tool_customlang',
                            get_string('placeholderwarning', 'tool_customlang'));
                }
                if (!is_null($string->local) and $string->outdated) {
                    $string->outdatedhelp = $output->help_icon('markinguptodate', 'tool_customlang');
                    $string->checkupdated = true;
                }
                if ($string->original !== $string->master) {
                    $string->showoriginalvsmaster = true;
                }
                $string->local = s($string->local);
                $data->strings[] = $string;
            }
        }
        return $data;
    }
16392
public function export_for_template(renderer_base $output) {

        $data = (object) [
            'pluginbaseurl' => (new moodle_url('/admin/tool/policy'))->out(false),
        ];

        $data->policies = array_values($this->policies);
        if (!empty($this->returnurl)) {
            $data->returnurl = $this->returnurl;
        }

        array_walk($data->policies, function($item, $key) {
            $item->policytypestr = get_string('policydoctype'.$item->type, 'tool_policy');
            $item->policyaudiencestr = get_string('policydocaudience'.$item->audience, 'tool_policy');
        });

        return $data;
    }
1187434
public function export_for_template(\renderer_base $output) {
        return array(
            'url'   => clean_param($this->url, PARAM_URL),
            'title' => $this->title,
            'link'  => clean_param($this->link, PARAM_URL),
        );
    }
1046204
protected function get_other_values(renderer_base $output) {
        return [
            'id' => $group->id,
            'urls' => [
                'image' => $imageurl ? $imageurl->out(false) : null
            ]
        ];
    }
1204337
public function export_for_template(\renderer_base $output) {
        $result = (object) [
            'name'  => $this->tour->get_tour_key(),
            'steps' => [],
        ];

        foreach ($this->tour->get_steps() as $step) {
            $result->steps[] = (new step($step))->export_for_template($output);
        }

        return $result;
    }
631724
public function export_for_template(renderer_base $output) {
        global $SITE;

        $sitename = format_string($SITE->fullname);
        $formhtml = $this->form->render();
        $error = $this->errormessage;

        $context = [
            'sitename' => $sitename,
            'formhtml' => $formhtml,
            'error'    => $error
        ];

        return $context;
    }
58687
protected function get_other_values(renderer_base $output) {
        $author = $this->author;
        $authorcontextid = $this->authorcontextid;
        $urlfactory = $this->related['urlfactory'];

        if ($this->canview) {
            $groups = array_map(function($group) {
                $imageurl = get_group_picture_url($group, $group->courseid);
                return [
                    'id' => $group->id,
                    'name' => $group->name,
                    'urls' => [
                        'image' => $imageurl ? $imageurl->out(false) : null
                    ]
                ];
            }, $this->authorgroups);

            return [
                'id' => $author->get_id(),
                'fullname' => $author->get_full_name(),
                'groups' => $groups,
                'urls' => [
                    'profile' => ($urlfactory->get_author_profile_url($author))->out(false),
                    'profileimage' => ($urlfactory->get_author_profile_image_url($author, $authorcontextid))->out(false)
                ]
            ];
        } else {
            // The author should be anonymised.
            return [
                'id' => null,
                'fullname' => get_string('forumauthorhidden', 'mod_forum'),
                'groups' => [],
                'urls' => [
                    'profile' => null,
                    'profileimage' => null
                ]
            ];
        }
    }
1028629
public function export_for_template(renderer_base $output) {
        global $CFG, $USER;

        $export = new stdClass();
        $export->userid = $this->userid;
        $export->assignmentid = $this->assignment->get_instance()->id;
        $export->cmid = $this->assignment->get_course_module()->id;
        $export->contextid = $this->assignment->get_context()->id;
        $export->groupid = $this->groupid;
        $export->name = $this->assignment->get_context()->get_context_name();
        $export->courseid = $this->assignment->get_course()->id;
        $export->participants = array();
        $export->filters = $this->assignment->get_filters();
        $export->markingworkflowfilters = $this->assignment->get_marking_workflow_filters(true);
        $export->hasmarkingworkflow = count($export->markingworkflowfilters) > 0;
        $export->markingallocationfilters = $this->assignment->get_marking_allocation_filters(true);
        $export->hasmarkingallocation = count($export->markingallocationfilters) > 0;

        $num = 1;
        foreach ($this->participants as $idx => $record) {
            $user = new stdClass();
            $user->id = $record->id;
            $user->fullname = fullname($record);
            $user->requiregrading = $record->requiregrading;
            $user->grantedextension = $record->grantedextension;
            $user->submitted = $record->submitted;
            if (!empty($record->groupid)) {
                $user->groupid = $record->groupid;
                $user->groupname = $record->groupname;
            }
            if ($record->id == $this->userid) {
                $export->index = $num;
                $user->current = true;
            }
            $export->participants[] = $user;
            $num++;
        }

        $feedbackplugins = $this->assignment->get_feedback_plugins();
        $showreview = false;
        foreach ($feedbackplugins as $plugin) {
            if ($plugin->is_enabled() && $plugin->is_visible()) {
                if ($plugin->supports_review_panel()) {
                    $showreview = true;
                }
            }
        }

        $export->actiongrading = 'grading';
        $export->viewgrading = get_string('viewgrading', 'mod_assign');

        $export->showreview = $showreview;

        $time = time();
        $export->count = count($export->participants);
        $export->coursename = $this->assignment->get_course_context()->get_context_name();
        $export->caneditsettings = has_capability('mod/assign:addinstance', $this->assignment->get_context());
        $export->duedate = $this->assignment->get_instance()->duedate;
        $export->duedatestr = userdate($this->assignment->get_instance()->duedate);

        // Time remaining.
        $due = '';
        if ($export->duedate - $time <= 0) {
            $due = get_string('assignmentisdue', 'assign');
        } else {
            $due = get_string('timeremainingcolon', 'assign', format_time($export->duedate - $time));
        }
        $export->timeremainingstr = $due;

        if ($export->duedate < $time) {
            $export->cutoffdate = $this->assignment->get_instance()->cutoffdate;
            $cutoffdate = $export->cutoffdate;
            if ($cutoffdate) {
                if ($cutoffdate > $time) {
                    $late = get_string('latesubmissionsaccepted', 'assign', userdate($export->cutoffdate));
                } else {
                    $late = get_string('nomoresubmissionsaccepted', 'assign');
                }
                $export->cutoffdatestr = $late;
            }
        }

        $export->defaultsendnotifications = $this->assignment->get_instance()->sendstudentnotifications;
        $export->rarrow = $output->rarrow();
        $export->larrow = $output->larrow();
        // List of identity fields to display (the user info will not contain any fields the user cannot view anyway).
        $export->showuseridentity = $CFG->showuseridentity;
        $export->currentuserid = $USER->id;
        $helpicon = new \help_icon('sendstudentnotifications', 'assign');
        $export->helpicon = $helpicon->export_for_template($output);
        return $export;
    }
930610
protected function get_other_values(renderer_base $output) {
        $values = [];

        $formattedbases = [];
        $lawfulbases = explode(',', $this->persistent->get('lawfulbases'));
        if (!empty($lawfulbases)) {
            foreach ($lawfulbases as $basis) {
                if (empty(trim($basis))) {
                    continue;
                }
                $formattedbases[] = (object)[
                    'name' => get_string($basis . '_name', 'tool_dataprivacy'),
                    'description' => get_string($basis . '_description', 'tool_dataprivacy')
                ];
            }
        }
        $values['formattedlawfulbases'] = $formattedbases;

        $formattedsensitivereasons = [];
        $sensitivereasons = explode(',', $this->persistent->get('sensitivedatareasons'));
        if (!empty($sensitivereasons)) {
            foreach ($sensitivereasons as $reason) {
                if (empty(trim($reason))) {
                    continue;
                }
                $formattedsensitivereasons[] = (object)[
                    'name' => get_string($reason . '_name', 'tool_dataprivacy'),
                    'description' => get_string($reason . '_description', 'tool_dataprivacy')
                ];
            }
        }
        $values['formattedsensitivedatareasons'] = $formattedsensitivereasons;

        $retentionperiod = $this->persistent->get('retentionperiod');
        if ($retentionperiod) {
            $formattedtime = \tool_dataprivacy\api::format_retention_period(new \DateInterval($retentionperiod));
        } else {
            $formattedtime = get_string('retentionperiodnotdefined', 'tool_dataprivacy');
        }
        $values['formattedretentionperiod'] = $formattedtime;

        $values['roleoverrides'] = !empty($this->persistent->get_purpose_overrides());

        return $values;
    }
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;
    }