$data = new Hubzero\Config\Registry(); $data->set('params', $this->profile->params->toArray()); $form = new Hubzero\Form\Form('fields', array('control' => 'fields')); $form->load(Hubzero\Form\Form::getXML(Component::path('com_members') . DS . 'models' . DS . 'forms' . DS . 'user.xml', true)); $form->bind($data); $fieldsets = $form->getFieldsets(); echo Html::sliders('start'); foreach ($fieldsets as $fieldset) { if ($fieldset->name == 'user_details') { continue; } echo Html::sliders('panel', Lang::txt($fieldset->label), $fieldset->name); ?> <fieldset class="panelform"> <?php foreach ($form->getFieldset($fieldset->name) as $field) { ?> <?php if ($field->hidden) { ?> <?php echo $field->input; ?> <?php } else { ?> <div class="input-wrap"> <?php echo $field->label; ?> <?php
Lang::load('plg_filesystem_' . $this->connection->provider->get('alias'), PATH_APP . DS . 'plugins' . DS . 'filesystem' . DS . $this->connection->provider->get('alias')); $xml = PATH_APP . DS . 'plugins' . DS . 'filesystem' . DS . $this->connection->provider->get('alias') . DS . $this->connection->provider->get('alias') . '.xml'; if (!file_exists($xml)) { Lang::load('plg_filesystem_' . $this->connection->provider->get('alias'), PATH_CORE . DS . 'plugins' . DS . 'filesystem' . DS . $this->connection->provider->get('alias')); $xml = PATH_CORE . DS . 'plugins' . DS . 'filesystem' . DS . $this->connection->provider->get('alias') . DS . $this->connection->provider->get('alias') . '.xml'; } $form = new Hubzero\Form\Form('connection', array('control' => 'connect')); $form->loadFile($xml, false, '//config'); $data = array(); if ($data = $this->connection->get('params')) { $data = json_decode($data, true); //$data = new Hubzero\Config\Registry($data); //$form->bind($data); } $data = new Hubzero\Config\Registry($data); $fieldSet = $form->getFieldset('credentials'); if (count($fieldSet)) { ?> <fieldset class="panelform"> <legend><?php echo Lang::txt('Credentials'); ?> </legend> <?php $hidden_fields = ''; ?> <?php foreach ($fieldSet as $field) { ?> <?php
// Convert to XML so we can use the Form processor $xml = Components\Members\Models\Profile\Field::toXml($fields); $profiles = $this->profile->profiles()->ordered()->rows(); // Gather data to pass to the form processor $data = new Hubzero\Config\Registry(Components\Members\Models\Profile::collect($profiles)); $data->set('tags', $this->profile->tags('string')); foreach ($profiles as $profile) { $d = isset($access[$profile->get('profile_key')]) ? $access[$profile->get('profile_key')] : 1; $access[$profile->get('profile_key')] = $profile->get('access', $d); } // Create a new form Hubzero\Form\Form::addFieldPath(Component::path('com_members') . DS . 'models' . DS . 'fields'); $form = new Hubzero\Form\Form('profile', array('control' => 'profile')); $form->load($xml); $form->bind($data); $fields = $form->getFieldset('basic'); ?> <div class="grid"> <div class="col span7"> <fieldset class="adminform"> <legend><span><?php echo Lang::txt('COM_MEMBERS_PROFILE'); ?> </span></legend> <?php foreach ($fields as $field) { ?> <div class="grid"> <div class="col span9"> <?php