Ejemplo n.º 1
0
 /**
  * Executes the widget.
  */
 public function run()
 {
     $blacklisted_objects = explode(',', Setting::GetText('showFilesWidgetBlacklist', 'file'));
     if (!in_array(get_class($this->object), $blacklisted_objects)) {
         $files = \humhub\modules\file\models\File::getFilesOfObject($this->object);
         return $this->render('showFiles', array('files' => $files, 'maxPreviewImageWidth' => Setting::Get('maxPreviewImageWidth', 'file'), 'maxPreviewImageHeight' => Setting::Get('maxPreviewImageHeight', 'file'), 'hideImageFileInfo' => Setting::Get('hideImageFileInfo', 'file')));
     }
 }
Ejemplo n.º 2
0
 /**
  * Draw the widget
  */
 public function run()
 {
     $files = array();
     if ($this->object !== null) {
         $files = \humhub\modules\file\models\File::getFilesOfObject($this->object);
     }
     return $this->render('fileUploadList', array('uploaderId' => $this->uploaderId, 'files' => $files));
 }
Ejemplo n.º 3
0
 /**
  * Draw the widget
  */
 public function run()
 {
     $files = array();
     if ($this->object !== null) {
         if ($this->object->isNewRecord && $this->object->getRelation('content', false) !== null) {
             $files = File::findAll(['guid' => array_map('trim', explode(',', $this->object->content->attachFileGuidsAfterSave))]);
         } else {
             $files = File::getFilesOfObject($this->object);
         }
     }
     return $this->render('fileUploadList', array('uploaderId' => $this->uploaderId, 'files' => $files));
 }
 /**
  * Executes the widget.
  */
 public function run()
 {
     if ($this->object instanceof ContentActiveRecord) {
         $widget = $this->object->getWallEntryWidget();
         // File widget disabled in this wall entry
         if ($widget->showFiles === false) {
             return;
         }
     }
     $blacklisted_objects = explode(',', Setting::GetText('showFilesWidgetBlacklist', 'file'));
     if (!in_array(get_class($this->object), $blacklisted_objects)) {
         $files = \humhub\modules\file\models\File::getFilesOfObject($this->object);
         return $this->render('showFiles', array('files' => $files, 'maxPreviewImageWidth' => Setting::Get('maxPreviewImageWidth', 'file'), 'maxPreviewImageHeight' => Setting::Get('maxPreviewImageHeight', 'file'), 'hideImageFileInfo' => Setting::Get('hideImageFileInfo', 'file')));
     }
 }