@param $template
@param $output
@param $position
@return array

Converting html file into AST in PHP array
487718
private function PregCapture(&$template, &$output, &$position)
    {
        while (preg_match(ISlicer::PATTERN, $template, $result, PREG_OFFSET_CAPTURE, $position) > 0) {

            $capture = new PregOffsetCapture($result);

            $lex = array();
            $lex['text'] = substr($template, $position, $capture->SliceBegin() - $position);

            $lex['start'] = $capture->SliceBegin();
            $lex['end'] = $capture->SliceEnd();
            $lex['length'] = $capture->SliceLength();
            $lex['flag'] = $capture->Capture(ISlicer::FLAG);
            $lex['inverse'] = $capture->Capture(ISlicer::INVERSE);
            $lex['key'] = $capture->Capture(ISlicer::KEY);
            $lex['param'] = $capture->Capture(ISlicer::PARAMETER);

            $position = $lex['end'];

            if ($capture->Capture(ISlicer::FLAG) === ISlicer::C_CLOSE) {
                $output[] = $lex;
                break;
            }
            $a = $capture->Capture(ISlicer::BEFORE) === ISlicer::A;
            $b = $capture->Capture(ISlicer::AFTER) === ISlicer::H;
            if ($a && $b) {
                $this->PregCapture($template, $lex['child'], $position);
            } else {
                unset($lex['child']);
            }
            $output[] = $lex;
        }

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

        $data = new stdClass();
        $data->courseid = $this->courseid;
        $data->pagecontextid = $this->context->id;
        $data->competencies = array();
        $data->pluginbaseurl = (new moodle_url('/admin/tool/lp'))->out(true);

        $gradable = is_enrolled($this->context, $USER, 'moodle/competency:coursecompetencygradable');
        if ($gradable) {
            $usercompetencycourses = api::list_user_competencies_in_course($this->courseid, $USER->id);
            $data->gradableuserid = $USER->id;
        }

        $ruleoutcomelist = course_competency::get_ruleoutcome_list();
        $ruleoutcomeoptions = array();
        foreach ($ruleoutcomelist as $value => $text) {
            $ruleoutcomeoptions[$value] = array('value' => $value, 'text' => (string) $text, 'selected' => false);
        }

        $helper = new performance_helper();
        foreach ($this->coursecompetencylist as $coursecompetencyelement) {
            $coursecompetency = $coursecompetencyelement['coursecompetency'];
            $competency = $coursecompetencyelement['competency'];
            $context = $helper->get_context_from_competency($competency);

            $compexporter = new competency_exporter($competency, array('context' => $context));
            $ccexporter = new course_competency_exporter($coursecompetency, array('context' => $context));

            $ccoutcomeoptions = (array) (object) $ruleoutcomeoptions;
            $ccoutcomeoptions[$coursecompetency->get('ruleoutcome')]['selected'] = true;

            $coursemodules = api::list_course_modules_using_competency($competency->get('id'), $this->courseid);

            $fastmodinfo = get_fast_modinfo($this->courseid);
            $exportedmodules = array();
            foreach ($coursemodules as $cmid) {
                $cminfo = $fastmodinfo->cms[$cmid];
                $cmexporter = new course_module_summary_exporter(null, array('cm' => $cminfo));
                $exportedmodules[] = $cmexporter->export($output);
            }
            // Competency path.
            $pathexporter = new competency_path_exporter([
                'ancestors' => $competency->get_ancestors(),
                'framework' => $helper->get_framework_from_competency($competency),
                'context' => $context
            ]);

            // User learning plans.
            $plans = api::list_plans_with_competency($USER->id, $competency);
            $exportedplans = array();
            foreach ($plans as $plan) {
                $planexporter = new plan_exporter($plan, array('template' => $plan->get_template()));
                $exportedplans[] = $planexporter->export($output);
            }

            $onerow = array(
                'competency' => $compexporter->export($output),
                'coursecompetency' => $ccexporter->export($output),
                'ruleoutcomeoptions' => $ccoutcomeoptions,
                'coursemodules' => $exportedmodules,
                'comppath' => $pathexporter->export($output),
                'plans' => $exportedplans
            );
            if ($gradable) {
                $foundusercompetencycourse = false;
                foreach ($usercompetencycourses as $usercompetencycourse) {
                    if ($usercompetencycourse->get('competencyid') == $competency->get('id')) {
                        $foundusercompetencycourse = $usercompetencycourse;
                    }
                }
                if ($foundusercompetencycourse) {
                    $related = array(
                        'scale' => $helper->get_scale_from_competency($competency)
                    );
                    $exporter = new user_competency_course_exporter($foundusercompetencycourse, $related);
                    $onerow['usercompetencycourse'] = $exporter->export($output);
                }
            }
            array_push($data->competencies, $onerow);
        }

        $data->canmanagecompetencyframeworks = $this->canmanagecompetencyframeworks;
        $data->canmanagecoursecompetencies = $this->canmanagecoursecompetencies;
        $data->canconfigurecoursecompetencies = $this->canconfigurecoursecompetencies;
        $data->cangradecompetencies = $this->cangradecompetencies;
        $exporter = new course_competency_settings_exporter($this->coursecompetencysettings);
        $data->settings = $exporter->export($output);
        $related = array('context' => $this->context);
        $exporter = new course_competency_statistics_exporter($this->coursecompetencystatistics, $related);
        $data->statistics = $exporter->export($output);
        $data->manageurl = null;
        if ($this->canmanagecompetencyframeworks) {
            $data->manageurl = $this->manageurl->out(true);
        }

        return $data;
    }
667374
public function byPosition($position)
	{
		$position = strtolower($position);
		$result   = array();

		$modules = $this->all();

		$total = count($modules);
		for ($i = 0; $i < $total; $i++)
		{
			if ($modules[$i]->position == $position)
			{
				$result[] =& $modules[$i];
			}
		}

		if (count($result) == 0)
		{
			if ($this->outline())
			{
				$result[0] = $this->byName('mod_' . $position);
				$result[0]->title    = $position;
				$result[0]->content  = $position;
				$result[0]->position = $position;
			}
		}

		return $result;
	}
743741
public function export_for_template(renderer_base $output) {
        global $CFG;
        require_once($CFG->libdir . '/externallib.php');

        $r = new stdClass();
        $r->id = (int)$this->record->id;
        $r->tagcollid = clean_param($this->record->tagcollid, PARAM_INT);
        $r->rawname = clean_param($this->record->rawname, PARAM_TAG);
        $r->name = clean_param($this->record->name, PARAM_TAG);
        $format = clean_param($this->record->descriptionformat, PARAM_INT);
        list($r->description, $r->descriptionformat) = external_format_text($this->record->description,
            $format, \context_system::instance()->id, 'core', 'tag', $r->id);
        $r->flag = clean_param($this->record->flag, PARAM_INT);
        if (isset($this->record->isstandard)) {
            $r->isstandard = clean_param($this->record->isstandard, PARAM_INT) ? 1 : 0;
        }
        $r->official = $r->isstandard; // For backwards compatibility.

        $url = core_tag_tag::make_url($r->tagcollid, $r->rawname);
        $r->viewurl = $url->out(false);

        return $r;
    }
194194
public function export_for_template(renderer_base $output) {
        $data = new stdClass();
        $attributes = $this->attributes;

        if (empty($attributes['id'])) {
            $attributes['id'] = html_writer::random_id('action_link');
        }
        $data->id = $attributes['id'];
        unset($attributes['id']);

        $data->disabled = !empty($attributes['disabled']);
        unset($attributes['disabled']);

        $data->text = $this->text instanceof renderable ? $output->render($this->text) : (string) $this->text;
        $data->url = $this->url ? $this->url->out(false) : '';
        $data->icon = $this->icon ? $this->icon->export_for_pix() : null;
        $data->classes = isset($attributes['class']) ? $attributes['class'] : '';
        unset($attributes['class']);

        $data->attributes = array_map(function($key, $value) {
            return [
                'name' => $key,
                'value' => $value
            ];
        }, array_keys($attributes), $attributes);

        $data->actions = array_map(function($action) use ($output) {
            return $action->export_for_template($output);
        }, !empty($this->actions) ? $this->actions : []);
        $data->hasactions = !empty($this->actions);

        return $data;
    }
345772
public function export_for_template(renderer_base $output) {
        global $PAGE;

        $params = [\context_system::instance()->id, $this->defaultcontextlevel, $this->defaultcontextid];
        $PAGE->requires->js_call_amd('tool_dataprivacy/data_registry', 'init', $params);

        $data = new stdClass();
        $defaultsbutton = new \action_link(
            new \moodle_url('/admin/tool/dataprivacy/defaults.php'),
            get_string('setdefaults', 'tool_dataprivacy'),
            null,
            ['class' => 'btn btn-primary']
        );
        $data->defaultsbutton = $defaultsbutton->export_for_template($output);

        $actionmenu = new \action_menu();
        $actionmenu->set_menu_trigger(get_string('edit'), 'btn btn-primary');
        $actionmenu->set_owner_selector('dataregistry-actions');
        $actionmenu->set_alignment(\action_menu::TL, \action_menu::BL);

        $url = new \moodle_url('/admin/tool/dataprivacy/categories.php');
        $categories = new \action_menu_link_secondary($url, null, get_string('categories', 'tool_dataprivacy'));
        $actionmenu->add($categories);

        $url = new \moodle_url('/admin/tool/dataprivacy/purposes.php');
        $purposes = new \action_menu_link_secondary($url, null, get_string('purposes', 'tool_dataprivacy'));
        $actionmenu->add($purposes);

        $data->actions = $actionmenu->export_for_template($output);

        if (!data_registry::defaults_set()) {
            $data->info = (object)[
                    'message' => get_string('dataregistryinfo', 'tool_dataprivacy'),
                    'announce' => 1
            ];
            $data->nosystemdefaults = (object)[
                'message' => get_string('nosystemdefaults', 'tool_dataprivacy'),
                'announce' => 1
            ];
        }

        $data->tree = $this->get_default_tree_structure();

        return $data;
    }
312579
public static function createInvalidArrayPosition($name, array $position)
    {
        return new self(sprintf(
            'The %s form uses position as array or you must define the "before" or "after" option (current: %s).',
            self::decorateValue($name),
            implode(', ', self::decorateValues(array_keys($position)))
        ));
    }
1266910
public function export_for_template(\renderer_base $output) {

        $data = (object)[
            'statusicon' => '',
            'statustext' => '',
            'statuslink' => '',
            'actions' => [],
        ];

        if (count($this->versions) == 1) {
            // We represent one particular policy's agreement status.
            $versionname = reset($this->versions);
            $versionid = key($this->versions);

            $actionaccept = (object)[
                'text' => get_string('useracceptanceactionaccept', 'tool_policy'),
                'title' => get_string('useracceptanceactionacceptone', 'tool_policy', $versionname),
                'data' => 'acceptmodal',
                'url' => (new \moodle_url('/admin/tool/policy/accept.php', [
                    'userids[]' => $this->userid,
                    'versionids[]' => $versionid,
                    'action' => 'accept',
                    'returnurl' => $this->pageurl->out_as_local_url(false),
                ]))->out(false),
            ];

            $actionrevoke = (object)[
                'text' => get_string('useracceptanceactionrevoke', 'tool_policy'),
                'title' => get_string('useracceptanceactionrevokeone', 'tool_policy', $versionname),
                'data' => 'acceptmodal',
                'url' => (new \moodle_url('/admin/tool/policy/accept.php', [
                    'userids[]' => $this->userid,
                    'versionids[]' => $versionid,
                    'action' => 'revoke',
                    'returnurl' => $this->pageurl->out_as_local_url(false),
                ]))->out(false),
            ];

            $actiondecline = (object)[
                'text' => get_string('useracceptanceactiondecline', 'tool_policy'),
                'title' => get_string('useracceptanceactiondeclineone', 'tool_policy', $versionname),
                'data' => 'acceptmodal',
                'url' => (new \moodle_url('/admin/tool/policy/accept.php', [
                    'userids[]' => $this->userid,
                    'versionids[]' => $versionid,
                    'action' => 'decline',
                    'returnurl' => $this->pageurl->out_as_local_url(false),
                ]))->out(false),
            ];

            if ($this->accepted) {
                $data->statusicon = 'agreed';

                if ($this->onbehalf) {
                    $data->statustext = get_string('acceptancestatusacceptedbehalf', 'tool_policy');
                } else {
                    $data->statustext = get_string('acceptancestatusaccepted', 'tool_policy');
                }

                if ($this->canrevoke) {
                    $data->actions[] = $actionrevoke;
                }

            } else if ($this->declined) {
                $data->statusicon = 'declined';

                if ($this->onbehalf) {
                    $data->statustext = get_string('acceptancestatusdeclinedbehalf', 'tool_policy');
                } else {
                    $data->statustext = get_string('acceptancestatusdeclined', 'tool_policy');
                }

                if ($this->canaccept) {
                    $data->actions[] = $actionaccept;
                }

            } else {
                $data->statusicon = 'pending';
                $data->statustext = get_string('acceptancestatuspending', 'tool_policy');

                if ($this->canaccept) {
                    $data->actions[] = $actionaccept;
                    $data->actions[] = $actiondecline;
                }
            }

        } else if (count($this->versions) > 1) {
            // We represent the summary status for multiple policies.

            $data->actions[] = (object)[
                'text' => get_string('useracceptanceactiondetails', 'tool_policy'),
                'url' => (new \moodle_url('/admin/tool/policy/user.php', [
                    'userid' => $this->userid,
                    'returnurl' => $this->pageurl->out_as_local_url(false),
                ]))->out(false),
            ];

            // Prepare the action link to accept all pending policies.
            $accepturl = new \moodle_url('/admin/tool/policy/accept.php', [
                'userids[]' => $this->userid,
                'action' => 'accept',
                'returnurl' => $this->pageurl->out_as_local_url(false),
            ]);

            foreach (array_diff(array_keys($this->versions), $this->accepted, $this->declined) as $ix => $versionid) {
                $accepturl->param('versionids['.$ix.']', $versionid);
            }

            $actionaccept = (object)[
                'text' => get_string('useracceptanceactionaccept', 'tool_policy'),
                'title' => get_string('useracceptanceactionacceptpending', 'tool_policy'),
                'data' => 'acceptmodal',
                'url' => $accepturl->out(false),
            ];

            // Prepare the action link to revoke all agreed policies.
            $revokeurl = new \moodle_url('/admin/tool/policy/accept.php', [
                'userids[]' => $this->userid,
                'action' => 'revoke',
                'returnurl' => $this->pageurl->out_as_local_url(false),
            ]);

            foreach ($this->accepted as $ix => $versionid) {
                $revokeurl->param('versionids['.$ix.']', $versionid);
            }

            $actionrevoke = (object)[
                'text' => get_string('useracceptanceactionrevoke', 'tool_policy'),
                'title' => get_string('useracceptanceactionrevokeall', 'tool_policy'),
                'data' => 'acceptmodal',
                'url' => $revokeurl->out(false),
            ];

            // Prepare the action link to decline all pending policies.
            $declineurl = new \moodle_url('/admin/tool/policy/accept.php', [
                'userids[]' => $this->userid,
                'action' => 'decline',
                'returnurl' => $this->pageurl->out_as_local_url(false),
            ]);

            foreach (array_diff(array_keys($this->versions), $this->accepted, $this->declined) as $ix => $versionid) {
                $declineurl->param('versionids['.$ix.']', $versionid);
            }

            $actiondecline = (object)[
                'text' => get_string('useracceptanceactiondecline', 'tool_policy'),
                'title' => get_string('useracceptanceactiondeclinepending', 'tool_policy'),
                'data' => 'acceptmodal',
                'url' => $declineurl->out(false),
            ];

            $countversions = count($this->versions);
            $countaccepted = count($this->accepted);
            $countdeclined = count($this->declined);

            if ($countaccepted == $countversions) {
                // All policies accepted.
                $data->statusicon = 'agreed';
                $data->statustext = get_string('acceptancestatusaccepted', 'tool_policy');

                if ($this->canrevoke) {
                    $data->actions[] = $actionrevoke;
                }

            } else if ($countdeclined == $countversions) {
                // All policies declined.
                $data->statusicon = 'declined';
                $data->statustext = get_string('acceptancestatusdeclined', 'tool_policy');

            } else if ($countaccepted + $countdeclined == $countversions) {
                // All policies responded, only some of them accepted.
                $data->statusicon = 'partial';
                $data->statustext = get_string('acceptancestatuspartial', 'tool_policy');

                if ($this->accepted && $this->canrevoke) {
                    $data->actions[] = $actionrevoke;
                }

            } else {
                // Some policies are pending.
                $data->statusicon = 'pending';
                $data->statustext = get_string('acceptancestatuspending', 'tool_policy');

                if ($this->canaccept) {
                    $data->actions[] = $actionaccept;
                    $data->actions[] = $actiondecline;
                }
            }
        }

        return $data;
    }
1320959
public function export_for_template(renderer_base $output) {

        $nocoursesurl = $output->image_url('courses', 'block_timeline')->out();
        $noeventsurl = $output->image_url('activities', 'block_timeline')->out();

        $requiredproperties = course_summary_exporter::define_properties();
        $fields = join(',', array_keys($requiredproperties));
        $courses = course_get_enrolled_courses_for_logged_in_user(0, 0, null, $fields);
        list($inprogresscourses, $processedcount) = course_filter_courses_by_timeline_classification(
            $courses,
            COURSE_TIMELINE_INPROGRESS,
            self::COURSES_PER_PAGE
        );
        $formattedcourses = array_map(function($course) use ($output) {
            \context_helper::preload_from_record($course);
            $context = \context_course::instance($course->id);
            $exporter = new course_summary_exporter($course, ['context' => $context]);
            return $exporter->export($output);
        }, $inprogresscourses);

        $filters = $this->get_filters_as_booleans();
        $offsets = $this->get_filter_offsets();
        $contextvariables = [
            'midnight' => usergetmidnight(time()),
            'coursepages' => [$formattedcourses],
            'urls' => [
                'nocourses' => $nocoursesurl,
                'noevents' => $noeventsurl
            ],
            'sorttimelinedates' => $this->order == BLOCK_TIMELINE_SORT_BY_DATES,
            'sorttimelinecourses' => $this->order == BLOCK_TIMELINE_SORT_BY_COURSES,
            'selectedfilter' => $this->filter,
            'hasdaysoffset' => true,
            'hasdayslimit' => $offsets['dayslimit'] !== false ,
            'nodayslimit' => $offsets['dayslimit'] === false ,
            'limit' => $this->limit
        ];
        return array_merge($contextvariables, $filters, $offsets);
    }
252728
public function export_for_template(renderer_base $output) {
        $args = !empty($this->jsfunctionargs) ? json_encode($this->jsfunctionargs) : false;
        return (object) [
            'event' => $this->event,
            'jsfunction' => $this->jsfunction,
            'jsfunctionargs' => $args,
        ];
    }
410031
public function export_for_template(renderer_base $output) {
        // Show newest to oldest.
        $export = (object) $this;
        $export->submissions = array_reverse($export->submissions);
        $export->submissioncount = count($export->submissions);

        foreach ($export->submissions as $i => $submission) {
            $grade = null;
            foreach ($export->grades as $onegrade) {
                if ($onegrade->attemptnumber == $submission->attemptnumber) {
                    $submission->grade = $onegrade;
                    break;
                }
            }
            if (!$submission) {
                $submission = new stdClass();
            }

            $editbtn = '';

            if ($submission->timemodified) {
                $submissionsummary = userdate($submission->timemodified);
            } else {
                $submissionsummary = get_string('nosubmission', 'assign');
            }

            $attemptsummaryparams = array('attemptnumber' => $submission->attemptnumber + 1,
                                          'submissionsummary' => $submissionsummary);
            $submission->attemptsummary = get_string('attemptheading', 'assign', $attemptsummaryparams);
            $submission->statussummary = get_string('submissionstatus_' . $submission->status, 'assign');

        }

        return $export;
    }
1140289
public function render(string $location, string $template = 'platform::partials.mainMenu'): string
    {
        $this->checkAccess();

        return $this->findAllChildren($location)
            ->sortBy('sort')
            ->map(function ($value) use ($template) {
                return view($template, $value)->render();
            })
            ->implode(' ');
    }
751368
public function export_for_template(renderer_base $output) {
        $data = new stdClass();
        $data->newdatarequesturl = new moodle_url('/admin/tool/dataprivacy/createdatarequest.php');
        $data->newdatarequesturl->param('manage', true);

        if (!is_https()) {
            $httpwarningmessage = get_string('httpwarning', 'tool_dataprivacy');
            $data->httpsite = array('message' => $httpwarningmessage, 'announce' => 1);
        }

        $url = new moodle_url('/admin/tool/dataprivacy/datarequests.php');
        $filteroptions = helper::get_request_filter_options();
        $filter = new request_filter($filteroptions, $this->filters, $url);
        $data->filter = $filter->export_for_template($output);

        ob_start();
        $this->table->out($this->table->get_requests_per_page(), true);
        $requests = ob_get_contents();
        ob_end_clean();

        $data->datarequests = $requests;
        return $data;
    }
955185
public function dumpAssets($position = 'top', $echo = true)
    {
        $assetHtml = '';

        /** @var array $files css files */
        if ($files = $this->getAttribute('__cssFiles:' . $position)) {
            foreach ($files as $file) {
                $assetHtml .= '<link href="' . $file . '" rel="stylesheet">' . PHP_EOL;
            }
        }

        /** @var array $codes css codes */
        if ($codes = $this->getAttribute('__cssCodes:' . $position)) {
            $assetHtml .= '<style type="text/css">' . PHP_EOL;
            foreach ($codes as $code) {
                $assetHtml .= $code . PHP_EOL;
            }
            $assetHtml .= '</style>' . PHP_EOL;
        }

        /** @var array $files js files */
        if ($files = $this->getAttribute('__jsFiles:' . $position)) {
            foreach ($files as $file) {
                $assetHtml .= '<script src="' . $file . '"></script>' . PHP_EOL;
            }
        }

        /** @var array $codes js codes */
        if ($codes = $this->getAttribute('__jsCodes:' . $position)) {
            $jsCode = '';

            foreach ($codes as $code) {
                $jsCode .= $code . PHP_EOL;
            }

            if ($jsCode) {
                $assetHtml .= "<script type=\"text/javascript\">\n{$jsCode}</script>\n";
            }
        }

        if (!$echo) {
            return $assetHtml;
        }

        // echo it.
        if ($assetHtml) {
            echo '<!-- dumped assets -->' . PHP_EOL . $assetHtml;
        }

        return null;
    }
1189089
public function export_for_template(\renderer_base $output) {
        $data = array(
            'title' => $this->showtitle ? $this->title : null,
            'image' => null,
            'items' => array(),
        );

        if ($this->showimage && $this->image) {
            $data['image'] = $this->image->export_for_template($output);
        }

        foreach ($this->items as $item) {
            $data['items'][] = $item->export_for_template($output);
        }

        return $data;
    }
533075
public function export_for_template(renderer_base $output) {
        $data = new stdClass();
        $data->template = (new template_exporter($this->template))->export($output);
        $data->pagecontextid = $this->pagecontext->id;
        $data->competencies = array();
        $helper = new performance_helper();
        foreach ($this->competencies as $competency) {
            $context = $helper->get_context_from_competency($competency);
            $framework = $helper->get_framework_from_competency($competency);

            $courses = api::list_courses_using_competency($competency->get('id'));
            $relatedcompetencies = api::list_related_competencies($competency->get('id'));

            $related = array(
                'competency' => $competency,
                'linkedcourses' => $courses,
                'context' => $context,
                'relatedcompetencies' => $relatedcompetencies,
                'framework' => $framework
            );
            $exporter = new competency_summary_exporter(null, $related);
            $record = $exporter->export($output);

            array_push($data->competencies, $record);
        }

        $data->pluginbaseurl = (new moodle_url('/admin/tool/lp'))->out(false);
        $data->canmanagecompetencyframeworks = $this->canmanagecompetencyframeworks;
        $data->canmanagetemplatecompetencies = $this->canmanagetemplatecompetencies;
        $data->manageurl = $this->manageurl->out(true);
        $exporter = new template_statistics_exporter($this->templatestatistics);
        $data->statistics = $exporter->export($output);
        $data->showcompetencylinks = true;

        return $data;
    }
552900
public function export_for_template(renderer_base $output) {
        global $CFG;

        $data = new stdClass();

        // Variables that will be passed to the JS helper.
        $data->courseid = $this->courseid;
        $data->wwwroot = $CFG->wwwroot;
        // To be passed to the JS init script in the template. Encode as a JSON string.
        $data->undeletablegroups = json_encode($this->undeletablegroups);

        // Some buttons are enabled if single group selected.
        $data->addmembersdisabled = $this->disableaddedit;
        $data->editgroupsettingsdisabled = $this->disableaddedit;
        $data->deletegroupdisabled = $this->disabledelete;
        $data->groups = $this->groups;
        $data->members = $this->selectedgroupmembers;
        $data->selectedgroup = $this->selectedgroupname;

        return $data;
    }