コード例 #1
0
ファイル: institutions.php プロジェクト: sarahjcotton/mahara
        }
    }
    $elements['lockedfields'] = array('type' => 'fieldset', 'class' => 'last with-formgroup', 'legend' => get_string('Lockedfields', 'admin'), 'collapsible' => true, 'collapsed' => true, 'elements' => array());
    if ($institution != 'mahara') {
        $elements['lockedfields']['elements']['description'] = array('type' => 'html', 'value' => get_string('disabledlockedfieldhelp1', 'admin', get_field('institution', 'displayname', 'name', 'mahara')));
    }
    foreach (ArtefactTypeProfile::get_all_fields() as $field => $type) {
        $elements['lockedfields']['elements'][$field] = array('type' => 'switchbox', 'title' => get_string($field, 'artefact.internal'), 'defaultvalue' => in_array($field, $lockedprofilefields) || $institution != 'mahara' && in_array($field, $sitelockedfields), 'disabled' => $institution != 'mahara' && in_array($field, $sitelockedfields));
    }
    // Check for active plugins institution settings.
    $elements['pluginsfields'] = array('type' => 'fieldset', 'legend' => get_string('pluginsfields', 'admin'), 'collapsible' => true, 'collapsed' => true, 'elements' => array());
    // Get plugins institution settings.
    $instobj = null;
    if (!$add && $institution != '') {
        $instobj = new Institution();
        $instobj->findByName($institution);
    }
    $elements['pluginsfields']['elements'] = array_merge($elements['pluginsfields']['elements'], plugin_institution_prefs_form_elements($instobj));
    // Remove plugin fieldset if no fields.
    if (empty($elements['pluginsfields']['elements'])) {
        unset($elements['pluginsfields']);
    }
    $elements['submit'] = array('type' => 'submitcancel', 'class' => 'btn-primary', 'value' => array(get_string('submit'), get_string('cancel')));
    $institutionform = pieform(array('name' => 'institution', 'renderer' => 'div', 'plugintype' => 'core', 'pluginname' => 'admin', 'elements' => $elements));
} else {
    // Get a list of institutions
    require_once get_config('libroot') . 'institution.php';
    if (!$USER->get('admin')) {
        // Filter the list for institutional admins
        $filter = $USER->get('admininstitutions');
        $showdefault = false;