本文整理汇总了PHP中uploader::clear方法的典型用法代码示例。如果您正苦于以下问题:PHP uploader::clear方法的具体用法?PHP uploader::clear怎么用?PHP uploader::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uploader
的用法示例。
在下文中一共展示了uploader::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reset
if ($_POST['is_exec_quickprj'] != 1) {
$error['logo'] = 'Необходимо выбрать файл';
}
}
} else {
$tmpPrj->clearLogo();
}
if (!$error) {
if (!$PDA) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/attachedfiles.php";
reset($_POST['IDResource']);
$uploader = new uploader(current($_POST['IDResource']));
$attachedfiles_files = $uploader->getFiles();
$tmpPrj->clearAttaches();
$tmpPrj->addAttachedFiles($attachedfiles_files, $draft_id && !$is_tmp_draft ? true : false);
$uploader->clear();
}
if ($PDA) {
// Удаление файла для ПДА версии
$idDel = __paramInit('int', NULL, 'atch');
if ($idDel <= 0 && $_FILES['attach']['error'][0] == 4) {
$tmpPrj->delAttach(0);
}
// сохранение файла
if (is_array($_FILES['attachedfiles_file']) && !$_FILES['attachedfiles_file']['error']) {
$_POST['attachedfiles_action'] = 'add';
$_POST['attachedfiles_type'] = 'project';
ob_start();
include $_SERVER['DOCUMENT_ROOT'] . "/attachedfiles.php";
ob_clean();
$attachedfiles_files = $attachedfiles->getFiles(array(1, 3, 4));
示例2: doActivation
public function doActivation($code)
{
$activation_data = $this->getActivation($code);
if (!$activation_data) {
return false;
}
$this->deleteActivation($code);
$current_uid = get_uid(false);
if ($current_uid) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/employer.php';
$user = new employer();
$user->GetUserByUID($current_uid);
$status = 1;
} else {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/registration.php';
$registration = new registration();
$user_data = $registration->autoRegistationAndLogin(array('uid' => $activation_data['user_id'], 'role' => 1, 'email' => $activation_data['email'], 'uname' => $activation_data['uname'], 'usurname' => $activation_data['usurname']));
if (!$user_data || !$user_data['ret']) {
return self::REDIRECT_AUTH_FAIL;
}
$status = $user_data['ret'];
$user = $user_data['user'];
}
$uid = $user->uid;
$redirect = false;
$data = $activation_data['data'];
switch ($activation_data['type']) {
case GuestConst::TYPE_PERSONAL_ORDER:
$data['emp_id'] = $uid;
require_once $_SERVER['DOCUMENT_ROOT'] . '/tu/models/TServiceOrderModel.php';
$orderModel = TServiceOrderModel::model();
if ($order = $orderModel->createPersonal($data)) {
$tservices_smail = new tservices_smail();
$tservices_smail->newOrder($order);
$redirect = sprintf(tservices_helper::url('order_card_url'), $order['id']);
}
break;
case GuestConst::TYPE_VACANCY:
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
$data['state'] = projects::STATE_MOVED_TO_VACANCY;
$date_public = null;
$redirect_layout = '/public/?step=1&kind=4&public=%s&popup=1';
case GuestConst::TYPE_PROJECT:
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
$key = md5(uniqid($uid));
$tmpPrj = new tmp_project($key);
$tmpPrj->initForUser($user);
if (isset($data['IDResource']) && !empty($data['IDResource'])) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/uploader/uploader.php';
$uploader = new uploader($data['IDResource']);
$attachedfiles_files = $uploader->getFiles();
$tmpPrj->clearAttaches();
$tmpPrj->addAttachedFiles($attachedfiles_files, false);
$uploader->clear();
}
if ($prj = $tmpPrj->addSimpleProject($data)) {
$_SESSION['new_public'] = 1;
$redirect = getFriendlyURL('project', $prj);
if (isset($redirect_layout)) {
$redirect = sprintf($redirect_layout, $prj['id']);
}
$src_id = $prj['id'];
//Если проект был создан при переходе с лендинга
//то привязываем его для статистики
if (isset($data['landingProjectId'])) {
require_once ABS_PATH . '/classes/LandingProjects.php';
LandingProjects::model()->linkWithProject($data['landingProjectId'], $src_id, !$activation_data['user_id']);
}
}
break;
}
//Обновляем приглашение
if (isset($activation_data['invite_id']) && $activation_data['invite_id'] > 0) {
$guestInviteModel = new GuestInviteModel();
$guestInviteModel->updateDateComeInvite($activation_data['invite_id'], array('src_id' => isset($src_id) ? $src_id : null, 'date_public' => isset($date_public) ? $date_public : null));
}
//Мессага с паролями для новеньких
if (!$activation_data['user_id'] && !$current_uid) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/Helpers/SubBarNotificationHelper.php';
SubBarNotificationHelper::getInstance()->setMessage($activation_data['type'], array('login' => $user->login, 'password' => $user->passwd), $user->uid);
} elseif ($status == users::AUTH_STATUS_2FA) {
$_SESSION['ref_uri'] = $redirect;
$redirect = '/auth/second/';
}
return $redirect;
}