openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 5a86656061b17db14b98b3f9c6f05f392adebff5
parent eb4a08c8fce62cbf891a839484d2c934346d4923
Author: dankert <devnull@localhost>
Date:   Thu, 19 Nov 2009 00:14:44 +0100

Data-URIs für Bilder ermöglichen.

Diffstat:
MactionClasses/ElementAction.class.php | 4+++-
MactionClasses/PageelementAction.class.php | 16+++++++++++-----
Mlanguage/de.ini.php | 2++
MobjectClasses/Value.class.php | 6++++++
Mthemes/default/templates/element/properties.tpl.src.php | 2+-
5 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/actionClasses/ElementAction.class.php b/actionClasses/ElementAction.class.php @@ -225,8 +225,10 @@ class ElementAction extends Action break; case 'link': - $subtypes = Array('file,page,link', + $subtypes = Array( 'file', + 'image', + 'image_data_uri', 'page', 'link' ); $convertToLang = true; diff --git a/actionClasses/PageelementAction.class.php b/actionClasses/PageelementAction.class.php @@ -376,10 +376,15 @@ class PageelementAction extends Action { // Ermitteln, welche Objekttypen verlinkt werden d�rfen. - if ( empty($this->value->element->subtype) ) - $types = array('page','file','link'); // Fallback: Alle erlauben :) + $type = $this->value->element->subtype; + + if ( substr($type,0,5) == 'image' ) + $type = 'file'; + + if ( !in_array($type,array('file','page','link')) ) + $types = array('file','page','link'); else - $types = explode(',',$this->value->element->subtype ); + $types = array($type); $objects = array(); @@ -405,8 +410,9 @@ class PageelementAction extends Action $this->setTemplateVar('linkobjectid',$this->value->linkToObjectId); if ( $this->getSessionVar('pageaction') != '' ) - $this->setTemplateVar('old_pageaction',$this->getSessionVar('pageaction')); - else $this->setTemplateVar('old_pageaction','show' ); + $this->setTemplateVar('old_pageaction',$this->getSessionVar('pageaction')); + else + $this->setTemplateVar('old_pageaction','show' ); } diff --git a/language/de.ini.php b/language/de.ini.php @@ -193,6 +193,8 @@ EL_INSERT_INLINE="Internes Einf EL_INSERT_SSI="Einfügen per Serverside-Include (SSI)" EL_LINK_DESC = "Ein Link ist eine Verknüpfung mit einer Seite oder einer Datei" EL_LINK_FILE = "Link auf Dateien" +EL_LINK_IMAGE = "Link auf Bilder" +EL_LINK_IMAGE_DATA_URI = "Link auf Bilder mit Data-URI" EL_LINKINFO_CREATE_USER_DESC = "Erstellungsautor: Beschreibung" EL_LINKINFO_CREATE_USER_FULLNAME = "Erstellungsautor: Voller Name" EL_LINKINFO_CREATE_USER_MAIL = "Erstellungsautor: E-Mail" diff --git a/objectClasses/Value.class.php b/objectClasses/Value.class.php @@ -647,6 +647,12 @@ SQL $o->load(); $inhalt = $o->name; } + elseif ($this->element->subtype == 'image_data_uri' ) + { + $file = new File($objectid); + $file->load(); + $inhalt = 'data:'.$file->mimeType().';base64,'.base64_encode($file->loadValue()); + } else { $inhalt = $this->page->path_to_object( $objectid ); diff --git a/themes/default/templates/element/properties.tpl.src.php b/themes/default/templates/element/properties.tpl.src.php @@ -9,7 +9,7 @@ page # Subtype ist eine Auswahlliste if present:subtypes - selectbox name:subtype list:subtypes + selectbox name:subtype list:subtypes addempty:true # Subtype ist ein einfaches Eingabefeld if not:true present:subtypes