commit 96ec8bb2c9b5a8827b742500b83a390479fa6f10
parent 108111ff2e553f950749bfce049e00be1147ec63
Author: Jan Dankert <develop@jandankert.de>
Date: Thu, 6 Jun 2019 23:30:48 +0200
New: Flag relative/absolute Links im Projekt speichern und in der Publish-Strategy auswerten.
Diffstat:
8 files changed, 209 insertions(+), 182 deletions(-)
diff --git a/modules/cms-core/action/ProjectAction.class.php b/modules/cms-core/action/ProjectAction.class.php
@@ -67,6 +67,7 @@ class ProjectAction extends Action
$this->project->cut_index = $this->getRequestVar('cut_index' ,OR_FILTER_NUMBER );
$this->project->publishFileExtension = $this->getRequestVar('publishFileExtension',OR_FILTER_NUMBER );
$this->project->publishPageExtension = $this->getRequestVar('publishPageExtension',OR_FILTER_NUMBER );
+ $this->project->linkAbsolute = $this->getRequestVar('linksAbsolute' ,OR_FILTER_NUMBER ) == '1';
$this->addNotice('project',$this->project->name,'SAVED','ok');
$this->project->save(); // speichern
@@ -163,7 +164,10 @@ class ProjectAction extends Action
*/
function propView()
{
- $extraProperties = array('rootobjectid'=>$this->project->getRootObjectId());
+ $extraProperties = array(
+ 'rootobjectid' => $this->project->getRootObjectId(),
+ 'linksAbsolute' => $this->project->linkAbsolute?'1':'0'
+ );
$this->setTemplateVars( $this->project->getProperties() + $extraProperties );
diff --git a/modules/cms-core/model/Project.class.php b/modules/cms-core/model/Project.class.php
@@ -19,6 +19,7 @@ class Project extends ModelBase
const FLAG_CONTENT_NEGOTIATION = 2;
const FLAG_PUBLISH_FILE_EXTENSION = 4;
const FLAG_PUBLISH_PAGE_EXTENSION = 8;
+ const FLAG_LINK_ABSOLUTE = 16;
// Eigenschaften
@@ -59,6 +60,8 @@ class Project extends ModelBase
public $log = array();
+ public $linkAbsolute;
+
// Konstruktor
@@ -252,6 +255,7 @@ class Project extends ModelBase
$this->content_negotiation = $row['flags']&self::FLAG_CONTENT_NEGOTIATION;
$this->publishFileExtension = $row['flags']&self::FLAG_PUBLISH_FILE_EXTENSION;
$this->publishPageExtension = $row['flags']&self::FLAG_PUBLISH_PAGE_EXTENSION;
+ $this->linkAbsolute = $row['flags']&self::FLAG_LINK_ABSOLUTE;
return $this;
}
@@ -278,6 +282,7 @@ class Project extends ModelBase
$this->content_negotiation = $row['flags']&self::FLAG_CONTENT_NEGOTIATION;
$this->publishFileExtension = $row['flags']&self::FLAG_PUBLISH_FILE_EXTENSION;
$this->publishPageExtension = $row['flags']&self::FLAG_PUBLISH_PAGE_EXTENSION;
+ $this->linkAbsolute = $row['flags']&self::FLAG_LINK_ABSOLUTE;
}
@@ -308,9 +313,10 @@ SQL
$flags = 0;
if( $this->cut_index) $flags |= self::FLAG_CUT_INDEX;
- if( $this->content_negotiation) $flags |= self::FLAG_CONTENT_NEGOTIATION;
+ if( $this->content_negotiation ) $flags |= self::FLAG_CONTENT_NEGOTIATION;
if( $this->publishFileExtension) $flags |= self::FLAG_PUBLISH_FILE_EXTENSION;
if( $this->publishPageExtension) $flags |= self::FLAG_PUBLISH_PAGE_EXTENSION;
+ if( $this->linkAbsolute ) $flags |= self::FLAG_LINK_ABSOLUTE;
$sql->setInt ('flags' ,$flags );
$sql->setInt ('projectid' ,$this->projectid );
diff --git a/modules/cms-publish/PublishPublic.class.php b/modules/cms-publish/PublishPublic.class.php
@@ -14,8 +14,6 @@ use Logger;
use OpenRatException;
use Session;
-define('OR_LINK_SCHEMA_ABSOLUTE',1);
-define('OR_LINK_SCHEMA_RELATIVE',2);
/**
@@ -26,21 +24,150 @@ define('OR_LINK_SCHEMA_RELATIVE',2);
class PublishPublic extends Publish
{
+ const SCHEMA_ABSOLUTE = 1;
+ const SCHEMA_RELATIVE = 2;
+
+
+ /**
+ * Enthaelt bei Bedarf das FTP-Objekt. N�mlich dann, wenn
+ * zu einem FTP-Server veroeffentlicht werden soll.
+ * @var Object
+ */
+ private $ftp;
+
+ private $localDestinationDirectory = '';
+
+ /**
+ * Enthaelt die gleichnamige Einstellung aus dem Projekt.
+ * @var boolean
+ */
+ private $contentNegotiation = false;
+
+ /**
+ * Enthaelt die gleichnamige Einstellung aus dem Projekt.
+ * @var boolean
+ */
+ private $cutIndex = false;
+
+ /**
+ * Enthaelt die gleichnamige Einstellung aus dem Projekt.
+ * @var String
+ */
+ private $commandAfterPublish = '';
+
+ /**
+ * Enthaelt am Ende der Ver�ffentlichung ein Array mit den ver�ffentlichten Objekten.
+ * @var Array
+ */
+ public $publishedObjects = array();
+
+ /**
+ * Enthaelt im Fehlerfall (wenn 'ok' auf 'false' steht) eine
+ * Fehlermeldung.
+ *
+ * @var String
+ */
+ public $log = array();
+
+ /**
+ * Konstruktor.<br>
+ * <br>
+ * Oeffnet ggf. Verbindungen.
+ *
+ * @return Publish
+ */
+ public function __construct( $projectid )
+ {
+ $confPublish = config('publish');
+
+ $project = Project::create( $projectid );
+ $project->load();
+
+ $this->linkSchema = ($project->linkAbsolute ? self::SCHEMA_ABSOLUTE : self::SCHEMA_RELATIVE);
+
+ // Feststellen, ob FTP benutzt wird.
+ // Dazu muss FTP aktiviert sein (enable=true) und eine URL vorhanden sein.
+ $ftpUrl = '';
+ if ( $confPublish['ftp']['enable'] )
+ {
+ if ( $confPublish['ftp']['per_project'] && !empty($project->ftp_url) )
+ $ftpUrl = $project->ftp_url;
+ elseif ( !empty($confPublish['ftp']['host']) )
+ $ftpUrl = $project->ftp_url;
+ }
+
+ if ( $ftpUrl && $ftpUrl[0]!='#' )
+ {
+ $this->ftp = new \Ftp($project->ftp_url); // Aufbauen einer FTP-Verbindung
+
+ $this->ftp->passive = ( $project->ftp_passive == '1' );
+ }
+
+ $localDir = rtrim( $project->target_dir,'/' );
+
+ if ( $confPublish['filesystem']['per_project'] && (!empty($localDir)) )
+ {
+ $this->localDestinationDirectory = $localDir; // Projekteinstellung verwenden.
+ }
+ else
+ {
+ if ( ! $localDir )
+ $localDir = $project->name;
+
+ // Konfiguriertes Verzeichnis verwenden.
+ $this->localDestinationDirectory = $confPublish['filesystem']['directory'].$localDir;
+ }
+
+
+ // Sofort pruefen, ob das Zielverzeichnis ueberhaupt beschreibbar ist.
+ if ( $this->localDestinationDirectory && $this->localDestinationDirectory[0] == '#')
+ $this->localDestinationDirectory = '';
+
+ if ( $this->localDestinationDirectory )
+ {
+ if ( !is_writeable( $this->localDestinationDirectory ) )
+ throw new OpenRatException('ERROR_PUBLISH','directory not writable: '.$this->localDestinationDirectory );
+ }
+
+ $this->contentNegotiation = ( $project->content_negotiation == '1' );
+ $this->cutIndex = ( $project->cut_index == '1' );
+
+ if ( $confPublish['command']['enable'] )
+ {
+ if ( $confPublish['command']['per_project'] && !empty($project->cmd_after_publish) )
+ $this->commandAfterPublish = $project->cmd_after_publish;
+ else
+ $this->commandAfterPublish = @$confPublish['command']['command'];
+ }
+
+ // Im Systemkommando Variablen ersetzen
+ $this->commandAfterPublish = str_replace('{name}' ,$project->name ,$this->commandAfterPublish);
+ $this->commandAfterPublish = str_replace('{dir}' ,$this->localDestinationDirectory ,$this->commandAfterPublish);
+ $this->commandAfterPublish = str_replace('{dirbase}',basename($this->localDestinationDirectory),$this->commandAfterPublish);
+
+ if ( config('security','nopublish') )
+ {
+ Logger::warn('publishing is disabled.');
+ $this->commandAfterPublish = '';
+ $this->localDestinationDirectory = '';
+ $this->ftp = null;
+ }
+ }
+
+
+
+ /**
+ * @var int
+ */
+ private $linkSchema;
+
/**
* @param $from \cms\model\Page
* @param $to \cms\model\BaseObject
*/
public function linkToObject( $from, $to ) {
- if ( config('publish','url') == 'relative')
- $schema = OR_LINK_SCHEMA_RELATIVE;
- else
- $schema = OR_LINK_SCHEMA_ABSOLUTE;
-
- // If the target has an alias, use this alias as the target.
- //$alias = $to->getAlias();
- //if ( $alias->filename )
- //$to = $alias;
+ $schema = $this->linkSchema;
switch( $to->typeid )
{
@@ -117,25 +244,25 @@ class PublishPublic extends Publish
{
// Target object is in another project.
// we have to use absolute URLs.
- $schema = OR_LINK_SCHEMA_ABSOLUTE;
+ $schema = self::SCHEMA_ABSOLUTE;
// Target is in another Project. So we have to create an absolute URL.
$targetProject = Project::create( $to->projectid )->load();
- $prefix = $targetProject->url;
+ $host = $targetProject->url;
- if ( ! strpos($prefix,'//' ) === FALSE ) {
+ if ( ! strpos($host,'//' ) === FALSE ) {
// No protocol in hostname. So we have to prepend the URL with '//'.
- $prefix = '//'.$prefix;
+ $host = '//'.$host;
}
}
else {
- $prefix = '';
+ $host = '';
}
- if ( $schema == OR_LINK_SCHEMA_RELATIVE )
+ if ( $schema == self::OR_LINK_SCHEMA_RELATIVE )
{
$folder = new Folder( $from->getParentFolderId() );
$folder->load();
@@ -181,9 +308,10 @@ class PublishPublic extends Publish
}
- $uri = $prefix . $path . $filename;
+ $uri = $host . $path . $filename;
- if( empty($uri)) $uri = '.';
+ if( !$uri )
+ $uri = '.';
return $uri;
}
@@ -193,142 +321,6 @@ class PublishPublic extends Publish
/**
- * Enthaelt bei Bedarf das FTP-Objekt. N�mlich dann, wenn
- * zu einem FTP-Server veroeffentlicht werden soll.
- * @var Object
- */
- public $ftp;
-
- /**
- * Flag, ob in das lokale Dateisystem veroeffentlicht werden soll.
- * @var boolean
- */
- public $with_local = false;
-
- /**
- * Flag, ob zu einem FTP-Server ver�ffentlicht werden soll.
- * @var boolean
- */
- public $with_ftp = false;
-
- public $local_destdir = '';
-
- /**
- * Enthaelt die gleichnamige Einstellung aus dem Projekt.
- * @var boolean
- */
- public $content_negotiation = false;
-
- /**
- * Enthaelt die gleichnamige Einstellung aus dem Projekt.
- * @var boolean
- */
- public $cut_index = false;
-
- /**
- * Enthaelt die gleichnamige Einstellung aus dem Projekt.
- * @var String
- */
- public $cmd_after_publish = '';
-
- /**
- * Enthaelt am Ende der Ver�ffentlichung ein Array mit den ver�ffentlichten Objekten.
- * @var Array
- */
- public $publishedObjects = array();
-
- /**
- * Enthaelt im Fehlerfall (wenn 'ok' auf 'false' steht) eine
- * Fehlermeldung.
- *
- * @var String
- */
- public $log = array();
-
- /**
- * Konstruktor.<br>
- * <br>
- * Oeffnet ggf. Verbindungen.
- *
- * @return Publish
- */
- public function __construct( $projectid )
- {
- $confPublish = config('publish');
-
- if ( config('security','nopublish') )
- {
- Logger::warn('publishing is disabled.');
- return; // this is no error.
- }
-
- $project = new Project( $projectid );
- $project->load();
-
- // Feststellen, ob FTP benutzt wird.
- // Dazu muss FTP aktiviert sein (enable=true) und eine URL vorhanden sein.
- $ftpUrl = '';
- if ( $confPublish['ftp']['enable'] )
- {
- if ( $confPublish['ftp']['per_project'] && !empty($project->ftp_url) )
- $ftpUrl = $project->ftp_url;
- elseif ( !empty($confPublish['ftp']['host']) )
- $ftpUrl = $project->ftp_url;
- }
-
- if ( $ftpUrl && $ftpUrl[0]!='#' )
- {
- $this->with_ftp = true;
- $this->ftp = new \Ftp($project->ftp_url); // Aufbauen einer FTP-Verbindung
-
- $this->ftp->passive = ( $project->ftp_passive == '1' );
- }
-
- $localDir = rtrim( $project->target_dir,'/' );
-
- if ( $confPublish['filesystem']['per_project'] && (!empty($localDir)) )
- {
- $this->local_destdir = $localDir; // Projekteinstellung verwenden.
- }
- else
- {
- if ( empty( $localDir))
- $localDir = $project->name;
-
- // Konfiguriertes Verzeichnis verwenden.
- $this->local_destdir = $confPublish['filesystem']['directory'].$localDir;
- }
-
-
- // Sofort pruefen, ob das Zielverzeichnis ueberhaupt beschreibbar ist.
- if ( $this->local_destdir && $this->local_destdir[0] != '#')
- {
- if ( !is_writeable( $this->local_destdir ) )
- throw new OpenRatException('ERROR_PUBLISH','directory not writable: '.$this->local_destdir );
-
- $this->with_local = true;
- }
-
- $this->content_negotiation = ( $project->content_negotiation == '1' );
- $this->cut_index = ( $project->cut_index == '1' );
-
- if ( $confPublish['command']['enable'] )
- {
- if ( $confPublish['command']['per_project'] && !empty($project->cmd_after_publish) )
- $this->cmd_after_publish = $project->cmd_after_publish;
- else
- $this->cmd_after_publish = @$confPublish['command']['command'];
- }
-
- // Im Systemkommando Variablen ersetzen
- $this->cmd_after_publish = str_replace('{name}' ,$project->name ,$this->cmd_after_publish);
- $this->cmd_after_publish = str_replace('{dir}' ,$this->local_destdir ,$this->cmd_after_publish);
- $this->cmd_after_publish = str_replace('{dirbase}',basename($this->local_destdir),$this->cmd_after_publish);
- }
-
-
-
- /**
* Kopieren einer Datei aus dem tempor�ren Verzeichnis in das Zielverzeichnis.<br>
* Falls notwenig, wird ein Hochladen per FTP ausgef�hrt.
*
@@ -340,9 +332,9 @@ class PublishPublic extends Publish
global $conf;
$source = $tmp_filename;
- if ( $this->with_local )
+ if ( $this->localDestinationDirectory )
{
- $dest = $this->local_destdir.'/'.$dest_filename;
+ $dest = $this->localDestinationDirectory.'/'.$dest_filename;
if (!@copy( $source,$dest ));
{
@@ -370,7 +362,7 @@ class PublishPublic extends Publish
}
}
- if ( $this->with_ftp ) // Falls FTP aktiviert
+ if ( $this->ftp ) // Falls FTP aktiviert
{
$dest = $dest_filename;
$this->ftp->put( $source,$dest );
@@ -423,23 +415,23 @@ class PublishPublic extends Publish
*/
public function close()
{
- if ( $this->with_ftp )
+ if ( $this->ftp )
{
Logger::debug('Closing FTP connection' );
$this->ftp->close();
}
// Ausfuehren des Systemkommandos.
- if ( !empty($this->cmd_after_publish) )
+ if ( !empty($this->commandAfterPublish) )
{
$ausgabe = array();
$rc = false;
- Logger::debug('Executing system command: '.$this->cmd_after_publish );
+ Logger::debug('Executing system command: '.$this->commandAfterPublish );
$user = Session::getUser();
putenv("CMS_USER_NAME=".$user->name );
putenv("CMS_USER_ID=" .$user->userid);
putenv("CMS_USER_MAIL=".$user->mail );
- exec( $this->cmd_after_publish,$ausgabe,$rc );
+ exec( $this->commandAfterPublish,$ausgabe,$rc );
if ( $rc != 0 ) // Wenn Returncode ungleich 0, dann Fehler melden.
throw new OpenRatException('ERROR_PUBLISH','System command failed - returncode is '.$rc."\n".
@@ -460,8 +452,8 @@ class PublishPublic extends Publish
*/
public function clean()
{
- if ( !empty($this->local_destdir) )
- $this->cleanFolder($this->local_destdir);
+ if ( !empty($this->localDestinationDirectory) )
+ $this->cleanFolder($this->localDestinationDirectory);
}
diff --git a/modules/cms-ui/themes/default/html/views/project/prop.php b/modules/cms-ui/themes/default/html/views/project/prop.php
@@ -3,7 +3,7 @@
<form name="" target="_self" data-target="view" action="./" data-method="prop" data-action="project" data-id="<?php echo OR_ID ?>" method="POST" enctype="application/x-www-form-urlencoded" class="or-form project" data-async="" data-autosave=""><input type="hidden" name="<?php echo REQ_PARAM_EMBED ?>" value="1" /><input type="hidden" name="<?php echo REQ_PARAM_TOKEN ?>" value="<?php echo token() ?>" /><input type="hidden" name="<?php echo REQ_PARAM_ACTION ?>" value="project" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="prop" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
- <fieldset class="toggle-open-close<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend class="on-click-open-close"><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('NAME') ?></legend><div>
+ <fieldset class="toggle-open-close<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend class="on-click-open-close"><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('NAME') ?></legend><div class="closable">
<div class="line">
<div class="label">
<label for="<?php echo REQUEST_ID ?>_name" class="label"><?php echo lang('PROJECT_NAME') ?>
@@ -25,7 +25,7 @@
</div>
</div>
</div></fieldset>
- <fieldset class="toggle-open-close<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend class="on-click-open-close"><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('PUBLISH') ?></legend><div>
+ <fieldset class="toggle-open-close<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend class="on-click-open-close"><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('PUBLISH') ?></legend><div class="closable">
<div class="line">
<div class="label">
<label for="<?php echo REQUEST_ID ?>_target_dir" class="label"><?php echo lang('PROJECT_TARGET_DIR') ?>
@@ -90,8 +90,12 @@
</label>
</div>
</div>
+ <label class="or-form-row"><span class="or-form-label"></span><span class="or-form-input"><input class="" type="radio" id="<?php echo REQUEST_ID ?>_linksAbsolute_0" name="<?php if ('') echo ''.'_' ?>linksAbsolute<?php if ('') echo '_disabled' ?>" value="0"<?php if('0'==@$linksAbsolute)echo ' checked="checked"' ?> /> ?LINKS_RELATIVE? </span></label>
+
+ <label class="or-form-row"><span class="or-form-label"></span><span class="or-form-input"><input class="" type="radio" id="<?php echo REQUEST_ID ?>_linksAbsolute_1" name="<?php if ('') echo ''.'_' ?>linksAbsolute<?php if ('') echo '_disabled' ?>" value="1"<?php if('1'==@$linksAbsolute)echo ' checked="checked"' ?> /> ?LINKS_ABSOLUTE? </span></label>
+
</div></fieldset>
- <fieldset class="toggle-open-close<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend class="on-click-open-close"><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('project_FTP') ?></legend><div>
+ <fieldset class="toggle-open-close<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend class="on-click-open-close"><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('project_FTP') ?></legend><div class="closable">
<div class="line">
<div class="label">
<label for="<?php echo REQUEST_ID ?>_ftp_url" class="label"><?php echo lang('PROJECT_FTP_URL') ?>
@@ -121,7 +125,7 @@
</div>
</div>
</div></fieldset>
- <fieldset class="toggle-open-close<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend class="on-click-open-close"><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('options') ?></legend><div>
+ <fieldset class="toggle-open-close<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend class="on-click-open-close"><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('options') ?></legend><div class="closable">
<div class="line">
<div class="label">
</div>
diff --git a/modules/cms-ui/themes/default/html/views/project/prop.tpl.src.xml b/modules/cms-ui/themes/default/html/views/project/prop.tpl.src.xml
@@ -53,6 +53,10 @@
<label for="publishPageExtension" key="PROJECT_publish_page_Extension"></label>
</part>
</part>
+
+ <radio name="linksAbsolute" value="0" label="LINKS_RELATIVE" />
+ <radio name="linksAbsolute" value="1" label="LINKS_ABSOLUTE" />
+
</group>
<group title="message:project_FTP">
<part class="line">
diff --git a/modules/language/language.yml b/modules/language/language.yml
@@ -6148,4 +6148,10 @@ SOURCE:
en: Source
LEAVE_LINK:
de: Link hinterlassen
- en: Leave a link-
\ No newline at end of file
+ en: Leave a link
+LINKS_RELATIVE:
+ de: Relative Links
+ en: Relative links
+LINKS_ABSOLUTE:
+ de: Absolute Links
+ en: Absolute links+
\ No newline at end of file
diff --git a/modules/template-engine/components/html/radio/Radio.class.php b/modules/template-engine/components/html/radio/Radio.class.php
@@ -2,45 +2,55 @@
namespace template_engine\components;
-class RadioComponent extends Component
+class RadioComponent extends FieldComponent
{
// Bisher nicht in Benutzung.
public $readonly = false;
- public $name;
-
public $value;
public $prefix='';
public $suffix='';
- public $class;
+ public $class = '';
public $onchange;
public $children;
public $checked;
-
+
+ public $label = '';
+
public function begin()
{
+ if ( $this->label )
+ echo '<label class="or-form-row"><span class="or-form-label"></span><span class="or-form-input">';
+
+
echo '<input ';
- echo ' class="radio"';
+ echo ' class="'.$this->htmlvalue($this->class).'"';
echo ' type="radio"';
echo ' id="<?php echo REQUEST_ID ?>_'.$this->htmlvalue($this->name).'_'.$this->htmlvalue($this->value).'"';
- echo ' name="'.$this->htmlvalue($this->prefix).$this->htmlvalue($this->name).'"';
+
+ echo parent::outputNameAttribute();
//"<? php if ( $attr_readonly ) echo ' disabled="disabled"' ? >
echo ' value="'.$this->htmlvalue($this->value).'"';
- echo '<?php if(';
+
+ echo '<?php if(';
echo ''.''.$this->value($this->value).'==@$'.$this->varname($this->name);
if(isset($this->checked))
echo '||'.$this->value($this->checked);
echo ")echo ' checked=\"checked\"'".' ?>';
echo ' />';
- }
+
+ if ( $this->label )
+ echo ' '.lang($this->label).' </span></label>';
+
+ }
}
?>
\ No newline at end of file
diff --git a/modules/template-engine/components/template.xsd b/modules/template-engine/components/template.xsd
@@ -554,7 +554,6 @@
<xsd:element ref="tree" maxOccurs="unbounded" minOccurs="0"/>
</xsd:choice>
<xsd:attribute name="readonly" type="xsd:boolean"/>
- <xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="value" type="xsd:string"/>
<xsd:attribute name="prefix" type="xsd:string"/>
<xsd:attribute name="suffix" type="xsd:string"/>
@@ -562,6 +561,8 @@
<xsd:attribute name="onchange" type="xsd:string"/>
<xsd:attribute name="children" type="xsd:string"/>
<xsd:attribute name="checked" type="xsd:string"/>
+ <xsd:attribute name="label" type="xsd:string"/>
+ <xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="request" type="xsd:string"/>
</xsd:complexType>
<xsd:element name="set" type="setType"/>