public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform, $classname); $dspaceUrl = get_config('repository_dspace', 'dspace_url'); $mform->addElement('text', 'dspace_url', get_string('dspace_url', 'repository_dspace'), array('value' => $dspaceUrl, 'size' => '40')); $mform->setType('dspace_url', PARAM_TEXT); }
public static function type_config_form($mform, $classname = 'repository') { $a = new stdClass(); $a->callbackurl = google_oauth::callback_url()->out(false); $mform->addElement('static', null, '', get_string('oauthinfo', 'repository_skydrive', $a)); parent::type_config_form($mform); $strrequired = get_string('required'); $mform->addElement('text', 'clientid', get_string('clientid', 'repository_skydrive')); $mform->addElement('text', 'secret', get_string('secret', 'repository_skydrive')); $mform->addRule('clientid', $strrequired, 'required', null, 'client'); $mform->addRule('secret', $strrequired, 'required', null, 'client'); }
public function type_config_form($mform) { // global $CFG; parent::type_config_form($mform); $dspace_url = get_config('dspace', 'dspace_url'); $dspace_username = get_config('dspace', 'dspace_username'); $dspace_password = get_config('dspace', 'dspace_password'); $strrequired = get_string('required'); $mform->addElement('text', 'dspace_url', get_string('dspaceurl', 'repository_dspace'), array('value' => $dspace_url, 'size' => '50')); $mform->addRule('dspace_url', $strrequired, 'required', null, 'client'); $str_getkey = get_string('dspaceurlinfo', 'repository_dspace'); $mform->addElement('static', null, '', $str_getkey); $mform->addElement('text', 'dspace_username', get_string('dspaceusername', 'repository_dspace'), array('value' => $dspace_username, 'size' => '50')); $mform->addElement('password', 'dspace_password', get_string('dspacepassword', 'repository_dspace'), array('value' => $dspace_password, 'size' => '50')); $mform->addRule('dspace_username', $strrequired, 'required', null, 'client'); $mform->addRule('dspace_password', $strrequired, 'required', null, 'client'); }
/** * Add Plugin settings input to Moodle form * * @param moodleform $mform * @param string $classname */ public static function type_config_form($mform, $classname = 'repository') { global $CFG; parent::type_config_form($mform); $clientid = get_config('boxnet', 'clientid'); $clientsecret = get_config('boxnet', 'clientsecret'); $strrequired = get_string('required'); $mform->addElement('text', 'clientid', get_string('clientid', 'repository_boxnet'), array('value' => $clientid, 'size' => '40')); $mform->addRule('clientid', $strrequired, 'required', null, 'client'); $mform->setType('clientid', PARAM_RAW_TRIMMED); $mform->addElement('text', 'clientsecret', get_string('clientsecret', 'repository_boxnet'), array('value' => $clientsecret, 'size' => '40')); $mform->addRule('clientsecret', $strrequired, 'required', null, 'client'); $mform->setType('clientsecret', PARAM_RAW_TRIMMED); $mform->addElement('static', null, '', get_string('information', 'repository_boxnet')); if (!is_https()) { $mform->addElement('static', null, '', get_string('warninghttps', 'repository_boxnet')); } }
/** * Add Plugin settings input to Moodle form * * @param object $mform */ public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $licensekey = get_config('merlot', 'licensekey'); if (empty($licensekey)) { $licensekey = ''; } $strrequired = get_string('required'); $mform->addElement('text', 'licensekey', get_string('licensekey', 'repository_merlot'), array('value' => $licensekey, 'size' => '40')); $mform->setType('licensekey', PARAM_RAW_TRIMMED); $mform->addRule('licensekey', $strrequired, 'required', null, 'client'); }
/** * Setup repistory form. * * @param moodleform $mform Moodle form (passed by reference) * @param string $classname repository class name */ public static function type_config_form($mform, $classname = 'repository') { global $CFG; $a = new stdClass(); if (\local_o365\utils::is_configured() !== true) { $mform->addElement('static', null, '', get_string('notconfigured', 'repository_onenote', $CFG->wwwroot)); } parent::type_config_form($mform); }
/** * Add Plugin settings input to Moodle form. * * @inheritDocs */ public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $key = get_config('dropbox', 'dropbox_key'); $secret = get_config('dropbox', 'dropbox_secret'); if (empty($key)) { $key = ''; } if (empty($secret)) { $secret = ''; } $mform->addElement('text', 'dropbox_key', get_string('apikey', 'repository_dropbox'), array('value' => $key, 'size' => '40')); $mform->setType('dropbox_key', PARAM_RAW_TRIMMED); $mform->addElement('text', 'dropbox_secret', get_string('secret', 'repository_dropbox'), array('value' => $secret, 'size' => '40')); $mform->addRule('dropbox_key', get_string('required'), 'required', null, 'client'); $mform->addRule('dropbox_secret', get_string('required'), 'required', null, 'client'); $mform->setType('dropbox_secret', PARAM_RAW_TRIMMED); $mform->addElement('static', null, '', get_string('instruction', 'repository_dropbox')); $mform->addElement('static', null, get_string('oauth2redirecturi', 'repository_dropbox'), self::get_oauth2callbackurl()->out()); $mform->addElement('text', 'dropbox_cachelimit', get_string('cachelimit', 'repository_dropbox'), array('size' => '40')); $mform->addRule('dropbox_cachelimit', null, 'numeric', null, 'client'); $mform->setType('dropbox_cachelimit', PARAM_INT); $mform->addElement('static', 'dropbox_cachelimit_info', '', get_string('cachelimit_info', 'repository_dropbox')); }
public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $strrequired = get_string('required'); $endpointselect = array( // List of possible Amazon S3 Endpoints. "s3.amazonaws.com" => "s3.amazonaws.com", "s3-external-1.amazonaws.com" => "s3-external-1.amazonaws.com", "s3-us-west-2.amazonaws.com" => "s3-us-west-2.amazonaws.com", "s3-us-west-1.amazonaws.com" => "s3-us-west-1.amazonaws.com", "s3-eu-west-1.amazonaws.com" => "s3-eu-west-1.amazonaws.com", "s3.eu-central-1.amazonaws.com" => "s3.eu-central-1.amazonaws.com", "s3-eu-central-1.amazonaws.com" => "s3-eu-central-1.amazonaws.com", "s3-ap-southeast-1.amazonaws.com" => "s3-ap-southeast-1.amazonaws.com", "s3-ap-southeast-2.amazonaws.com" => "s3-ap-southeast-2.amazonaws.com", "s3-ap-northeast-1.amazonaws.com" => "s3-ap-northeast-1.amazonaws.com", "s3-sa-east-1.amazonaws.com" => "s3-sa-east-1.amazonaws.com" ); $mform->addElement('text', 'access_key', get_string('access_key', 'repository_s3')); $mform->setType('access_key', PARAM_RAW_TRIMMED); $mform->addElement('text', 'secret_key', get_string('secret_key', 'repository_s3')); $mform->setType('secret_key', PARAM_RAW_TRIMMED); $mform->addElement('select', 'endpoint', get_string('endpoint', 'repository_s3'), $endpointselect); $mform->setDefault('endpoint', 's3.amazonaws.com'); // Default to US Endpoint. $mform->addRule('access_key', $strrequired, 'required', null, 'client'); $mform->addRule('secret_key', $strrequired, 'required', null, 'client'); }
/** * Add Plugin settings input to Moodle form * * @param moodleform $mform * @param string $classname */ public static function type_config_form($mform, $classname = 'repository') { global $CFG; parent::type_config_form($mform); $public_account = get_config('boxnet', 'public_account'); $api_key = get_config('boxnet', 'api_key'); if (empty($api_key)) { $api_key = ''; } $strrequired = get_string('required'); $mform->addElement('text', 'api_key', get_string('apikey', 'repository_boxnet'), array('value'=>$api_key,'size' => '40')); $mform->addRule('api_key', $strrequired, 'required', null, 'client'); $mform->addElement('static', null, '', get_string('information','repository_boxnet')); //retrieve the flickr instances $params = array(); $params['context'] = array(); //$params['currentcontext'] = $this->context; $params['onlyvisible'] = false; $params['type'] = 'boxnet'; $instances = repository::get_instances($params); if (empty($instances)) { $callbackurl = get_string('callbackwarning', 'repository_boxnet'); $mform->addElement('static', null, '', $callbackurl); } else { $instance = array_shift($instances); $callbackurl = $CFG->wwwroot.'/repository/repository_callback.php?repo_id='.$instance->id; $mform->addElement('static', 'callbackurl', '', get_string('callbackurltext', 'repository_boxnet', $callbackurl)); } }
public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $strrequired = get_string('required'); $mform->addElement('text', 'access_key', get_string('access_key', 'repository_s3')); $mform->setType('access_key', PARAM_RAW_TRIMMED); $mform->addElement('text', 'secret_key', get_string('secret_key', 'repository_s3')); $mform->setType('secret_key', PARAM_RAW_TRIMMED); $mform->addRule('access_key', $strrequired, 'required', null, 'client'); $mform->addRule('secret_key', $strrequired, 'required', null, 'client'); }
/** * Add Plugin settings input to Moodle form * * @param object $mform */ public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $licensekey = get_config('il_edu_digital_portal', 'licensekey'); if (empty($licensekey)) { $licensekey = ''; } $strrequired = get_string('required'); $mform->addElement('text', 'licensekey', get_string('licensekey', 'repository_il_edu_digital_portal'), array('value' => $licensekey, 'size' => '40')); //$mform->addRule('licensekey', $strrequired, 'required', null, 'client'); }
public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform, $classname); $mform->addElement('text', 'uri', get_string('uri', 'repository_entermedia'), array('size' => '40')); $mform->setType('uri', PARAM_URL); $mform->addElement('textarea', 'filters', get_string('filters', 'repository_entermedia')); $mform->setType('filters', PARAM_TEXT); $mform->addElement('checkbox', 'autologin_enable', get_string('autologin_enable', 'repository_entermedia')); $mform->setType('autologin_enable', PARAM_TEXT); $mform->addHelpButton('autologin_enable', 'autologin', 'repository_entermedia'); $mform->addElement('text', 'autologin_user', get_string('autologin_user', 'repository_entermedia')); $mform->setType('autologin_user', PARAM_TEXT); $mform->addElement('passwordunmask', 'autologin_password', get_string('autologin_password', 'repository_entermedia')); $mform->setType('autologin_password', PARAM_TEXT); $mform->disabledIf('autologin_user', 'autologin_enable'); $mform->disabledIf('autologin_password', 'autologin_enable'); }
/** * Add Plugin settings input to Moodle form * @param object $mform */ public static function type_config_form($mform, $classname = 'repository') { global $DB, $CFG, $SESSION, $OUTPUT; parent::type_config_form($mform, $classname); $mform->addElement('text', 'server_host', get_string('serverurl', 'repository_elisfiles'), array('size' => '40')); $mform->setDefault('server_host', 'http://localhost'); $mform->setType('server_host', PARAM_TEXT); $mform->addElement('static', 'server_host_default', '', get_string('elis_files_default_server_host', 'repository_elisfiles')); $mform->addElement('static', 'server_host_intro', '', get_string('elis_files_server_host', 'repository_elisfiles')); $mform->addRule('server_host', get_string('required'), 'required', null, 'client'); $mform->addElement('text', 'server_port', get_string('serverport', 'repository_elisfiles'), array('size' => '30')); $mform->addElement('static', 'server_port_default', '', get_string('elis_files_default_server_port', 'repository_elisfiles')); $mform->addElement('static', 'server_port_intro', '', get_string('elis_files_server_port', 'repository_elisfiles')); $mform->addRule('server_port', get_string('required'), 'required', null, 'client'); $mform->setDefault('server_port', '8080'); $mform->setType('server_port', PARAM_INT); $mform->addElement('text', 'server_username', get_string('serverusername', 'repository_elisfiles'), array('size' => '30')); $mform->addElement('static', 'server_username_default', '', get_string('elis_files_default_server_username', 'repository_elisfiles')); $mform->addElement('static', 'server_username_intro', '', get_string('elis_files_server_username', 'repository_elisfiles')); $mform->addRule('server_username', get_string('required'), 'required', null, 'client'); $mform->setType('server_username', PARAM_TEXT); $mform->addElement('passwordunmask', 'server_password', get_string('serverpassword', 'repository_elisfiles'), array('size' => '30')); $mform->addElement('static', 'server_password_intro', '', get_string('elis_files_server_password', 'repository_elisfiles')); $mform->addRule('server_password', get_string('required'), 'required', null, 'client'); $mform->setType('server_password', PARAM_TEXT); $options = array( ELIS_FILES_XFER_WS => get_string('webservices', 'repository_elisfiles'), ELIS_FILES_XFER_FTP => get_string('ftp', 'repository_elisfiles') ); $mform->addElement('select', 'file_transfer_method', get_string('filetransfermethod', 'repository_elisfiles'), $options); $mform->setDefault('file_transfer_method', ELIS_FILES_XFER_FTP); $mform->addElement('static', 'file_transfer_method_default', '', get_string('filetransfermethoddefault', 'repository_elisfiles')); $mform->addElement('static', 'file_transfer_method_desc', '', get_string('filetransfermethoddesc', 'repository_elisfiles')); // Add a green checkmark if FTP connection works, red X on failure // (only if transfer method is set to ftp) $ftp_indicator = self::get_ftp_config_indicator(); $mform->addElement('text', 'ftp_port', get_string('ftpport', 'repository_elisfiles'), array('size' => '30')); $mform->setDefault('ftp_port', '21'); $mform->setType('ftp_port', PARAM_INT); $mform->addElement('static', 'ftp_port_default', '', $ftp_indicator.' '.get_string('ftpportdefault', 'repository_elisfiles')); $mform->addElement('static', 'ftp_port_desc', '', get_string('ftpportdesc', 'repository_elisfiles')); $mform->addElement('text', 'connect_timeout', get_string('connecttimeout', 'repository_elisfiles'), array('size' => '10')); $mform->setType('connect_timeout', PARAM_INT); $mform->setDefault('connect_timeout', ELIS_FILES_CURL_CONNECT_TIMEOUT); $mform->addElement('static', 'connect_timeout_default', '', get_string('connecttimeoutdefault', 'repository_elisfiles', ELIS_FILES_CURL_CONNECT_TIMEOUT)); $mform->addElement('static', 'connect_timeout_desc', '', get_string('connecttimeoutdesc', 'repository_elisfiles')); $mform->addElement('text', 'response_timeout', get_string('responsetimeout', 'repository_elisfiles'), array('size' => '10')); $mform->setType('response_timeout', PARAM_INT); $mform->setDefault('response_timeout', ELIS_FILES_CURL_RESPONSE_TIMEOUT); $mform->addElement('static', 'response_timeout_default', '', get_string('responsetimeoutdefault', 'repository_elisfiles', ELIS_FILES_CURL_RESPONSE_TIMEOUT)); $mform->addElement('static', 'response_timeout_desc', '', get_string('responsetimeoutdesc', 'repository_elisfiles')); // Check for installed categories table or display 'plugin not yet installed' if ($DB->get_manager()->table_exists('repository_elisfiles_cats')) { // Need to check for settings to be saved $popup_settings ="height=400,width=500,top=0,left=0,menubar=0,location=0,scrollbars,resizable,toolbar,status,directories=0,fullscreen=0,dependent"; $url = $CFG->wwwroot .'/repository/elisfiles/config-categories.php'; $jsondata = array('url'=>$url,'name'=>'config_categories','options'=>$popup_settings); $jsondata = json_encode($jsondata); $title = get_string('configurecategoryfilter', 'repository_elisfiles'); $button = "<input type='button' value='".$title."' alt='".$title."' title='".$title."' onclick='return openpopup(null,$jsondata);'>"; $mform->addElement('static', 'category_filter', get_string('categoryfilter', 'repository_elisfiles'), $button); $mform->addElement('static', 'category_filter_intro', '', get_string('elis_files_category_filter', 'repository_elisfiles')); } else { $mform->addElement('static', 'category_filter_intro', get_string('categoryfilter', 'repository_elisfiles'), get_string('elisfilesnotinstalled', 'repository_elisfiles')); } $popup_settings = "height=480,width=640,top=0,left=0,menubar=0,location=0,scrollbars,resizable,toolbar,status,directories=0,fullscreen=0,dependent"; $root_folder = get_config('elisfiles', 'root_folder'); $button = self::output_root_folder_html($root_folder); $rootfolderarray=array(); $rootfolderarray[] = $mform->createElement('text', 'root_folder', get_string('rootfolder', 'repository_elisfiles'), array('size' => '30')); $rootfolderarray[] = $mform->createElement('button', 'root_folder_popup', get_string('chooserootfolder', 'repository_elisfiles'), $button); $mform->addGroup($rootfolderarray, 'rootfolderar', get_string('rootfolder', 'repository_elisfiles'), array(' '), false); $mform->setDefault('root_folder', '/moodle'); $mform->setType('root_folder', PARAM_TEXT); // Add checkmark if get root folder works, or whatever... $valid = self::root_folder_is_valid($root_folder); $mform->addElement('static', 'root_folder_default', '', $valid.' '.get_string('elis_files_default_root_folder', 'repository_elisfiles')); $mform->addElement('static', 'root_folder_intro', '', get_string('elis_files_root_folder', 'repository_elisfiles')); // Cache time is retrieved from the common cache time and displayed here $mform->addElement('text', 'cache_time', get_string('cachetime', 'repository_elisfiles'), array('size' => '10')); $mform->addElement('static', 'cache_time_default', '', get_string('elis_files_default_cache_time', 'repository_elisfiles')); $mform->setDefault('cache_time', $CFG->repositorycacheexpire); $mform->setType('cache_time', PARAM_INT); $mform->freeze('cache_time'); // Generate the list of options for choosing a quota limit size. $bytes_1mb = 1048576; $sizelist = array( -1, '', $bytes_1mb * 10, $bytes_1mb * 20, $bytes_1mb * 30, $bytes_1mb * 40, $bytes_1mb * 50, $bytes_1mb * 100, $bytes_1mb * 200, $bytes_1mb * 500 ); foreach ($sizelist as $sizebytes) { if ($sizebytes == '') { $filesize[$sizebytes] = get_string('quotanotset', 'repository_elisfiles');; } else if ($sizebytes == -1 ) { $filesize[$sizebytes] = get_string('quotaunlimited', 'repository_elisfiles'); } else { $filesize[$sizebytes] = display_size($sizebytes); } } krsort($filesize, SORT_NUMERIC); $mform->addElement('select', 'user_quota', get_string('userquota', 'repository_elisfiles'), $filesize); $mform->setDefault('user_quota', ''); $mform->addElement('static', 'user_quota_default', '', get_string('elis_files_default_user_quota', 'repository_elisfiles')); $mform->addElement('static', 'user_quota_intro', '', get_string('configuserquota', 'repository_elisfiles')); // Add a toggle to control whether we will delete a user's home directory in Alfresco when their account is deleted. $options = array(1 => get_string('yes'), '' => get_string('no')); $mform->addElement('select', 'deleteuserdir', get_string('deleteuserdir', 'repository_elisfiles'), $options); $mform->setDefault('deleteuserdir', ''); $mform->addElement('static', 'deleteuserdir_default', '', get_string('elis_files_default_deleteuserdir', 'repository_elisfiles')); $mform->addElement('static', 'deleteuserdir_intro', '', get_string('configdeleteuserdir', 'repository_elisfiles')); // Menu setting about choosing the default location where users will end up if they don't have a previous file // browsing location saved. $options = array( ELIS_FILES_BROWSE_SITE_FILES => get_string('repositorysitefiles', 'repository_elisfiles'), ELIS_FILES_BROWSE_COURSE_FILES => get_string('repositorycoursefiles', 'repository_elisfiles'), ELIS_FILES_BROWSE_USER_FILES => get_string('repositoryuserfiles', 'repository_elisfiles'), ELIS_FILES_BROWSE_SHARED_FILES => get_string('repositorysharedfiles', 'repository_elisfiles') ); $mform->addElement('select', 'default_browse', get_string('defaultfilebrowsinglocation', 'repository_elisfiles'), $options); $mform->setDefault('default_browse', ELIS_FILES_BROWSE_USER_FILES); $mform->addElement('static', 'default_browse_default', '', get_string('elis_files_default_default_browse', 'repository_elisfiles')); $mform->addElement('static', 'default_browse_intro', '', get_string('configdefaultfilebrowsinglocation', 'repository_elisfiles')); // Display menu option about overriding the Moodle 'admin' account when creating an Alfresco user account. // Check for the existence of a user that will conflict with the default Alfresco administrator account. $hasadmin = $DB->record_exists('user', array('username' => 'admin', 'mnethostid' => $CFG->mnet_localhost_id)); $admin_username = trim(get_config('elisfiles', 'admin_username')); if (empty($admin_username)) { $adminusername = '******'; set_config('admin_username', $adminusername, 'elisfiles'); } else { $adminusername = $admin_username; } // Only proceed here if the Alfresco plug-in is actually enabled. if (self::is_repo_visible('elisfiles')) { if ($repo = repository_factory::factory()) { if (elis_files_get_home_directory($adminusername) == false) { $mform->addElement('text', 'admin_username', get_string('adminusername', 'repository_elisfiles'), array('size' => '30')); $mform->setType('admin_username', PARAM_TEXT); $mform->addElement('static', 'admin_username_default', '', get_string('elis_files_default_admin_username', 'repository_elisfiles')); $mform->addElement('static', 'admin_username_intro', '', get_string('configadminusername', 'repository_elisfiles')); } else { // Added to prevent an empty value from being stored in the database on form submit $mform->addElement('hidden', 'admin_username', $adminusername); $mform->setType('admin_username', PARAM_TEXT); // An Alfresco account with the specified username has been created, check if a Moodle account exists with that // username and display a warning if that is the case. if (($userid = $DB->get_field('user', 'id', array('username'=> $adminusername, 'mnethostid'=> $CFG->mnet_localhost_id))) !== false) { $a = new stdClass; $a->username = $adminusername; $a->url = $CFG->wwwroot . '/user/editadvanced.php?id=' . $userid . '&course=' . SITEID; $mform->addElement('static', 'admin_username_intro', get_string('adminusername', 'repository_elisfiles'), get_string('configadminusernameconflict', 'repository_elisfiles', $a)); } else { $mform->addElement('static', 'admin_username_intro', get_string('adminusername', 'repository_elisfiles'), get_string('configadminusernameset', 'repository_elisfiles', $adminusername)); } } } // Attmept to detect users in the system that are authenticated with a plug-in that does not use passwords and display // a message indicating the script that can be run to do a bulk synchronise of these users. $auths = elis_files_nopasswd_auths(); if (!empty($auths) && count($auths) > 0) { $select = ''; $params = array(); if (count($auths) == 1) { $select = 'auth = :auth1'; $params['auth1'] = current($auths); } else { $selects = array(); for ($i = 1; $i <= count($auths); $i++) { $selects[] .= ':auth'.$i; $params['auth'.$i] = $auths[$i - 1]; } $select = 'auth IN ('.implode(', ', $selects).')'; } $select .= ' AND deleted = :del'; $params['del'] = 0; if ($DB->record_exists_select('user', $select, $params)) { $mform->addElement('html', '<br />'); $mform->addElement('html', '<dl class="healthissues notice"><dt>'.get_string('passwordlessusersync', 'repository_elisfiles'). '</dt> <dd>'.get_string('configpasswordlessusersync', 'repository_elisfiles').'</dd></dl>'); } } } return true; }
public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $strrequired = get_string('required'); //$ah = $mform->addElement('select', 'auth_host', get_string('auth_host','repository_rackspace_cf'), array(get_string('US','repository_rackspace_cf'), get_string('UK','repository_rackspace_cf'))); //$ah->setMultiple(false); //$ah->setSelected(get_string('US','repository_rackspace_cf')); //$v = $mform->addElement('select', 'version', get_string('version','repository_rackspace_cf'), array(get_string('v1','repository_rackspace_cf'), get_string('v2','repository_rackspace_cf'))); //$v->setMultiple(false); //$v->setSelected(get_string('v1','repository_rackspace_cf')); $cdn = $mform->addElement('select', 'cdn', get_string('cdn', 'repository_rackspace_cf'), array(get_string('on', 'repository_rackspace_cf'), get_string('off', 'repository_rackspace_cf'))); $cdn->setMultiple(false); $cdn->setSelected(get_string('on', 'repository_rackspace_cf')); $mform->addElement('static', 'spacer', '', ''); $mform->addElement('static', 'auth_error', '', ''); $mform->addElement('text', 'username', get_string('username', 'repository_rackspace_cf')); $mform->addElement('text', 'api_key', get_string('api_key', 'repository_rackspace_cf')); $mform->addElement('static', 'instructions', '', get_string('instruct', 'repository_rackspace_cf')); //$mform->addRule('auth_host', $strrequired, 'required', null, 'client'); //$mform->addRule('version', $strrequired, 'required', null, 'client'); $mform->addRule('username', $strrequired, 'required', null, 'client'); $mform->addRule('api_key', $strrequired, 'required', null, 'client'); }
public function type_config_form($mform) { parent::type_config_form($mform); $strrequired = get_string('required'); $mform->addElement('text', 'access_key', get_string('access_key', 'repository_s3')); $mform->addElement('text', 'secret_key', get_string('secret_key', 'repository_s3')); $mform->addRule('access_key', $strrequired, 'required', null, 'client'); $mform->addRule('secret_key', $strrequired, 'required', null, 'client'); }
/** * Edit/Create Admin Settings Moodle form. * * @param moodleform $mform Moodle form (passed by reference). * @param string $classname repository class name. */ public static function type_config_form($mform, $classname = 'repository') { $callbackurl = new moodle_url(self::CALLBACKURL); $a = new stdClass(); $a->docsurl = get_docs_url('Google_OAuth_2.0_setup'); $a->callbackurl = $callbackurl->out(false); $mform->addElement('static', null, '', get_string('oauthinfo', 'repository_googledocs', $a)); parent::type_config_form($mform); $mform->addElement('text', 'clientid', get_string('clientid', 'repository_googledocs')); $mform->setType('clientid', PARAM_RAW_TRIMMED); $mform->addElement('text', 'secret', get_string('secret', 'repository_googledocs')); $mform->setType('secret', PARAM_RAW_TRIMMED); $strrequired = get_string('required'); $mform->addRule('clientid', $strrequired, 'required', null, 'client'); $mform->addRule('secret', $strrequired, 'required', null, 'client'); }
/** * Add Plugin settings input to Moodle form * @param object $mform */ public function type_config_form($mform) { global $CFG; parent::type_config_form($mform); $key = get_config('dropbox', 'dropbox_key'); $secret = get_config('dropbox', 'dropbox_secret'); if (empty($key)) { $key = ''; } if (empty($secret)) { $secret = ''; } $strrequired = get_string('required'); $mform->addElement('text', 'dropbox_key', get_string('apikey', 'repository_dropbox'), array('value' => $key, 'size' => '40')); $mform->addElement('text', 'dropbox_secret', get_string('secret', 'repository_dropbox'), array('value' => $secret, 'size' => '40')); $mform->addRule('dropbox_key', $strrequired, 'required', null, 'client'); $mform->addRule('dropbox_secret', $strrequired, 'required', null, 'client'); $str_getkey = get_string('instruction', 'repository_dropbox'); $mform->addElement('static', null, '', $str_getkey); }
/** * Add plugin settings input to Moodle form. * @param object $mform * @param string $classname */ public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform, $classname); $apikey = get_config('youtube', 'apikey'); if (empty($apikey)) { $apikey = ''; } $mform->addElement('text', 'apikey', get_string('apikey', 'repository_youtube'), array('value' => $apikey, 'size' => '40')); $mform->setType('apikey', PARAM_RAW_TRIMMED); $mform->addRule('apikey', get_string('required'), 'required', null, 'client'); $mform->addElement('static', null, '', get_string('information', 'repository_youtube')); }
/** * Add Plugin settings input to Moodle form * * @param moodleform $mform * @param string $classname */ public static function type_config_form($mform, $classname = 'repository') { global $CFG; parent::type_config_form($mform); $clientid = get_config('boxnet', 'clientid'); $clientsecret = get_config('boxnet', 'clientsecret'); $strrequired = get_string('required'); $mform->addElement('text', 'clientid', get_string('clientid', 'repository_boxnet'), array('value' => $clientid, 'size' => '40')); $mform->addRule('clientid', $strrequired, 'required', null, 'client'); $mform->setType('clientid', PARAM_RAW_TRIMMED); $mform->addElement('text', 'clientsecret', get_string('clientsecret', 'repository_boxnet'), array('value' => $clientsecret, 'size' => '40')); $mform->addRule('clientsecret', $strrequired, 'required', null, 'client'); $mform->setType('clientsecret', PARAM_RAW_TRIMMED); $mform->addElement('static', null, '', get_string('information', 'repository_boxnet')); if (strpos($CFG->wwwroot, 'https') !== 0) { $mform->addElement('static', null, '', get_string('warninghttps', 'repository_boxnet')); } if (get_config('boxnet', 'api_key')) { $url = new moodle_url('/repository/boxnet/migrationv1.php'); $url = $url->out(); $mform->addElement('static', null, '', get_string('migrationadvised', 'repository_boxnet', $url)); } }
/** * Add Plugin settings input to Moodle form * @param object $mform */ public function type_config_form($mform) { parent::type_config_form($mform); $public_account = get_config('boxnet', 'public_account'); $api_key = get_config('boxnet', 'api_key'); if (empty($api_key)) { $api_key = ''; } $strrequired = get_string('required'); $mform->addElement('text', 'api_key', get_string('apikey', 'repository_boxnet'), array('value' => $api_key, 'size' => '40')); $mform->addRule('api_key', $strrequired, 'required', null, 'client'); $mform->addElement('static', null, '', get_string('information', 'repository_boxnet')); }
public function type_config_form($mform) { parent::type_config_form($mform); $number = get_config('repository_recent', 'recentfilesnumber'); if (empty($number)) { $number = DEFAULT_RECENT_FILES_NUM; } $mform->addElement('text', 'recentfilesnumber', get_string('recentfilesnumber', 'repository_recent')); $mform->setDefault('recentfilesnumber', $number); }
public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform); $mform->addElement('text', 'elevatorURL', get_string('elevatorURL', 'repository_elevator')); $mform->addElement('text', 'apiKey', get_string('apiKey', 'repository_elevator')); $mform->addElement('text', 'apiSecret', get_string('apiSecret', 'repository_elevator')); $mform->setType('elevatorURL', PARAM_TEXT); $mform->setType('apiKey', PARAM_TEXT); $mform->setType('apiSecret', PARAM_TEXT); $strrequired = get_string('required'); $mform->addRule('elevatorURL', $strrequired, 'required', null, 'client'); $mform->addRule('apiKey', $strrequired, 'required', null, 'client'); $mform->addRule('apiSecret', $strrequired, 'required', null, 'client'); }
/** * Add Plugin settings input to Moodle form * * @param moodleform $mform Moodle form (passed by reference) * @param string $classname repository class name */ public static function type_config_form($mform, $classname = 'repository') { global $CFG; parent::type_config_form($mform); $key = get_config('dropbox', 'dropbox_key'); $secret = get_config('dropbox', 'dropbox_secret'); if (empty($key)) { $key = ''; } if (empty($secret)) { $secret = ''; } $strrequired = get_string('required'); $mform->addElement('text', 'dropbox_key', get_string('apikey', 'repository_dropbox'), array('value' => $key, 'size' => '40')); $mform->setType('dropbox_key', PARAM_RAW_TRIMMED); $mform->addElement('text', 'dropbox_secret', get_string('secret', 'repository_dropbox'), array('value' => $secret, 'size' => '40')); $mform->addRule('dropbox_key', $strrequired, 'required', null, 'client'); $mform->addRule('dropbox_secret', $strrequired, 'required', null, 'client'); $mform->setType('dropbox_secret', PARAM_RAW_TRIMMED); $str_getkey = get_string('instruction', 'repository_dropbox'); $mform->addElement('static', null, '', $str_getkey); $mform->addElement('text', 'dropbox_cachelimit', get_string('cachelimit', 'repository_dropbox'), array('size' => '40')); $mform->addRule('dropbox_cachelimit', null, 'numeric', null, 'client'); $mform->setType('dropbox_cachelimit', PARAM_INT); $mform->addElement('static', 'dropbox_cachelimit_info', '', get_string('cachelimit_info', 'repository_dropbox')); }
public static function type_config_form($mform, $class = 'repository_heanetmedia_list') { parent::type_config_form($mform); }