当前位置: 首页>>代码示例>>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;未经允许,请勿转载。