本文整理汇总了PHP中Cabinet::setMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Cabinet::setMessage方法的具体用法?PHP Cabinet::setMessage怎么用?PHP Cabinet::setMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cabinet
的用法示例。
在下文中一共展示了Cabinet::setMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postImageUpload
/**
* From Cabinet::admin.
* Error checks and posts the image upload
*/
public function postImageUpload()
{
// importPost in File_Common
$result = $this->image->importPost('file_name');
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
$vars['timeout'] = '3';
$vars['refresh'] = 0;
$this->content = dgettext('filecabinet', 'An error occurred when trying to save your image.');
javascript('close_refresh', $vars);
return;
} elseif ($result) {
if ($this->image->id) {
$this->image->rotate(false);
}
$result = $this->image->save();
$this->updateResizes($this->image);
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
return false;
}
$this->image->moveToFolder();
javascript('close_refresh');
return true;
} else {
Cabinet::setMessage($this->image->printErrors());
\PHPWS_Core::goBack();
}
}
示例2: postMultimediaUpload
public function postMultimediaUpload()
{
$this->loadMultimedia();
$result = $this->multimedia->importPost('file_name');
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
$vars['timeout'] = '3';
$vars['refresh'] = 0;
$this->content = dgettext('filecabinet', 'An error occurred when trying to save your multimedia file.');
javascript('close_refresh', $vars);
return;
} elseif ($result) {
if (empty($_FILES['file_name']['name'])) {
$result = $this->multimedia->save(false, false);
} else {
$result = $this->multimedia->save();
}
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
$this->content = dgettext('filecabinet', 'An error occurred when trying to save your multimedia file.');
$this->content .= '<br /><strong>' . $result->getMessage() . '</strong>';
$this->content .= '<br /><br />' . javascript('close_window', array('value' => dgettext('filecabinet', 'Close this window')));
return;
}
$this->multimedia->moveToFolder();
javascript('close_refresh');
} else {
Cabinet::setMessage($this->multimedia->printErrors());
return;
}
}
示例3: postDocumentUpload
public function postDocumentUpload()
{
// importPost in File_Common
$result = $this->document->importPost('file_name');
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
$vars['timeout'] = '3';
$vars['refresh'] = 0;
javascript('close_refresh', $vars);
return dgettext('filecabinet', 'An error occurred when trying to save your document.');
} elseif ($result) {
$result = $this->document->save();
if (PHPWS_Error::logIfError($result)) {
$content = dgettext('filecabinet', '<p>Could not upload file to folder. Please check your directory permissions.</p>');
$content .= sprintf('<a href="#" onclick="window.close(); return false">%s</a>', dgettext('filecabinet', 'Close this window'));
Layout::nakedDisplay($content);
exit;
}
PHPWS_Core::initModClass('filecabinet', 'File_Assoc.php');
// This function doesn't do anything
//FC_File_Assoc::updateTag(FC_DOCUMENT, $this->document->id, $this->document->getTag());
$this->document->moveToFolder();
if (!isset($_POST['im'])) {
javascript('close_refresh');
} else {
javascriptMod('filecabinet', 'refresh_manager', array('document_id' => $this->document->id));
}
} else {
foreach ($this->document->_errors as $err) {
$message[] = $err->getMessage();
}
Cabinet::setMessage($this->document->printErrors());
}
}