当前位置: 首页>>代码示例>>PHP>>正文


PHP get_max_upload_size函数代码示例

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


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

示例1: smarty_function_attach_files

/**
 * Render attach file to an object control
 * 
 * @param array $params
 * @param Smarty $smarty
 * @return string
 */
function smarty_function_attach_files($params, &$smarty)
{
    static $ids = array();
    $id = array_var($params, 'id');
    if (empty($id)) {
        $counter = 1;
        do {
            $id = 'attach_files_' . $id++;
        } while (in_array($id, $ids));
    }
    // if
    $ids[] = $id;
    $max_files = (int) array_var($params, 'max_files', 1, true);
    if ($max_files < 1) {
        $max_files = 1;
    }
    // if
    require_once SMARTY_PATH . '/plugins/modifier.filesize.php';
    if ($max_files == 1) {
        $max_upload_size_message = lang('Max size of file that you can upload is :size', array('size' => smarty_modifier_filesize(get_max_upload_size())));
    } else {
        $max_upload_size_message = lang('Max total size of files you can upload is :size', array('size' => smarty_modifier_filesize(get_max_upload_size())));
    }
    // if
    return '<div class="attach_files" id="' . $id . '" max_files="' . $max_files . '"><p class="attach_files_max_size details">' . $max_upload_size_message . '</p></div><script type="text/javascript">App.resources.AttachFiles.init("' . $id . '")</script>';
}
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:33,代码来源:function.attach_files.php

示例2: validateFile

 /**
  * Validate a uploaded file
  *
  * @param string       $attribute
  * @param UploadedFile $file
  * @param string       $property
  * @return bool
  */
 public function validateFile($attribute, UploadedFile $file, $property)
 {
     if (is_null($file)) {
         return false;
     }
     if (!$file->isValid()) {
         return false;
     }
     // compare file sizes in kB units
     if ($file->getClientSize() / 1000 > get_max_upload_size()) {
         return false;
     }
     return true;
 }
开发者ID:elvios,项目名称:darkshare,代码行数:22,代码来源:FileValidator.php

示例3: label_tag

	        <div id="<?php echo $genid ?>fileUploadDiv">
			<?php echo label_tag(lang('file'), $genid . 'fileFormFile', true) ?>
			<?php 
				Hook::fire('render_upload_control', array(
					"genid" => $genid,
					"attributes" => array(
						"id" => $genid . "fileFormFile",
						"class" => "title",
						"size" => "88",
						"style" => 'width:530px',
						"tabindex" => "10",
						"onchange" => "javascript:og.updateFileName('" . $genid .  "', this.value);"
					)
				), $ret);
			?>
			<p><?php echo lang('upload file desc', format_filesize(get_max_upload_size())) ?></p>
			</div>
	    	<div id="<?php echo $genid ?>weblinkDiv" style="display:none;">
	        <?php echo label_tag(lang('weblink'), 'file[url]', true, array('id' => $genid.'weblinkLbl', 'type' => 'text')) ?>
	    	<?php echo text_field('file[url]', '', array('id' => $genid.'url', 'style' => 'width:500px;', "onchange" => "javascript:og.updateFileName('" . $genid .  "', this.value);")) ?>
	    	</div>
		</div>
	<?php } ?>
<?php } // if ?>

	<div id="<?php echo $genid ?>addFileFilename" style="<?php echo $file->isNew()? 'display:none' : '' ?>">
      	<?php echo label_tag(lang('new filename'), $genid .'fileFormFilename') ?>    
        <?php echo text_field('file[name]',$file->getFilename(), array("id" => $genid .'fileFormFilename', 'tabindex' => '20', 'class' => 'title', 
        	'onchange' => ($file->getType() == ProjectFiles::TYPE_DOCUMENT? 'javascript:og.checkFileName(\'' . $genid .  '\')' : ''))) ?>
        
    	<?php if ($file->getType() == ProjectFiles::TYPE_WEBLINK){?>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:add_file.php

示例4: generateErrorMessage

 private static function generateErrorMessage($error_code)
 {
     Env::useHelper('format');
     switch ($error_code) {
         case UPLOAD_ERR_INI_SIZE:
             return lang('upload error msg UPLOAD_ERR_INI_SIZE', format_filesize(get_max_upload_size()));
         case UPLOAD_ERR_FORM_SIZE:
             return lang('upload error msg UPLOAD_ERR_FORM_SIZE', format_filesize(get_max_upload_size()));
         case UPLOAD_ERR_PARTIAL:
             return lang('upload error msg UPLOAD_ERR_PARTIAL');
         case UPLOAD_ERR_NO_FILE:
             return lang('upload error msg UPLOAD_ERR_NO_FILE');
         case UPLOAD_ERR_NO_TMP_DIR:
             return lang('upload error msg UPLOAD_ERR_NO_TMP_DIR');
         case UPLOAD_ERR_CANT_WRITE:
             return lang('upload error msg UPLOAD_ERR_CANT_WRITE');
         case UPLOAD_ERR_EXTENSION:
             return lang('upload error msg UPLOAD_ERR_EXTENSION');
         default:
             return lang('error upload file');
     }
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:22,代码来源:InvalidUploadError.class.php

示例5: fud_use

fud_use('users_reg.inc');
fud_use('tz.inc');
function get_max_upload_size()
{
    $us = strtolower(ini_get('upload_max_filesize'));
    $size = (int) $us;
    if (strpos($us, 'm') !== false) {
        $size *= 1024 * 1024;
    } else {
        if (strpos($us, 'k') !== false) {
            $size *= 1024;
        }
    }
    return $size;
}
$max_attach_size = get_max_upload_size();
if (isset($_POST['CF_PRIVATE_ATTACH_SIZE'])) {
    if ($_POST['CF_PRIVATE_ATTACH_SIZE'] > $max_attach_size) {
        $_POST['CF_PRIVATE_ATTACH_SIZE'] = $max_attach_size;
    }
} else {
    if ($GLOBALS['PRIVATE_ATTACH_SIZE'] > $max_attach_size) {
        $GLOBALS['PRIVATE_ATTACH_SIZE'] = $max_attach_size;
    }
}
$help_ar = read_help();
if (isset($_POST['form_posted'])) {
    for ($i = 1; $i < 10; $i++) {
        if (isset($GLOBALS['FUD_OPT_' . $i])) {
            $GLOBALS['NEW_FUD_OPT_' . $i] = 0;
        } else {
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:admglobal.php

示例6: testGetMaxUploadSize

 public function testGetMaxUploadSize()
 {
     $this->assertTrue(is_int(get_max_upload_size()));
 }
开发者ID:YounessTayer,项目名称:directus,代码行数:4,代码来源:functionsTest.php

示例7: fud_egw

            $size *= 1024;
        }
    }
    return $size;
}
require './GLOBALS.php';
fud_egw();
/* this is here so we get the cat_id when cancel button is clicked */
$cat_id = isset($_GET['cat_id']) ? (int) $_GET['cat_id'] : (isset($_POST['cat_id']) ? (int) $_POST['cat_id'] : '');
fud_use('adm.inc', true);
fud_use('forum_adm.inc', true);
fud_use('cat.inc', true);
fud_use('widgets.inc', true);
fud_use('logaction.inc');
$tbl = $GLOBALS['DBHOST_TBL_PREFIX'];
$max_upload_size = get_max_upload_size();
if (!$cat_id || ($cat_name = q_singleval('SELECT name FROM ' . $tbl . 'cat WHERE id=' . $cat_id)) === NULL) {
    exit('no such category');
}
$edit = isset($_GET['edit']) ? (int) $_GET['edit'] : (isset($_POST['edit']) ? (int) $_POST['edit'] : '');
if (isset($_POST['frm_submit'])) {
    if ($_POST['frm_max_attach_size'] > $max_upload_size) {
        $_POST['frm_max_attach_size'] = floor($max_upload_size / 1024);
    }
    /* (int) $_POST['frm_anon_forum']  is unused */
    $_POST['frm_forum_opt'] = (int) $_POST['frm_mod_attach'] | (int) $_POST['frm_moderated'] | (int) $_POST['frm_passwd_posting'] | (int) $_POST['frm_tag_style'];
    $frm = new fud_forum();
    if (!$edit) {
        fud_use('groups_adm.inc', true);
        fud_use('groups.inc');
        $frm->cat_id = $cat_id;
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:31,代码来源:admforum.php

示例8: upload_file

 /**
  * Upload file document page action
  * 
  * @param void
  * @return void
  */
 function upload_file()
 {
     $this->wireframe->print_button = false;
     if (!Document::canAdd($this->logged_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     $file = $_FILES['file'];
     $file_data = $this->request->post('file');
     if (!is_array($file_data)) {
         $file_data = array('category_id' => $this->active_document_category->getId());
     }
     // if
     require_once SMARTY_PATH . '/plugins/modifier.filesize.php';
     $this->smarty->assign(array('file_data' => $file_data, 'max_upload_size' => smarty_modifier_filesize(get_max_upload_size())));
     if ($this->request->isSubmitted()) {
         db_begin_work();
         $this->active_document->setAttributes($file_data);
         if (is_array($file)) {
             $destination_file = get_available_uploads_filename();
             if (move_uploaded_file($file['tmp_name'], $destination_file)) {
                 if (FIX_UPLOAD_PERMISSION !== false) {
                     @chmod($destination_file, FIX_UPLOAD_PERMISSION);
                 }
                 // if
                 $this->active_document->setName($file['name']);
                 $this->active_document->setBody(basename($destination_file));
                 $this->active_document->setMimeType($file['type']);
             }
             // if
         }
         // if
         $this->active_document->setCreatedBy($this->logged_user);
         $this->active_document->setType('file');
         $save = $this->active_document->save();
         if ($save && !is_error($save)) {
             $notify_user_ids = $this->request->post('notify_users');
             if (is_foreachable($notify_user_ids)) {
                 $notify_users = Users::findByIds($notify_user_ids);
                 $owner_company = get_owner_company();
                 if (is_foreachable($notify_users)) {
                     ApplicationMailer::send($notify_users, 'documents/new_upload_file_document', array('document_name' => $this->active_document->getName(), 'created_by_name' => $this->active_document->getCreatedByName(), 'created_by_url' => $this->logged_user->getViewUrl(), 'document_url' => $this->active_document->getViewUrl(), 'owner_company_name' => $owner_company->getName()), $this->active_document);
                 }
                 // if
             }
             // if
             db_commit();
             flash_success('Document ":document_name" has been uploaded', array('document_name' => $this->active_document->getName()));
             $this->redirectTo('documents');
         } else {
             db_rollback();
             $this->smarty->assign('errors', $save);
         }
         // if
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:63,代码来源:DocumentsController.class.php

示例9: get_addform_elements

 public static function get_addform_elements()
 {
     return array('startdate' => array('type' => 'text', 'rules' => array('required' => true), 'title' => get_string('startdate', 'artefact.resume'), 'help' => true, 'size' => 20), 'enddate' => array('type' => 'text', 'title' => get_string('enddate', 'artefact.resume'), 'size' => 20), 'title' => array('type' => 'text', 'rules' => array('required' => true), 'title' => get_string('title', 'artefact.resume'), 'size' => 50), 'description' => array('type' => 'textarea', 'rows' => 10, 'cols' => 50, 'resizable' => false, 'title' => get_string('description', 'artefact.resume')), 'attachments' => array('type' => 'files', 'title' => get_string('attachfile', 'artefact.resume'), 'defaultvalue' => array(), 'maxfilesize' => get_max_upload_size(false)));
 }
开发者ID:vohung96,项目名称:mahara,代码行数:4,代码来源:lib.php

示例10: handleUploadedFile

 /**
  * This function will process uploaded file
  *
  * @param array $uploaded_file
  * @param boolean $create_revision Create new revision or update last one
  * @param string $revision_comment Revision comment, if any
  * @return ProjectFileRevision
  */
 function handleUploadedFile($uploaded_file, $create_revision = true, $revision_comment = '')
 {
     $revision = null;
     if (!$create_revision) {
         $revision = $this->getLastRevision();
     }
     // if
     if (!is_array($uploaded_file) || count($uploaded_file) == 0) {
         throw new Exception(lang('uploaded file bigger than max upload size', format_filesize(get_max_upload_size())));
     }
     if (!$revision instanceof ProjectFileRevision) {
         $revision = new ProjectFileRevision();
         $revision->setFileId($this->getId());
         $revision->setRevisionNumber($this->getNextRevisionNumber());
         //$revision->setRevisionNumber(78);
         if (trim($revision_comment) == '' && $this->countRevisions() < 1) {
             $revision_comment = lang('initial versions');
         }
         // if
     }
     // if
     if (strtolower(substr($uploaded_file['name'], -4)) == '.pdf' && $uploaded_file['type'] != 'application/pdf') {
         $uploaded_file['type'] = 'application/pdf';
     }
     $revision->deleteThumb(false);
     // remove thumb
     // We have a file to handle!
     //executes only while uploading files
     if (!is_array($uploaded_file) || !isset($uploaded_file['name']) || !isset($uploaded_file['size']) || !isset($uploaded_file['type']) || (!isset($uploaded_file['tmp_name']) || !is_readable($uploaded_file['tmp_name']))) {
         throw new InvalidUploadError($uploaded_file);
     }
     // if
     if (isset($uploaded_file['error']) && $uploaded_file['error'] > UPLOAD_ERR_OK) {
         throw new InvalidUploadError($uploaded_file);
     }
     // if
     //eyedoc MOD
     $extension = get_file_extension(basename($uploaded_file['name']));
     if ($uploaded_file['type'] == 'application/octet-stream' && $extension == 'eyedoc') {
         $uploaded_file['type'] = 'text/html';
     }
     //eyedoc MOD
     // calculate hash
     if ($revision->columnExists('hash')) {
         $hash = hash_file("sha256", $uploaded_file['tmp_name']);
         $revision->setColumnValue('hash', $hash);
     }
     $repository_id = FileRepository::addFile($uploaded_file['tmp_name'], array('name' => $uploaded_file['name'], 'type' => $uploaded_file['type'], 'size' => $uploaded_file['size']));
     $revision->setRepositoryId($repository_id);
     $revision->deleteThumb(false);
     $revision->setFilesize($uploaded_file['size']);
     if ($uploaded_file['type'] == 'application/x-unknown-application') {
         $type = Mime_Types::instance()->get_type($extension);
         if ($type) {
             $revision->setTypeString($type);
         } else {
             $revision->setTypeString($uploaded_file['type']);
         }
     } else {
         $revision->setTypeString($uploaded_file['type']);
     }
     if (trim($extension)) {
         $file_type = FileTypes::getByExtension($extension);
         if ($file_type instanceof Filetype) {
             if (!$file_type->getIsAllow()) {
                 flash_error(lang('file extension no allow'));
                 return;
             } else {
                 $revision->setFileTypeId($file_type->getId());
             }
         }
         // if
     }
     // if
     $revision->setComment($revision_comment);
     $revision->save();
     $this->last_revision = $revision;
     // update last revision
     return $revision;
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:88,代码来源:ProjectFile.class.php

示例11: add_comment_form

 public static function add_comment_form($defaultprivate = false, $moderate = false)
 {
     global $USER;
     $form = array('name' => 'add_feedback_form', 'method' => 'post', 'plugintype' => 'artefact', 'pluginname' => 'comment', 'jsform' => true, 'autofocus' => false, 'elements' => array(), 'jssuccesscallback' => 'addFeedbackSuccess', 'jserrorcallback' => 'addFeedbackError');
     if (!$USER->is_logged_in()) {
         $form['spam'] = array('secret' => get_config('formsecret'), 'mintime' => 1, 'hash' => array('authorname', 'message', 'message', 'submit'));
         $form['elements']['authorname'] = array('type' => 'text', 'title' => get_string('name'), 'rules' => array('required' => true));
     }
     $form['elements']['message'] = array('type' => 'wysiwyg', 'title' => get_string('message'), 'class' => 'hide-label', 'rows' => 5, 'cols' => 80, 'rules' => array('maxlength' => 8192));
     if (get_config_plugin('artefact', 'comment', 'commentratings')) {
         $form['elements']['rating'] = array('type' => 'radio', 'title' => get_string('rating', 'artefact.comment'), 'options' => array('1' => '', '2' => '', '3' => '', '4' => '', '5' => ''), 'class' => 'star');
     }
     $form['elements']['ispublic'] = array('type' => 'switchbox', 'title' => get_string('makepublic', 'artefact.comment'), 'defaultvalue' => !$defaultprivate);
     if (get_config('licensemetadata')) {
         $form['elements']['license'] = license_form_el_basic(null);
         $form['elements']['licensing_advanced'] = license_form_el_advanced(null);
     }
     if ($moderate) {
         $form['elements']['ispublic']['description'] = get_string('approvalrequired', 'artefact.comment');
         $form['elements']['moderate'] = array('type' => 'hidden', 'value' => true);
     }
     if ($USER->is_logged_in()) {
         $form['elements']['attachments'] = array('type' => 'files', 'title' => get_string('attachfile', 'artefact.comment'), 'defaultvalue' => array(), 'maxfilesize' => get_max_upload_size(false));
     }
     $form['elements']['submit'] = array('type' => 'submitcancel', 'class' => 'btn-default', 'value' => array(get_string('Comment', 'artefact.comment'), get_string('cancel')));
     // This is a placeholder where we can display the parent comment's text
     // And also the strings we display when we are forcing a reply to be public or private
     $snippet = smarty_core();
     $form['elements']['replytoview'] = array('type' => 'html', 'value' => $snippet->fetch('artefact:comment:replyplaceholder.tpl'));
     // This is a placeholder for the parent comment's ID. It'll be populated by Javascript if needed.
     $form['elements']['replyto'] = array('type' => 'hidden', 'dynamic' => 'true', 'value' => null);
     return $form;
 }
开发者ID:kienv,项目名称:mahara,代码行数:33,代码来源:lib.php

示例12: get_lang

    }
    // installation completed or not message
    if (!$errorFound) {
        $out .= "\n<br /><center><b>" . get_lang('Learning path has been successfully imported.') . "</b></center>";
        $out .= "\n<br /><br ><center><a href=\"" . claro_htmlspecialchars(Url::Contextualize("learningPathAdmin.php?path_id=" . $tempPathId)) . "\">" . $lpName . "</a></center>";
    } else {
        $out .= "\n<br /><center><b>" . get_lang('An error occurred. Learning Path import failed.') . "</b></center>";
    }
    $out .= "\n<br /><a href=\"" . claro_htmlspecialchars(Url::Contextualize("learningPathList.php")) . "\">&lt;&lt; " . get_lang('Back') . "</a>";
} else {
    // don't display the form if user already sent it
    /*--------------------------------------
       UPLOAD FORM
      --------------------------------------*/
    $out .= "\n\n" . get_lang('Imported packages must consist of a zip file and be SCORM 1.2 conformable');
    $out .= '<br /><br />

            <form enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '" method="post">
            <input type="hidden" name="claroFormId" value="' . uniqid('') . '" />
            ' . claro_form_relay_context() . '

            <input type="file" name="uploadedPackage" /><br />
            <small>' . get_lang('Max file size : %size', array('%size' => format_file_size(get_max_upload_size($maxFilledSpace, $baseWorkDir)))) . '</small>

            <p>
            <input type="submit" value="' . get_lang('Import') . '" />&nbsp;
            ' . claro_html_button(Url::Contextualize('./learningPathList.php'), get_lang('Cancel')) . "\n" . '</p>' . '</form>';
}
// else if method == 'post'
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:importLearningPath.php

示例13: _e

							<!-- Upload File -->
							<input type="radio" id="file_type_1" name="file_type" value="1" />&nbsp;&nbsp;<label for="file_type_1"><?php 
        _e('Upload File:', 'wp-downloadmanager');
        ?>
</label>&nbsp;
							<input type="file" name="file_upload" size="25" onclick="document.getElementById('file_type_1').checked = true;" dir="ltr" />&nbsp;&nbsp;<?php 
        _e('to', 'wp-downloadmanager');
        ?>
&nbsp;&nbsp;
							<select name="file_upload_to" size="1" onclick="document.getElementById('file_type_1').checked = true;" dir="ltr">
								<?php 
        print_list_folders($file_path, $file_path);
        ?>
							</select>
							<br /><small><?php 
        printf(__('Maximum file size is %s.', 'wp-downloadmanager'), format_filesize(get_max_upload_size()));
        ?>
</small>
							<!-- Remote File -->
							<br /><br />
							<input type="radio" id="file_type_2" name="file_type" value="2" />&nbsp;&nbsp;<label for="file_type_2"><?php 
        _e('Remote File:', 'wp-downloadmanager');
        ?>
</label>&nbsp;
							<input type="text" name="file_remote" size="50" maxlength="255" onclick="document.getElementById('file_type_2').checked = true;" value="http://" dir="ltr" />
							<br /><small><?php 
        _e('Please include http:// or ftp:// in front.', 'wp-downloadmanager');
        ?>
</small>
						</td>
					</tr>
开发者ID:yszar,项目名称:linuxwp,代码行数:31,代码来源:download-manager.php

示例14: handle_upload

 function handle_upload()
 {
     global $bp;
     //include core files
     require_once ABSPATH . '/wp-admin/includes/file.php';
     $max_upload_size = get_max_upload_size();
     $max_upload_size = $max_upload_size * 1024;
     //convert kb to bytes
     $file = $_FILES;
     //I am not changing the domain of erro messages as these are same as bp, so you should have a translation for this
     $uploadErrors = array(0 => __('There is no error, the file uploaded with success', 'buddypress'), 1 => __('Your image was bigger than the maximum allowed file size of: ', 'buddypress') . size_format($max_upload_size), 2 => __('Your image was bigger than the maximum allowed file size of: ', 'buddypress') . size_format($max_upload_size), 3 => __('The uploaded file was only partially uploaded', 'buddypress'), 4 => __('No file was uploaded', 'buddypress'), 6 => __('Missing a temporary folder', 'buddypress'));
     if (isset($file['error']) && $file['error']) {
         bp_core_add_message(sprintf(__('Your upload failed, please try again. Error was: %s', 'buddypress'), $uploadErrors[$file['file']['error']]), 'error');
         return false;
     }
     if (!($file['file']['size'] < $max_upload_size)) {
         bp_core_add_message(sprintf(__('The file you uploaded is too big. Please upload a file under %s', 'buddypress'), size_format($max_upload_size)), 'error');
         return false;
     }
     if (!empty($file['file']['type']) && !preg_match('/(jpe?g|gif|png)$/i', $file['file']['type']) || !preg_match('/(jpe?g|gif|png)$/i', $file['file']['name'])) {
         bp_core_add_message(__('Please upload only JPG, GIF or PNG photos.', 'buddypress'), 'error');
         return false;
     }
     $uploaded_file = wp_handle_upload($file['file'], array('action' => 'bp_upload_profile_bg'));
     //if file was not uploaded correctly
     if (!empty($uploaded_file['error'])) {
         bp_core_add_message(sprintf(__('Upload Failed! Error was: %s', 'buddypress'), $uploaded_file['error']), 'error');
         return false;
     }
     //assume that the file uploaded succesfully
     //delete any previous uploaded image
     delete_bg_for_user();
     //save in usermeta
     bp_update_user_meta(bp_loggedin_user_id(), 'profile_bg', $uploaded_file['url']);
     bp_update_user_meta(bp_loggedin_user_id(), 'profile_bg_file_path', $uploaded_file['file']);
     do_action('bppg_background_uploaded', $uploaded_file['url']);
     //allow to do some other actions when a new background is uploaded
     return true;
 }
开发者ID:ryscript,项目名称:Scinttek-Decade-Project,代码行数:39,代码来源:theme_actions.php

示例15: get_lang

         // if the file is required and the text is only a description of the file
         $out .= get_lang('Upload document') . '&nbsp;<span class="required">*</span>';
     }
     $out .= '</label></dt>' . "\n";
     if (!empty($submitGroupWorkUrl)) {
         // Secure download
         $file = $submitGroupWorkUrl;
         // FIXME : secureDocumentDownload ?
         if ($GLOBALS['is_Apache'] && get_conf('secureDocumentDownload')) {
             $groupWorkUrl = Url::Contextualize(get_path('clarolineRepositoryWeb') . 'backends/download.php' . str_replace('%2F', '/', rawurlencode($file)) . '?gidReq=' . claro_get_current_group_id());
         } else {
             $groupWorkUrl = Url::Contextualize(get_path('clarolineRepositoryWeb') . 'backends/download.php?url=' . rawurlencode($file) . '&gidReq=' . claro_get_current_group_id());
         }
         $out .= '<dd>' . '<input type="hidden" name="submitGroupWorkUrl" value="' . claro_htmlspecialchars($submitGroupWorkUrl) . '" />' . '<a href="' . claro_htmlspecialchars($groupWorkUrl) . '">' . basename($file) . '</a>' . '</dd>' . "\n";
     } else {
         $maxFileSize = min(get_max_upload_size($maxFilledSpace, $assignment->getAssigDirSys()), $fileAllowedSize);
         $out .= '<dd>' . "\n" . '<input type="file" name="wrkFile" id="wrkFile" size="30" /><br />' . '<p class="notice">' . get_lang('Max file size : %size', array('%size' => format_file_size($maxFileSize))) . '</p></td>' . "\n" . '</dd>' . "\n\n";
     }
 }
 if ($assignmentContent == "FILE" && !$is_feedback) {
     // display standard html textarea
     // used for description of an uploaded file
     $out .= '<dt>' . '<label for="wrkTxt">' . get_lang('File description') . '<br /></label>' . '</dt>' . '<dd>' . "\n" . '<textarea name="wrkTxt" cols="40" rows="10">' . $form['wrkTxt'] . '</textarea>' . '</dd>' . "\n";
 } elseif ($assignmentContent == "TEXT" || $assignmentContent == "TEXTFILE" || $is_feedback) {
     // display enhanced textarea using claro_html_textarea_editor
     $out .= '<dt>' . '<label for="wrkTxt">' . get_lang('Answer') . '&nbsp;<span class="required">*</span></label></dt>' . "\n" . '<dd>' . claro_html_textarea_editor('wrkTxt', $form['wrkTxt']) . '</dd>' . "\n\n";
 }
 if ($is_feedback) {
     $out .= '<dt>' . '<label for="wrkPrivFbk">' . get_lang('Private feedback') . '<br />' . '<small>' . get_lang('Course administrator only') . '</small>' . '</label></dt>' . '<dd>' . "\n" . '<textarea name="wrkPrivFbk" cols="40" rows="10">' . $san->sanitize($form['wrkPrivFbk']) . '</textarea>' . '</dd>' . "\n\n";
     // if this is a correction we have to add an input for the score/grade/results/points
     $wrkScoreField = '<select name="wrkScore" id="wrkScore">' . "\n" . '<option value="-1"';
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:user_work.php


注:本文中的get_max_upload_size函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。