Skip to content
Snippets Groups Projects
Select Git revision
  • a3da1483a9e689846179159355badfec8073dbec
  • main default protected
  • step-01354-5.5
  • biest-504
  • issue-3215
  • step-03209-bald-rapunzel
  • tic-3123
  • tic-2720-remove-less-compilation-in-plugins
  • step-1800
  • tic-2532
  • biest-561
  • tic-3225
  • 5.3
  • 5.4
  • step-2472
  • step-2660
  • step-1559
  • tic-3094
  • biest-3206
  • biest-3207
  • 5.0
  • v5.3.1
  • v5.2.3
  • v5.1.4
  • v5.0.6
  • v5.3
  • v5.2.2
  • v5.1.3
  • v5.0.5
  • v5.2.1
  • v5.1.2
  • v5.0.4
  • v5.2
  • v5.1.1
  • v5.0.3
  • v5.1
  • v5.0.2
  • v5.0.1
  • v5.0
39 results

StructuralElementsImageUpload.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    UnknownFileType.php 4.79 KiB
    <?php
    /**
     * UnknownFileType.php
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License as
     * published by the Free Software Foundation; either version 2 of
     * the License, or (at your option) any later version.
     *
     * @author    André Noack <noack@data-quest.de>
     * @copyright 2020 Stud.IP Core-Group
     * @license   http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
     * @category  Stud.IP
     */
    
    class UnknownFileType implements FileType, ArrayAccess
    {
        /**
         * @var FileRef
         */
        protected $fileref = null;
    
        public function __construct($fileref = null)
        {
            $this->fileref = $fileref;
        }
    
        /**
         * magic method for dynamic properties
         */
        public function __get($name)
        {
            return isset($this->fileref->$name) ? $this->fileref->$name : null;
        }
    
        /**
         * magic method for dynamic properties
         */
        public function __set($name, $value)
        {
            return isset($this->fileref->$name) ? $this->fileref->$name = $value : null;
        }
    
        /**
         * magic method for dynamic properties
         */
        public function __isset($name)
        {
            return isset($this->fileref->$name);
        }
    
        /**
         * ArrayAccess: Check whether the given offset exists.
         */
        public function offsetExists($offset)
        {
            return $this->__isset($offset);
        }
    
        /**
         * ArrayAccess: Get the value at the given offset.
         */
        public function offsetGet($offset)
        {
            return $this->__get($offset);
        }
    
        /**
         * ArrayAccess: Set the value at the given offset.
         */
        public function offsetSet($offset, $value)
        {
            $this->__set($offset, $value);
        }
    
        /**
         * ArrayAccess: unset the value at the given offset (not applicable)
         */
        public function offsetUnset($offset)
        {
    
        }
        /**
         * @inheritDoc
         */
        public function getIcon($role)
        {
            return Icon::create('file', $role);
        }
    
        /**
         * @inheritDoc
         */
        public function getId()
        {
            return $this->id;
        }
    
        /**
         * @inheritDoc
         */
        public function getFilename()
        {
            return trim($this->name . ' (' . _('Unbekannter Dateityp') .  ')');
        }
    
        /**
         * @inheritDoc
         */
        public function getUserId()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getUserName()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getUser()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getSize()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getDownloadURL()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getDownloads()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getPath(): string
        {
            return '';
        }
    
        /**
         * @inheritDoc
         */
        public function getLastChangeDate()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getMakeDate()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getDescription()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getMimeType()
        {
            return 'application/octet-stream';
        }
    
        /**
         * @inheritDoc
         */
        public function getTermsOfUse()
        {
            return new ContentTermsOfUse();
        }
    
        /**
         * @inheritDoc
         */
        public function getActionmenu()
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getInfoDialogButtons(array $extra_link_params = []): array
        {
            return [];
        }
    
        /**
         * @inheritDoc
         */
        public function delete()
        {
            return 0;
        }
    
        /**
         * @inheritDoc
         */
        public function getFolderType()
        {
            return $this->folder ? $this->folder->getTypedFolder() : null;
        }
    
        /**
         * @inheritDoc
         */
        public function isVisible($user_id = null)
        {
            return true;
        }
    
        /**
         * @inheritDoc
         */
        public function isDownloadable($user_id = null)
        {
            return false;
        }
    
        /**
         * @inheritDoc
         */
        public function isEditable($user_id = null)
        {
            return false;
        }
    
        /**
         * @inheritDoc
         */
        public function isWritable($user_id = null)
        {
            return false;
        }
    
        /**
         * @inheritDoc
         */
        public function convertToStandardFile()
        {
            throw new RuntimeException('object of type ' . __CLASS__ . ' could not be converted to StandardFile');
        }
    
        /**
         * @inheritDoc
         */
        public function getContentForAdditionalColumn($column_index)
        {
        }
    
        /**
         * @inheritDoc
         */
        public function getAdditionalColumnOrderWeigh($column_index)
        {
            return 0;
        }
    
        /**
         * @inheritDoc
         */
        public function getInfoTemplate(bool $include_downloadable_infos = false)
        {
            return '';
        }
    }