• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_String函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_String函数的典型用法代码示例。如果您正苦于以下问题:PHP get_String函数的具体用法?PHP get_String怎么用?PHP get_String使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_String函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: definition

 function definition()
 {
     global $USER, $CFG;
     $mform =& $this->_form;
     $mform->addElement('header', '', get_string('createuserandpass'), '');
     $mform->addElement('text', 'username', get_string('username'), 'maxlength="100" size="12"');
     $mform->setType('username', PARAM_NOTAGS);
     $mform->addRule('username', get_string('missingusername'), 'required', null, 'server');
     $mform->addElement('passwordunmask', 'password', get_string('password'), 'maxlength="32" size="12"');
     $mform->setType('password', PARAM_RAW);
     $mform->addRule('password', get_string('missingpassword'), 'required', null, 'server');
     $mform->addElement('header', '', get_string('supplyinfo'), '');
     $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="25"');
     $mform->setType('email', PARAM_NOTAGS);
     $mform->addRule('email', get_string('missingemail'), 'required', null, 'server');
     $mform->addElement('text', 'email2', get_string('emailagain'), 'maxlength="100" size="25"');
     $mform->setType('email2', PARAM_NOTAGS);
     $mform->addRule('email2', get_string('missingemail'), 'required', null, 'server');
     $nameordercheck = new object();
     $nameordercheck->firstname = 'a';
     $nameordercheck->lastname = 'b';
     if (fullname($nameordercheck) == 'b a') {
         // See MDL-4325
         $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
         $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
     } else {
         $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
         $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
     }
     $mform->setType('firstname', PARAM_TEXT);
     $mform->addRule('firstname', get_string('missingfirstname'), 'required', null, 'server');
     $mform->setType('lastname', PARAM_TEXT);
     $mform->addRule('lastname', get_string('missinglastname'), 'required', null, 'server');
     $mform->addElement('text', 'city', get_string('city'), 'maxlength="20" size="20"');
     $mform->setType('city', PARAM_TEXT);
     $mform->addRule('city', get_string('missingcity'), 'required', null, 'server');
     $country = get_list_of_countries();
     $default_country[''] = get_string('selectacountry');
     $country = array_merge($default_country, $country);
     $mform->addElement('select', 'country', get_string('country'), $country);
     $mform->addRule('country', get_string('missingcountry'), 'required', null, 'server');
     if (!empty($CFG->country)) {
         $mform->setDefault('country', $CFG->country);
     } else {
         $mform->setDefault('country', '');
     }
     if (signup_captcha_enabled()) {
         $mform->addElement('recaptcha', 'recaptcha_element', get_string('recaptcha', 'auth'), array('https' => $CFG->loginhttps));
         $mform->setHelpButton('recaptcha_element', array('recaptcha', get_string('recaptcha', 'auth')));
     }
     profile_signup_fields($mform);
     if (!empty($CFG->sitepolicy)) {
         $mform->addElement('header', '', get_string('policyagreement'), '');
         $mform->addElement('static', 'policylink', '', '<a href="' . $CFG->sitepolicy . '" onclick="this.target=\'_blank\'">' . get_String('policyagreementclick') . '</a>');
         $mform->addElement('checkbox', 'policyagreed', get_string('policyaccept'));
         $mform->addRule('policyagreed', get_string('policyagree'), 'required', null, 'server');
     }
     // buttons
     $this->add_action_buttons(true, get_string('createaccount'));
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:60,代码来源:signup_form.php


示例2: liveclassroom_process_options

/**
 * Validate the data in passed in the configuration page
 * 
 * @param  $config - the information from the form mod.html
 * @return nothing , but returns an error if the configuration is wrong
 */
function liveclassroom_process_options(&$config)
{
    global $CFG, $USER;
    /*******
       we do the following verfication before submitting the configuration
       -The parameters sent can not be empty
       -The url of the server can not finish with a /
       -The url must start with http:// 
       -The api account has to valid
       ********/
    $config->servername = trim($config->servername);
    $config->adminusername = trim($config->adminusername);
    $config->adminpassword = trim($config->adminpassword);
    if (!isadmin($USER->id)) {
        wimba_add_log(WIMBA_ERROR, WC, get_string('wrongconfigurationURLunavailable', 'liveclassroom'));
        error(get_string('errormustbeadmin', 'liveclassroom'));
    }
    if (empty($config->servername)) {
        wimba_add_log(WIMBA_ERROR, WC, get_string('wrongconfigurationURLunavailable', 'liveclassroom'));
        error(get_string('wrongconfigurationURLunavailable', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
    } else {
        if (empty($config->adminusername)) {
            wimba_add_log(WIMBA_ERROR, WC, get_string('emptyAdminUsername', 'liveclassroom'));
            error(get_string('emptyAdminUsername', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
        } else {
            if (empty($config->adminpassword)) {
                wimba_add_log(WIMBA_ERROR, WC, get_string('emptyAdminPassword', 'liveclassroom'));
                error(get_string('emptyAdminPassword', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
            }
        }
    }
    $length = strlen($config->servername);
    if ($config->servername[$length - 1] == '/') {
        wimba_add_log(WIMBA_ERROR, WC, get_String('trailingSlash', 'liveclassroom'));
        error(get_String('trailingSlash', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
    }
    if (!preg_match('/^http:\\/\\//', $config->servername)) {
        wimba_add_log(WIMBA_ERROR, WC, get_String('trailingHttp', 'liveclassroom'));
        error(get_String('trailingHttp', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
    }
    $prefixUtil = new PrefixUtil();
    $prefix = $prefixUtil->getPrefix($config->adminusername);
    $api = new LCApi($config->servername, $config->adminusername, $config->adminpassword, $prefix);
    if (!$api->lcapi_authenticate()) {
        wimba_add_log(WIMBA_ERROR, WC, get_string('wrongadminpass', 'liveclassroom'));
        error(get_string('wrongadminpass', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
    }
    $domxml = false;
    $php_extension = get_loaded_extensions();
    for ($i = 0; $i < count($php_extension); $i++) {
        if ($php_extension[$i] == "libxml" || $php_extension[$i] == "domxml") {
            $domxml = true;
        }
    }
    if ($domxml === false) {
        wimba_add_log(WIMBA_ERROR, WC, get_string('domxml', 'liveclassroom'));
        error(get_string('domxml', 'liveclassroom'), $_SERVER["HTTP_REFERER"]);
    }
    return;
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:66,代码来源:lib.php


示例3: definition

 function definition()
 {
     global $USER, $CFG;
     $mform = $this->_form;
     $mform->addElement('header', 'createuserandpass', get_string('createuserandpass'), '');
     $mform->addElement('text', 'username', get_string('username'), 'maxlength="100" size="12"');
     $mform->setType('username', PARAM_NOTAGS);
     $mform->addRule('username', get_string('missingusername'), 'required', null, 'server');
     if (!empty($CFG->passwordpolicy)) {
         $mform->addElement('static', 'passwordpolicyinfo', '', print_password_policy());
     }
     $mform->addElement('passwordunmask', 'password', get_string('password'), 'maxlength="32" size="12"');
     $mform->setType('password', PARAM_RAW);
     $mform->addRule('password', get_string('missingpassword'), 'required', null, 'server');
     $mform->addElement('header', 'supplyinfo', get_string('supplyinfo'), '');
     $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="25"');
     $mform->setType('email', PARAM_RAW_TRIMMED);
     $mform->addRule('email', get_string('missingemail'), 'required', null, 'server');
     $mform->addElement('text', 'email2', get_string('emailagain'), 'maxlength="100" size="25"');
     $mform->setType('email2', PARAM_RAW_TRIMMED);
     $mform->addRule('email2', get_string('missingemail'), 'required', null, 'server');
     $namefields = useredit_get_required_name_fields();
     foreach ($namefields as $field) {
         $mform->addElement('text', $field, get_string($field), 'maxlength="100" size="30"');
         $mform->setType($field, PARAM_TEXT);
         $stringid = 'missing' . $field;
         if (!get_string_manager()->string_exists($stringid, 'moodle')) {
             $stringid = 'required';
         }
         $mform->addRule($field, get_string($stringid), 'required', null, 'server');
     }
     $mform->addElement('text', 'city', get_string('city'), 'maxlength="120" size="20"');
     $mform->setType('city', PARAM_TEXT);
     if (!empty($CFG->defaultcity)) {
         $mform->setDefault('city', $CFG->defaultcity);
     }
     $country = get_string_manager()->get_list_of_countries();
     $default_country[''] = get_string('selectacountry');
     $country = array_merge($default_country, $country);
     $mform->addElement('select', 'country', get_string('country'), $country);
     if (!empty($CFG->country)) {
         $mform->setDefault('country', $CFG->country);
     } else {
         $mform->setDefault('country', '');
     }
     if ($this->signup_captcha_enabled()) {
         $mform->addElement('recaptcha', 'recaptcha_element', get_string('security_question', 'auth'), array('https' => $CFG->loginhttps));
         $mform->addHelpButton('recaptcha_element', 'recaptcha', 'auth');
     }
     profile_signup_fields($mform);
     if (!empty($CFG->sitepolicy)) {
         $mform->addElement('header', 'policyagreement', get_string('policyagreement'), '');
         $mform->setExpanded('policyagreement');
         $mform->addElement('static', 'policylink', '', '<a href="' . $CFG->sitepolicy . '" onclick="this.target=\'_blank\'">' . get_String('policyagreementclick') . '</a>');
         $mform->addElement('checkbox', 'policyagreed', get_string('policyaccept'));
         $mform->addRule('policyagreed', get_string('policyagree'), 'required', null, 'server');
     }
     // buttons
     $this->add_action_buttons(true, get_string('createaccount'));
 }
开发者ID:Hirenvaghasiya,项目名称:moodle,代码行数:60,代码来源:signup_form.php


示例4: definition

 function definition()
 {
     global $USER;
     $mform =& $this->_form;
     $mform->addElement('header', '', get_string('changepassword'), '');
     // visible elements
     $mform->addElement('static', 'username', get_string('username'), $USER->username);
     $mform->addElement('password', 'password', get_string('oldpassword'));
     $mform->addRule('password', get_string('required'), 'required', null, 'client');
     $mform->setType('password', PARAM_RAW);
     $mform->addElement('password', 'newpassword1', get_string('newpassword'));
     $mform->addRule('newpassword1', get_string('required'), 'required', null, 'client');
     $mform->setType('newpassword1', PARAM_RAW);
     $mform->addElement('password', 'newpassword2', get_string('newpassword') . ' (' . get_String('again') . ')');
     $mform->addRule('newpassword2', get_string('required'), 'required', null, 'client');
     $mform->setType('newpassword2', PARAM_RAW);
     // hidden optional params
     $mform->addElement('hidden', 'id', 0);
     $mform->setType('id', PARAM_INT);
     // buttons
     if (get_user_preferences('auth_forcepasswordchange')) {
         $this->add_action_buttons(false);
     } else {
         $this->add_action_buttons(true);
     }
 }
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:26,代码来源:change_password_form.php


示例5: definition

 function definition()
 {
     global $CFG;
     $mform = $this->_form;
     // This 'dummy' element has two purposes:
     // - To force open the Moodle Forms invisible fieldset outside of any table on the form (corrupts display otherwise)
     // - To let us inform the user that there are validation errors without them having to scroll down further
     $mform->addElement('static', 'form_errors');
     $mform->addElement('header', 'emailandpassword', get_string('emailandpassword', 'local_obu_application'), '');
     $mform->addElement('static', 'preregistered', get_string('preregistered', 'local_obu_application'));
     $mform->addElement('text', 'email', get_string('email'), 'size="25" maxlength="100"');
     $mform->setType('email', PARAM_RAW_TRIMMED);
     $mform->addRule('email', get_string('missingemail'), 'required', null, 'server');
     $mform->addElement('text', 'username', get_string('confirm_email', 'local_obu_application'), 'size="25" maxlength="100"');
     $mform->setType('username', PARAM_RAW_TRIMMED);
     $mform->addRule('username', get_string('missingemail'), 'required', null, 'server');
     if (!empty($CFG->passwordpolicy)) {
         $mform->addElement('static', 'passwordpolicyinfo', '', print_password_policy());
     }
     $mform->addElement('passwordunmask', 'password', get_string('password'), 'size="12" maxlength="32"');
     $mform->setType('password', PARAM_RAW);
     $mform->addRule('password', get_string('missingpassword'), 'required', null, 'server');
     $mform->addElement('header', 'contactdetails', get_string('contactdetails', 'local_obu_application'), '');
     $mform->addElement('text', 'title', get_string('title', 'local_obu_application'), 'size="10" maxlength="10"');
     $mform->setType('title', PARAM_TEXT);
     $mform->addRule('title', null, 'required', null, 'server');
     $mform->addElement('text', 'firstname', get_string('firstname'), 'size="30" maxlength="100"');
     $mform->setType('firstname', PARAM_TEXT);
     $mform->addRule('firstname', null, 'required', null, 'server');
     $mform->addElement('text', 'lastname', get_string('lastname'), 'size="30" maxlength="100"');
     $mform->setType('lastname', PARAM_TEXT);
     $mform->addRule('lastname', null, 'required', null, 'server');
     $mform->addElement('text', 'phone1', get_string('phone', 'local_obu_application'), 'size="20" maxlength="20"');
     $mform->setType('phone1', PARAM_TEXT);
     $mform->addRule('phone1', null, 'required', null, 'server');
     // Use reCAPTCHA if it's setup
     if (!empty($CFG->recaptchapublickey) && !empty($CFG->recaptchaprivatekey)) {
         $mform->addElement('recaptcha', 'recaptcha_element', get_string('recaptcha', 'auth'), array('https' => $CFG->loginhttps));
         $mform->addHelpButton('recaptcha_element', 'recaptcha', 'auth');
     }
     if (!empty($CFG->sitepolicy)) {
         $mform->addElement('header', 'policyagreement', get_string('policyagreement'), '');
         $mform->setExpanded('policyagreement');
         $mform->addElement('static', 'policylink', '', '<a href="' . $CFG->sitepolicy . '" onclick="this.target=\'_blank\'">' . get_String('policyagreementclick') . '</a>');
         $mform->addElement('checkbox', 'policyagreed', get_string('policyaccept'));
         $mform->addRule('policyagreed', get_string('policyagree'), 'required', null, 'server');
     }
     // buttons
     $this->add_action_buttons(true, get_string('register', 'local_obu_application'));
 }
开发者ID:OBU-OBIS,项目名称:moodle-local_obu_application,代码行数:50,代码来源:signup_form.php


示例6: definition

 function definition()
 {
     global $USER, $CFG, $COURSE;
     $mform =& $this->_form;
     $mform->addElement('hidden', 'id', $USER->id);
     $mform->addElement('header', 'Editar', 'Editar Perfil');
     $mform->addElement('text', 'username', get_string('username'), array('readonly' => 'readonly'));
     $mform->setDefault('username', $USER->username);
     $mform->addRule('username', get_string('required'), 'required', '', 'client', false, false);
     $mform->addElement('text', 'firstname', get_string('firstname'), array('readonly' => 'readonly'));
     $mform->setDefault('firstname', $USER->firstname);
     $mform->addRule('firstname', get_string('required'), 'required', '', 'client', false, false);
     $mform->addElement('text', 'lastname', get_string('lastname'), array('readonly' => 'readonly'));
     $mform->setDefault('lastname', $USER->lastname);
     $mform->addRule('lastname', get_string('required'), 'required', '', 'client', false, false);
     $mform->addElement('password', 'pass1', get_string('newpassword'));
     $mform->addElement('password', 'pass2', get_string('newpassword') . ' (' . get_String('again') . ')');
     if (get_user_preferences('auth_forcepasswordchange')) {
         $mform->addRule('pass1', get_string('required'), 'required', '', 'client', false, false);
         $mform->addRule('pass2', get_string('required'), 'required', '', 'client', false, false);
     }
     $mform->addElement('text', 'email', 'Correo Banco');
     $mform->setDefault('email', $USER->email);
     $mform->addRule('email', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('email', get_string('invalidemail'), 'email', '', 'client', false, false);
     $mform->addElement('text', 'msn', get_string('msnid'));
     $mform->setDefault('msn', $USER->msn);
     $mform->addRule('msn', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('msn', get_string('invalidemail'), 'email', '', 'client', false, false);
     $mform->addElement('date_selector', 'icq', get_string('icqnumber'), array('startyear' => 1920, 'stopyear' => 2020, 'timezone' => 99, 'step' => 5));
     $mform->setDefault('icq', $USER->icq);
     $mform->addRule('icq', get_string('required'), 'required', '', 'client', false, false);
     $mform->addElement('text', 'phone1', get_string('phone'));
     $mform->setDefault('phone1', $USER->phone1);
     $mform->addRule('phone1', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('phone1', get_string('isnumber', 'report_user'), 'numeric', '', 'client', false, false);
     $mform->addElement('text', 'yahoo', get_string('yahooid'));
     $mform->setDefault('yahoo', $USER->yahoo);
     // $mform->addRule('yahoo', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('yahoo', get_string('isnumber', 'report_user'), 'numeric', '', 'client', false, false);
     $mform->addElement('text', 'phone2', get_string('phone2'));
     $mform->setDefault('phone2', $USER->phone2);
     //$mform->addRule('phone2', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('phone2', get_string('isnumber', 'report_user'), 'numeric', '', 'client', false, false);
     $mform->addElement('html', '<div><span class="msg-picture">Recuerda que esta imagen ser&aacute; vista por tus compa&ntilde;eros.</span></div>');
     $mform->addElement('file', 'picture', get_string('userpic'));
     $mform->addElement('submit', 'save', get_string('savechanges'));
     $mform->addElement('html', '<div style="color:#A00" align="right">En caso no cuente con correo BCP ingrese un correo personal**</div>');
 }
开发者ID:etarrillo,项目名称:pvflbl,代码行数:49,代码来源:user_form.php


示例7: definition

 function definition()
 {
     global $USER, $CFG, $COURSE;
     $mform =& $this->_form;
     $mform->addElement('hidden', 'id', $USER->id);
     $mform->addElement('text', 'username', get_string('username'), array('readonly' => 'readonly'));
     $mform->setDefault('username', $USER->username);
     $mform->addRule('username', get_string('required'), 'required', '', 'client', false, false);
     $mform->addElement('text', 'firstname', get_string('firstname'), array('readonly' => 'readonly'));
     $mform->setDefault('firstname', $USER->firstname);
     $mform->addRule('firstname', get_string('required'), 'required', '', 'client', false, false);
     $mform->addElement('text', 'lastname', get_string('lastname'), array('readonly' => 'readonly'));
     $mform->setDefault('lastname', $USER->lastname);
     $mform->addRule('lastname', get_string('required'), 'required', '', 'client', false, false);
     $mform->addElement('text', 'pass1', get_string('newpassword'));
     $mform->addElement('text', 'pass2', get_string('newpassword') . ' (' . get_String('again') . ')');
     if (get_user_preferences('auth_forcepasswordchange')) {
         $mform->addRule('pass1', get_string('required'), 'required', '', 'client', false, false);
         $mform->addRule('pass2', get_string('required'), 'required', '', 'client', false, false);
     }
     $mform->addElement('text', 'email', get_string('email'));
     $mform->setDefault('email', $USER->email);
     $mform->addRule('email', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('email', get_string('invalidemail'), 'email', '', 'client', false, false);
     $mform->addElement('text', 'msn', get_string('msnid'));
     $mform->setDefault('msn', $USER->msn);
     $mform->addRule('msn', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('msn', get_string('invalidemail'), 'email', '', 'client', false, false);
     $mform->addElement('date_selector', 'icq', get_string('icqnumber'), array('startyear' => 1920, 'stopyear' => 2020, 'timezone' => 99, 'step' => 5));
     $mform->setDefault('icq', $USER->icq);
     $mform->addRule('icq', get_string('required'), 'required', '', 'client', false, false);
     $mform->addElement('text', 'phone1', get_string('phone'));
     $mform->setDefault('phone1', $USER->phone1);
     $mform->addRule('phone1', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('phone1', get_string('isnumber', 'report_user'), 'numeric', '', 'client', false, false);
     $mform->addElement('text', 'yahoo', get_string('yahooid'));
     $mform->setDefault('yahoo', $USER->yahoo);
     // $mform->addRule('yahoo', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('yahoo', get_string('isnumber', 'report_user'), 'numeric', '', 'client', false, false);
     $mform->addElement('text', 'phone2', get_string('phone2'));
     $mform->setDefault('phone2', $USER->phone2);
     //$mform->addRule('phone2', get_string('required'), 'required', '', 'client', false, false);
     $mform->addRule('phone2', get_string('isnumber', 'report_user'), 'numeric', '', 'client', false, false);
     $mform->addElement('file', 'picture', get_string('userpic'));
     $mform->addElement('submit', 'save', get_string('savechanges'));
 }
开发者ID:etarrillo,项目名称:pvflbl,代码行数:46,代码来源:user_form_.php


示例8: definition

 /**
  * TODO comment this
  */
 function definition()
 {
     global $USER, $CFG;
     $dbc = new ilp_db();
     $mform =& $this->_form;
     $fieldsettitle = !empty($this->report_id) ? get_string('editreport', 'block_ilp') : get_string('createreport', 'block_ilp');
     //create a new fieldset
     $mform->addElement('html', '<fieldset id="reportfieldset" class="clearfix ilpfieldset">');
     $mform->addElement('html', '<legend >' . $fieldsettitle . '</legend>');
     $mform->addElement('hidden', 'id');
     $mform->setType('id', PARAM_INT);
     $mform->addElement('hidden', 'creator_id', $USER->id);
     $mform->setType('creator_id', PARAM_INT);
     //the id of the form element creator
     $mform->addElement('hidden', 'position');
     $mform->setType('position', PARAM_INT);
     //set the field position of the field
     $mform->setDefault('position', $this->dbc->get_new_report_position());
     // NAME element
     $mform->addElement('text', 'name', get_string('name', 'block_ilp'), array('class' => 'form_input'));
     $mform->addRule('name', null, 'maxlength', 255, 'client');
     $mform->addRule('name', null, 'required', null, 'client');
     $mform->setType('name', PARAM_RAW);
     $mform->addElement('checkbox', 'maxedit', get_String('maxedit', 'block_ilp'), null);
     $mform->addElement('checkbox', 'comments', get_String('allowcomments', 'block_ilp'), null);
     $mform->addElement('checkbox', 'frequency', get_String('multipleentries', 'block_ilp'), null);
     // DESCRIPTION element
     $mform->addElement('htmleditor', 'description', get_string('description', 'block_ilp'), array('class' => 'form_input', 'rows' => '10', 'cols' => '65'));
     $mform->addRule('description', null, 'maxlength', 65535, 'client');
     // commented out as causing problems with double submitting
     // $mform->addRule('description', null, 'required', null, 'client');
     $mform->setType('description', PARAM_RAW);
     //TODO add the elements to implement the frequency functionlaity
     if (stripos($CFG->release, "2.") !== false) {
         $mform->addElement('filepicker', 'binary_icon', get_string('binary_icon', 'block_ilp'), null, array('maxbytes' => ILP_MAXFILE_SIZE, 'accepted_types' => ILP_ICON_TYPES));
     } else {
         $this->set_upload_manager(new upload_manager('binary_icon', false, false, 0, false, ILP_MAXFILE_SIZE, true, true, false));
         $mform->addElement('file', 'binary_icon', get_string('binary_icon', 'block_ilp'));
     }
     $buttonarray[] = $mform->createElement('submit', 'saveanddisplaybutton', get_string('submit'));
     $buttonarray[] =& $mform->createElement('cancel');
     $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
     //close the fieldset
     $mform->addElement('html', '</fieldset>');
 }
开发者ID:nathanfriend,项目名称:moodle-block_ilp,代码行数:48,代码来源:edit_report_mform.php


示例9: definition

 function definition()
 {
     global $USER, $CFG;
     $mform = $this->_form;
     $mform->setDisableShortforms(true);
     $mform->addElement('header', 'changepassword', get_string('changepassword'), '');
     // visible elements
     $mform->addElement('static', 'username', get_string('username'), $USER->username);
     $policies = array();
     if (!empty($CFG->passwordpolicy)) {
         $policies[] = print_password_policy();
     }
     if (!empty($CFG->passwordreuselimit) and $CFG->passwordreuselimit > 0) {
         $policies[] = get_string('informminpasswordreuselimit', 'auth', $CFG->passwordreuselimit);
     }
     if ($policies) {
         $mform->addElement('static', 'passwordpolicyinfo', '', implode('<br />', $policies));
     }
     $mform->addElement('password', 'password', get_string('oldpassword'));
     $mform->addRule('password', get_string('required'), 'required', null, 'client');
     $mform->setType('password', PARAM_RAW);
     $mform->addElement('password', 'newpassword1', get_string('newpassword'));
     $mform->addRule('newpassword1', get_string('required'), 'required', null, 'client');
     $mform->setType('newpassword1', PARAM_RAW);
     $mform->addElement('password', 'newpassword2', get_string('newpassword') . ' (' . get_String('again') . ')');
     $mform->addRule('newpassword2', get_string('required'), 'required', null, 'client');
     $mform->setType('newpassword2', PARAM_RAW);
     if (empty($CFG->passwordchangetokendeletion) and !empty(webservice::get_active_tokens($USER->id))) {
         $mform->addElement('advcheckbox', 'signoutofotherservices', get_string('signoutofotherservices'));
         $mform->addHelpButton('signoutofotherservices', 'signoutofotherservices');
         $mform->setDefault('signoutofotherservices', 1);
     }
     // hidden optional params
     $mform->addElement('hidden', 'id', 0);
     $mform->setType('id', PARAM_INT);
     // buttons
     if (get_user_preferences('auth_forcepasswordchange')) {
         $this->add_action_buttons(false);
     } else {
         $this->add_action_buttons(true);
     }
 }
开发者ID:dg711,项目名称:moodle,代码行数:42,代码来源:change_password_form.php


示例10: definition

    function definition() {
        global $USER, $CFG;

        $mform = $this->_form;
        $mform->setDisableShortforms(true);


        // visible elements
        $mform->addElement('static', 'username', get_string('username'), $USER->username);

        if (!empty($CFG->passwordpolicy)) {
            $mform->addElement('static', 'passwordpolicyinfo', '', print_password_policy());
        }
        $mform->addElement('password', 'password', get_string('oldpassword'));
        $mform->addRule('password', get_string('required'), 'required', null, 'client');
        $mform->setType('password', PARAM_RAW);

        $mform->addElement('password', 'newpassword1', get_string('newpassword'));
        $mform->addRule('newpassword1', get_string('required'), 'required', null, 'client');
        $mform->setType('newpassword1', PARAM_RAW);

        $mform->addElement('password', 'newpassword2', get_string('newpassword') . ' (' . get_String('again') . ')');
        $mform->addRule('newpassword2', get_string('required'), 'required', null, 'client');
        $mform->setType('newpassword2', PARAM_RAW);


        // hidden optional params
        $mform->addElement('hidden', 'id', 0);
        $mform->setType('id', PARAM_INT);

        // buttons
        if (get_user_preferences('auth_forcepasswordchange')) {
            $this->add_action_buttons(false);
        } else {
            $this->add_action_buttons(true);
        }
    }
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:37,代码来源:change_password_form.php


示例11: admin_externalpage_setup

<?php

/// $Id$
/// Search and replace strings throughout all texts in the whole database
require_once '../config.php';
require_once $CFG->dirroot . '/course/lib.php';
require_once $CFG->libdir . '/adminlib.php';
admin_externalpage_setup('multilangupgrade');
$go = optional_param('go', 0, PARAM_BOOL);
###################################################################
admin_externalpage_print_header();
print_heading(get_string('multilangupgrade', 'admin'));
$strmultilangupgrade = get_String('multilangupgradeinfo', 'admin');
if (!$go or !data_submitted() or !confirm_sesskey()) {
    /// Print a form
    $optionsyes = array('go' => 1, 'sesskey' => sesskey());
    notice_yesno($strmultilangupgrade, 'multilangupgrade.php', 'index.php', $optionsyes, null, 'post', 'get');
    admin_externalpage_print_footer();
    die;
}
if (!($tables = $db->Metatables())) {
    // No tables yet at all.
    error("no tables");
}
print_simple_box_start('center');
/// Turn off time limits, sometimes upgrades can be slow.
@set_time_limit(0);
@ob_implicit_flush(true);
while (@ob_end_flush()) {
}
echo '<strong>Progress:</strong>';
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:31,代码来源:multilangupgrade.php


示例12: voicepresentation_process_options

/**
* Validate the data in passed in the configuration page
* @param $config - the information from the form mod.html
*/
function voicepresentation_process_options($config)
{
    global $CFG;
    /*******
        we do the following verfication before submitting the configuration
      	-The parameters sent can not be empty
      	-The url of the server can not finish with a /
      	-The url must start with http:// or https://
      	-The api account has to valid
      ********/
    $config->module = "voicetools";
    if (empty($config->servername)) {
        wimba_add_log(WIMBA_ERROR, voicepresentation_LOGS, get_string('wrongconfigurationURLunavailable', 'voicepresentation'));
        error(get_string('wrongconfigurationURLunavailable', 'voicepresentation'), $_SERVER["HTTP_REFERER"]);
    }
    if (empty($config->adminusername)) {
        wimba_add_log(WIMBA_ERROR, voicepresentation_LOGS, get_string('emptyAdminUsername', 'voicepresentation'));
        error(get_string('emptyAdminUsername', 'voicepresentation'), $_SERVER["HTTP_REFERER"]);
    }
    if (empty($config->adminpassword)) {
        wimba_add_log(WIMBA_ERROR, voicepresentation_LOGS, get_string('emptyAdminPassword', 'voicepresentation'));
        error(get_string('emptyAdminPassword', 'voicepresentation'), $_SERVER["HTTP_REFERER"]);
    }
    if ($config->servername[strlen($config->servername) - 1] == '/') {
        wimba_add_log(WIMBA_ERROR, voicepresentation_LOGS, get_String('trailingSlash', 'voicepresentation'));
        error(get_String('trailingSlash', 'voicepresentation'), $_SERVER["HTTP_REFERER"]);
    }
    if (!preg_match('/^http:\\/\\//', $config->servername) && !preg_match('/^https:\\/\\//', $config->servername)) {
        wimba_add_log(WIMBA_ERROR, voicepresentation_LOGS, get_String('trailingHttp', 'voicepresentation'));
        error(get_String('trailingHttp', 'voicepresentation'), $_SERVER["HTTP_REFERER"]);
    }
    //check if the api account filled is correct and allowed
    $result = voicetools_api_check_documentbase($config->servername, $config->adminusername, $config->adminpassword, $CFG->wwwroot);
    if ($result != "ok") {
        if (get_string($result, 'voicepresentation') == "[[]]") {
            //the error description is not in the bundle
            wimba_add_log(WIMBA_ERROR, voicepresentation_LOGS, $result);
            error($result, 'javascript:history.back();');
        } else {
            wimba_add_log(WIMBA_ERROR, voicepresentation_LOGS, get_String($result, 'voicepresentation'));
            error(get_string($result, 'voicepresentation'), 'javascript:history.back();');
        }
    }
    //to make sure that all the necessary module are installed
    wimba_add_log(WIMBA_INFO, voicepresentation_LOGS, "php info :\n" . print_r(get_loaded_extensions(), true));
    wimba_add_log(WIMBA_INFO, voicepresentation_LOGS, "The module is well configured");
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:51,代码来源:lib.php


示例13: print_error

    print_error('nocourseid');
}
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('moodle/course:managegroups', $context);
$strgrouping = get_string('grouping', 'group');
$strgroups = get_string('groups');
$strname = get_string('name');
$strdelete = get_string('delete');
$stredit = get_string('edit');
$srtnewgrouping = get_string('creategrouping', 'group');
$strgroups = get_string('groups');
$strgroupings = get_string('groupings', 'group');
$struses = get_string('activities');
$strparticipants = get_string('participants');
$strmanagegrping = get_String('showgroupsingrouping', 'group');
$navlinks = array(array('name' => $strparticipants, 'link' => $CFG->wwwroot . '/user/index.php?id=' . $courseid, 'type' => 'misc'), array('name' => $strgroupings, 'link' => '', 'type' => 'misc'));
$navigation = build_navigation($navlinks);
/// Print header
print_header_simple($strgroupings, ': ' . $strgroupings, $navigation, '', '', true, '', navmenu($course));
// Add tabs
$currenttab = 'groupings';
require 'tabs.php';
echo $OUTPUT->heading($strgroupings);
$data = array();
if ($groupings = $DB->get_records('groupings', array('courseid' => $course->id), 'name')) {
    foreach ($groupings as $grouping) {
        $line = array();
        $line[0] = format_string($grouping->name);
        if ($groups = groups_get_all_groups($courseid, 0, $grouping->id)) {
            $groupnames = array();
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:groupings.php


示例14: define

 *
 * @package    tool
 * @subpackage multilangupgrade
 * @copyright  2006 Petr Skoda (http://skodak.org)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
define('NO_OUTPUT_BUFFERING', true);
require '../../../config.php';
require_once $CFG->dirroot . '/course/lib.php';
require_once $CFG->libdir . '/adminlib.php';
admin_externalpage_setup('toolmultilangupgrade');
$go = optional_param('go', 0, PARAM_BOOL);
###################################################################
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('pluginname', 'tool_multilangupgrade'));
$strmultilangupgrade = get_String('multilangupgradeinfo', 'tool_multilangupgrade');
if (!$go or !data_submitted() or !confirm_sesskey()) {
    /// Print a form
    $optionsyes = array('go' => 1, 'sesskey' => sesskey());
    echo $OUTPUT->confirm($strmultilangupgrade, new moodle_url('/admin/tool/multilangupgrade/index.php', $optionsyes), new moodle_url('/admin/'));
    echo $OUTPUT->footer();
    die;
}
if (!($tables = $DB->get_tables())) {
    // No tables yet at all.
    print_error('notables', 'debug');
}
echo $OUTPUT->box_start();
/// Turn off time limits, sometimes upgrades can be slow.
core_php_time_limit::raise();
echo '<strong>Progress:</strong>';
开发者ID:alanaipe2015,项目名称:moodle,代码行数:31,代码来源:index.php


示例15: defined

<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * This script handles adobeconnect Help Me Now settings.
 *
 * @package     block_helpmenow
 * @copyright   2012 VLACS
 * @author      David Zaharee <[email protected]>
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
defined('MOODLE_INTERNAL') or die("Direct access to this location is not allowed.");
$settings->add(new admin_setting_configtext('helpmenow_adobeconnect_url', get_string('adobeconnect_settings_url', 'block_helpmenow'), get_string('adobeconnect_settings_url_desc', 'block_helpmenow'), '', PARAM_TEXT, 100));
$settings->add(new admin_setting_configtext('helpmenow_adobeconnect_helpurl', get_string('adobeconnect_settings_helpurl', 'block_helpmenow'), get_String('adobeconnect_settings_helpurl_desc', 'block_helpmenow'), '', PARAM_TEXT, 100));
$settings->add(new admin_setting_configtext('helpmenow_adobeconnect_orgname', get_string('adobeconnect_settings_orgname', 'block_helpmenow'), get_string('adobeconnect_settings_orgname_desc', 'block_helpmenow'), '', PARAM_TEXT, 25));
$settings->add(new admin_setting_configtext('helpmenow_adobeconnect_logourl', get_string('adobeconnect_settings_logourl', 'block_helpmenow'), get_string('adobeconnect_settings_logourl_desc', 'block_helpmenow'), '', PARAM_TEXT, 100));
开发者ID:anilch,项目名称:Personel,代码行数:29,代码来源:settings.php


示例16: definition

 function definition()
 {
     global $USER, $CFG;
     $invite = false;
     $sitecontext = get_context_instance(CONTEXT_SYSTEM);
     if (isloggedin() && has_capability('moodle/local:invitenewuser', $sitecontext)) {
         $invite = true;
     }
     $mform =& $this->_form;
     $mform->addElement('header', '', get_string('createuserandpass'), '');
     $mform->addElement('text', 'username', get_string('username'), 'maxlength="100" size="12"');
     $mform->setType('username', PARAM_NOTAGS);
     $mform->addRule('username', get_string('missingusername'), 'required', null, 'server');
     $mform->addElement('passwordunmask', 'password1', get_string('password'), 'maxlength="32" size="12"');
     $mform->setType('password1', PARAM_RAW);
     $mform->addRule('password1', get_string('missingpassword'), 'required', null, 'server');
     $mform->addElement('passwordunmask', 'password2', get_string('password') . ' (' . get_String('again') . ')', 'maxlength="32" size="12"');
     $mform->setType('password2', PARAM_RAW);
     $mform->addRule('password2', get_string('missingpassword'), 'required', null, 'server');
     $mform->addElement('header', '', get_string('supplyinfo'), '');
     $nameordercheck = new object();
     $nameordercheck->firstname = 'a';
     $nameordercheck->lastname = 'b';
     if (fullname($nameordercheck) == 'b a') {
         // See MDL-4325
         $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
         $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
     } else {
         $mform->addElement('text', 'firstname', get_string('firstname'), 'maxlength="100" size="30"');
         $mform->addElement('text', 'lastname', get_string('lastname'), 'maxlength="100" size="30"');
     }
     $mform->setType('firstname', PARAM_TEXT);
     $mform->addRule('firstname', get_string('missingfirstname'), 'required', null, 'server');
     $mform->setType('lastname', PARAM_TEXT);
     $mform->addRule('lastname', get_string('missinglastname'), 'required', null, 'server');
     $mform->addElement('text', 'city', get_string('city'), 'maxlength="20" size="20"');
     $mform->setType('city', PARAM_TEXT);
     $mform->addRule('city', get_string('missingcity'), 'required', null, 'server');
     $country = get_list_of_countries();
     $default_country[''] = get_string('selectacountry');
     $country = array_merge($default_country, $country);
     $mform->addElement('select', 'country', get_string('country'), $country);
     $mform->addRule('country', get_string('missingcountry'), 'required', null, 'server');
     if (!empty($CFG->country)) {
         $mform->setDefault('country', $CFG->country);
 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_UserCache函数代码示例发布时间:2022-05-15
下一篇:
PHP get_SkinCache函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap