當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Cabinet::setMessage方法代碼示例

本文整理匯總了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();
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:33,代碼來源:Image_Manager.php

示例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;
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:31,代碼來源:Multimedia_Manager.php

示例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());
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:34,代碼來源:Document_Manager.php


注:本文中的Cabinet::setMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。