openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit 73b00b48efeb2189e564eac0340205a146d6d0cf
parent 369d7dcc4210be52a72c6fed10b519cfdb9180eb
Author: Jan Dankert <develop@jandankert.de>
Date:   Thu, 14 Nov 2019 00:32:30 +0100

New: A file can be a proxy to another file. This is useful for linking files in another projects without having external links.

Diffstat:
modules/cms-core/model/File.class.php | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/cms-core/model/File.class.php b/modules/cms-core/model/File.class.php @@ -388,10 +388,18 @@ EOF { // Read from cache, if cache exist and is not too old. + $settings = $this->getSettings(); + $proxyFileId = @$settings['proxy-file-id']; + + if ( $proxyFileId ) + $objectid = $proxyFileId; // This is a proxy for another file. + else + $objectid = $this->objectid; + $sql = db()->sql( 'SELECT size,value'. ' FROM {{file}}'. ' WHERE objectid={objectid}' ); - $sql->setInt( 'objectid',$this->objectid ); + $sql->setInt( 'objectid', $objectid); $row = $sql->getRow(); if ( count($row) != 0 )