commit ec6dd81c7742d811ec55153567ab792d1b881816
parent c5511f048b8a1b0568dd459c4314c772117534ad
Author: Jan Dankert <devnull@localhost>
Date: Fri, 3 Aug 2018 22:33:36 +0200
Projekte lesen/speichern jetzt den Hostnamen sowie noch ein paar weitere Optionen.
Diffstat:
4 files changed, 55 insertions(+), 23 deletions(-)
diff --git a/modules/cms-core/action/ProjectAction.class.php b/modules/cms-core/action/ProjectAction.class.php
@@ -50,14 +50,17 @@ class ProjectAction extends Action
{
if ( $this->getRequestVar('name') != '')
{
- $this->project->name = $this->getRequestVar('name' ,OR_FILTER_ALPHANUM);
- $this->project->target_dir = $this->getRequestVar('target_dir' ,OR_FILTER_RAW );
- $this->project->ftp_url = $this->getRequestVar('ftp_url' ,OR_FILTER_RAW );
- $this->project->ftp_passive = $this->getRequestVar('ftp_passive' ,OR_FILTER_RAW );
- $this->project->cmd_after_publish = $this->getRequestVar('cmd_after_publish' ,OR_FILTER_RAW );
- $this->project->content_negotiation = $this->getRequestVar('content_negotiation',OR_FILTER_NUMBER );
- $this->project->cut_index = $this->getRequestVar('cut_index' ,OR_FILTER_NUMBER );
-
+ $this->project->name = $this->getRequestVar('name' ,OR_FILTER_ALPHANUM);
+ $this->project->url = $this->getRequestVar('url' ,OR_FILTER_ALPHANUM);
+ $this->project->target_dir = $this->getRequestVar('target_dir' ,OR_FILTER_RAW );
+ $this->project->ftp_url = $this->getRequestVar('ftp_url' ,OR_FILTER_RAW );
+ $this->project->ftp_passive = $this->getRequestVar('ftp_passive' ,OR_FILTER_RAW );
+ $this->project->cmd_after_publish = $this->getRequestVar('cmd_after_publish' ,OR_FILTER_RAW );
+ $this->project->content_negotiation = $this->getRequestVar('content_negotiation',OR_FILTER_NUMBER );
+ $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->addNotice('project',$this->project->name,'SAVED','ok');
$this->project->save(); // speichern
diff --git a/modules/cms-core/model/Project.class.php b/modules/cms-core/model/Project.class.php
@@ -20,12 +20,19 @@ use Session;
class Project extends ModelBase
{
// Eigenschaften
- var $projectid;
- var $name;
- var $target_dir;
- var $ftp_url;
- var $ftp_passive;
- var $cmd_after_publish;
+ public $projectid;
+ public $name;
+ public $target_dir;
+ public $ftp_url;
+
+ /**
+ * Hostname
+ * @var string
+ */
+ public $url;
+
+ public $ftp_passive;
+ public $cmd_after_publish;
/**
@@ -48,7 +55,7 @@ class Project extends ModelBase
*/
public $publishPageExtension = true;
- var $log = array();
+ public $log = array();
// Konstruktor
@@ -211,6 +218,7 @@ class Project extends ModelBase
throw new \ObjectNotFoundException('project '.$this->projectid.' not found');
$this->name = $row['name' ];
+ $this->url = $row['url' ];
$this->target_dir = $row['target_dir' ];
$this->ftp_url = $row['ftp_url' ];
$this->ftp_passive = $row['ftp_passive' ];
@@ -236,6 +244,7 @@ class Project extends ModelBase
$this->projectid = $row['id' ];
$this->target_dir = $row['target_dir' ];
$this->ftp_url = $row['ftp_url' ];
+ $this->url = $row['url' ];
$this->ftp_passive = $row['ftp_passive' ];
$this->cmd_after_publish = $row['cmd_after_publish' ];
$this->cut_index = $row['flags']&PROJECT_FLAG_CUT_INDEX;
@@ -256,6 +265,7 @@ class Project extends ModelBase
target_dir = {target_dir},
ftp_url = {ftp_url},
ftp_passive = {ftp_passive},
+ url = {url},
flags = {flags},
cmd_after_publish = {cmd_after_publish}
WHERE id= {projectid}
@@ -263,6 +273,7 @@ SQL
);
$sql->setString('ftp_url' ,$this->ftp_url );
+ $sql->setString('url' ,$this->url );
$sql->setString('name' ,$this->name );
$sql->setString('target_dir' ,$this->target_dir );
$sql->setInt ('ftp_passive' ,$this->ftp_passive );
@@ -271,7 +282,7 @@ SQL
$flags = 0;
if( $this->cut_index) $flags |= PROJECT_FLAG_CUT_INDEX;
if( $this->content_negotiation) $flags |= PROJECT_FLAG_CONTENT_NEGOTIATION;
- if( $this->publishFileExtension) $flags |= PROJECT_FLAG_PUBLISH_PAGE_EXTENSION;
+ if( $this->publishFileExtension) $flags |= PROJECT_FLAG_PUBLISH_FILE_EXTENSION;
if( $this->publishPageExtension) $flags |= PROJECT_FLAG_PUBLISH_PAGE_EXTENSION;
$sql->setInt ('flags' ,$flags );
diff --git a/modules/cms-ui/themes/default/html/views/project/edit.php b/modules/cms-ui/themes/default/html/views/project/edit.php
@@ -1,9 +1,9 @@
- <div class="headermenu"><div class="toolbar-icon clickable"><a href="javascript:void(0);" title="<?php echo lang('MENU_REMOVE') ?>" data-type="dialog" data-name="<?php echo lang('MENU_REMOVE') ?>" data-method="remove"><img src="./themes/default/images/icon/action/remove.svg" title="<?php echo lang('MENU_remove_DESC') ?>" /><?php echo lang('MENU_remove') ?></a></div><div class="toolbar-icon clickable"><a href="javascript:void(0);" title="<?php echo lang('MENU_EXPORT') ?>" data-type="dialog" data-name="<?php echo lang('MENU_EXPORT') ?>" data-method="export"><img src="./themes/default/images/icon/action/export.svg" title="<?php echo lang('MENU_export_DESC') ?>" /><?php echo lang('MENU_export') ?></a></div><div class="toolbar-icon clickable"><a href="javascript:void(0);" title="<?php echo lang('MENU_MAINTENANCE') ?>" data-type="dialog" data-name="<?php echo lang('MENU_MAINTENANCE') ?>" data-method="maintenance"><img src="./themes/default/images/icon/action/maintenance.svg" title="<?php echo lang('MENU_maintenance_DESC') ?>" /><?php echo lang('MENU_maintenance') ?></a></div></div>
- <form name="" target="_self" action="<?php echo OR_ACTION ?>" data-method="<?php echo OR_METHOD ?>" data-action="<?php echo OR_ACTION ?>" data-id="<?php echo OR_ID ?>" method="POST" enctype="application/x-www-form-urlencoded" class="<?php echo OR_ACTION ?>" data-async="" data-autosave=""><input type="submit" class="invisible" /><input type="hidden" name="<?php echo REQ_PARAM_TOKEN ?>" value="<?php echo token() ?>" /><input type="hidden" name="<?php echo REQ_PARAM_ACTION ?>" value="<?php echo OR_ACTION ?>" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="<?php echo OR_METHOD ?>" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
- <fieldset class="<?php echo '1'?" open":"" ?><?php echo '1'?" show":"" ?>"><legend><div class="arrow-right closed" /><div class="arrow-down open" /><?php echo lang('NAME') ?></legend><div>
+
+ <form name="" target="_self" data-target="view" action="./" data-method="<?php echo OR_METHOD ?>" data-action="<?php echo OR_ACTION ?>" data-id="<?php echo OR_ID ?>" method="POST" enctype="application/x-www-form-urlencoded" class="<?php echo OR_ACTION ?>" data-async="" data-autosave=""><input type="submit" class="invisible" /><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="<?php echo OR_ACTION ?>" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="<?php echo OR_METHOD ?>" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
+ <fieldset class="<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('NAME') ?></legend><div>
<div class="line">
<div class="label">
<label for="<?php echo REQUEST_ID ?>_name" class="label"><?php echo lang('PROJECT_NAME') ?>
@@ -14,8 +14,18 @@
</div>
</div>
+ <div class="line">
+ <div class="label">
+ <label for="<?php echo REQUEST_ID ?>_url" class="label"><?php echo lang('PROJECT_HOSTNAME') ?>
+ </label>
+ </div>
+ <div class="input">
+ <div class="inputholder"><input<?php if ('') echo ' disabled="true"' ?> id="<?php echo REQUEST_ID ?>_url" name="url<?php if ('') echo '_disabled' ?>" type="text" maxlength="256" class="text" value="<?php echo Text::encodeHtml(@$url) ?>" /><?php if ('') { ?><input type="hidden" name="url" value="<?php $url ?>"/><?php } ?></div>
+
+ </div>
+ </div>
</div></fieldset>
- <fieldset class="<?php echo '1'?" open":"" ?><?php echo '1'?" show":"" ?>"><legend><div class="arrow-right closed" /><div class="arrow-down open" /><?php echo lang('PUBLISH') ?></legend><div>
+ <fieldset class="<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('PUBLISH') ?></legend><div>
<div class="line">
<div class="label">
<label for="<?php echo REQUEST_ID ?>_target_dir" class="label"><?php echo lang('PROJECT_TARGET_DIR') ?>
@@ -81,7 +91,7 @@
</div>
</div>
</div></fieldset>
- <fieldset class="<?php echo '1'?" open":"" ?><?php echo '1'?" show":"" ?>"><legend><div class="arrow-right closed" /><div class="arrow-down open" /><?php echo lang('project_FTP') ?></legend><div>
+ <fieldset class="<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('project_FTP') ?></legend><div>
<div class="line">
<div class="label">
<label for="<?php echo REQUEST_ID ?>_ftp_url" class="label"><?php echo lang('PROJECT_FTP_URL') ?>
@@ -111,7 +121,7 @@
</div>
</div>
</div></fieldset>
- <fieldset class="<?php echo '1'?" open":"" ?><?php echo '1'?" show":"" ?>"><legend><div class="arrow-right closed" /><div class="arrow-down open" /><?php echo lang('options') ?></legend><div>
+ <fieldset class="<?php echo '1'?" open":" closed" ?><?php echo '1'?" show":"" ?>"><legend><div class="arrow arrow-right on-closed"></div><div class="arrow arrow-down on-open"></div><?php echo lang('options') ?></legend><div>
<div class="line">
<div class="label">
</div>
@@ -157,5 +167,5 @@
</div>
</div>
</div></fieldset>
- <div class="bottom"><div class="command "><input type="button" class="submit ok" value="OK" /></div></div></form>
+ <div class="bottom"><div class="command "><input type="submit" class="submit ok" value="OK" /></div></div></form>
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/project/edit.tpl.src.xml b/modules/cms-ui/themes/default/html/views/project/edit.tpl.src.xml
@@ -11,6 +11,14 @@
<input name="name" class="name"></input>
</part>
</part>
+ <part class="line">
+ <part class="label">
+ <label for="url" key="PROJECT_HOSTNAME"></label>
+ </part>
+ <part class="input">
+ <input name="url"></input>
+ </part>
+ </part>
</group>
<group title="message:PUBLISH">
<part class="line">