commit 90b298d8ad39b2d374e9842c80fe27483c49323f
parent 585ece7ff6a3b231d7894d01359b65336f1abee7
Author: Jan Dankert <develop@jandankert.de>
Date: Wed, 15 May 2019 21:17:18 +0200
Sprachen-Name als Eigenschaft editierbar.
Diffstat:
7 files changed, 86 insertions(+), 92 deletions(-)
diff --git a/modules/cms-core/action/LanguageAction.class.php b/modules/cms-core/action/LanguageAction.class.php
@@ -38,7 +38,7 @@ class LanguageAction extends Action
* Zu bearbeitende Sprache, wird im Kontruktor instanziiert
* @type Language
*/
- var $language;
+ private $language;
/**
@@ -119,61 +119,12 @@ class LanguageAction extends Action
- /**
- * Speichern der Sprache
- */
- public function editPost()
+ public function infoView()
{
- global $conf;
-
- if ( $this->hasRequestVar('name') )
- {
- $this->language->name = $this->getRequestVar('name' );
- $this->language->isoCode = $this->getRequestVar('isocode');
- }
- else
- {
- $countryList = $conf['countries'];
- $iso = $this->getRequestVar('isocode');
- $this->language->name = $countryList[$iso];
- $this->language->isoCode = strtolower( $iso );
- }
-
- $this->language->save();
+ $this->setTemplateVars( $this->language->getProperties() );
}
-
- public function editView()
- {
- global $conf;
- $countryList = $conf['countries'];
-
- $project = new Project( $this->language->projectid );
-
- foreach( $project->getLanguageIds() as $id )
- {
- if ( $id == $this->language->languageid )
- continue;
-
- $l = new Language( $id );
- $l->load();
-
- unset( $countryList[$l->isoCode] );
- }
-
- asort( $countryList );
- $this->setTemplateVar('isocodes' ,$countryList );
- $this->setTemplateVar('isocode' ,strtoupper($this->language->isoCode) );
- }
-
-
-
- function showView() {
- $this->nextSubAction('edit');
- }
-
-
function propView()
{
$this->setTemplateVar('isocode' ,$this->language->isoCode );
diff --git a/modules/cms-ui/themes/default/html/views/language/edit.php b/modules/cms-ui/themes/default/html/views/language/edit.php
@@ -1,17 +0,0 @@
-
-
-
-
- <form name="" target="_self" data-target="view" action="./" data-method="edit" data-action="language" data-id="<?php echo OR_ID ?>" method="post" enctype="application/x-www-form-urlencoded" class="or-form language" 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="language" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="edit" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
- <div class="line">
- <div class="label">
- <span><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_LANGUAGE')))); ?></span>
-
- </div>
- <div class="input">
- <div class="inputholder"><select id="<?php echo REQUEST_ID ?>_isocode" name="isocode" title="" class=""<?php if (count($isocodes)<=1) echo ' disabled="disabled"'; ?> size=1"><?php include_once( 'modules/template-engine/components/html/selectbox/component-select-box.php') ?><?php component_select_option_list($isocodes,$isocode,0,0) ?><?php if (count($isocodes)==0) { ?><input type="hidden" name="isocode" value="" /><?php } ?><?php if (count($isocodes)==1) { ?><input type="hidden" name="isocode" value="<?php echo array_keys($isocodes)[0] ?>" /><?php } ?>
- </select></div>
- </div>
- </div>
- <div class="or-form-actionbar"><input type="submit" class="or-form-btn or-form-btn--primary" value="OK" /></div></form>
- -
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/language/edit.tpl.src.xml b/modules/cms-ui/themes/default/html/views/language/edit.tpl.src.xml
@@ -1,15 +0,0 @@
-<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.openrat.de/template ../../../../../../template-engine/components/template.xsd">
- <header views="advanced,remove"></header>
- <form method="post">
-
- <part class="line">
- <part class="label">
- <text text="GLOBAL_LANGUAGE"></text>
- </part>
- <part class="input">
- <selectbox list="isocodes" name="isocode"></selectbox>
- </part>
- </part>
- </form>
-</output>-
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/language/info.php b/modules/cms-ui/themes/default/html/views/language/info.php
@@ -0,0 +1,38 @@
+
+
+ <form name="" target="_self" data-target="view" action="./" data-method="info" data-action="language" data-id="<?php echo OR_ID ?>" method="POST" enctype="application/x-www-form-urlencoded" class="or-form language" 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="language" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="info" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
+ <span class="headline"><?php echo nl2br(encodeHtml(htmlentities($name))); ?></span>
+
+ <div class="line">
+ <div class="label">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_NAME')))); ?></span>
+
+ </div>
+ <div class="input clickable">
+ <span class="name"><?php echo nl2br(encodeHtml(htmlentities($name))); ?></span>
+
+ </div>
+ </div>
+ <div class="line">
+ <div class="label">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang('LANGUAGE_ISOCODE')))); ?></span>
+
+ </div>
+ <div class="input clickable">
+ <span><?php echo nl2br(encodeHtml(htmlentities($isocode))); ?></span>
+
+ </div>
+ </div>
+ <div class="line">
+ <div class="label">
+ </div>
+ <div class="input clickable">
+ <a class="or-link-btn" target="_self" data-type="edit" data-action="language" data-method="prop" data-id="<?php echo OR_ID ?>" data-extra="[]" href="<?php echo Html::url('language','prop','',array()) ?>">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang(''.'edit'.'')))); ?></span>
+
+ </a>
+
+ </div>
+ </div>
+ <div class="or-form-actionbar"></div></form>
+ +
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/language/info.tpl.src.xml b/modules/cms-ui/themes/default/html/views/language/info.tpl.src.xml
@@ -0,0 +1,37 @@
+<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.openrat.de/template ../../../../../../template-engine/components/template.xsd">
+
+ <form readonly="true" cancel="false">
+
+ <text class="headline" var="name"/>
+
+ <part class="line">
+ <part class="label">
+ <text text="GLOBAL_NAME"></text>
+ </part>
+ <part class="input clickable">
+ <text var="name" class="name"/>
+ </part>
+ </part>
+ <part class="line">
+ <part class="label">
+ <text text="LANGUAGE_ISOCODE"></text>
+ </part>
+ <part class="input clickable">
+ <text var="isocode"/>
+ </part>
+ </part>
+
+
+ <part class="line">
+ <part class="label">
+ </part>
+ <part class="input clickable">
+ <link class="or-link-btn" action="language" subaction="prop" type="edit">
+ <text key="edit"/>
+ </link>
+ </part>
+ </part>
+
+ </form>
+</output>+
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/language/prop.php b/modules/cms-ui/themes/default/html/views/language/prop.php
@@ -45,5 +45,5 @@
</label>
</div>
</div>
- <div class="or-form-actionbar"><input type="submit" class="or-form-btn or-form-btn--primary" value="OK" /></div></form>
+ <div class="or-form-actionbar"><input type="button" class="or-form-btn or-form-btn--secondary or-form-btn--cancel" value="<?php echo lang("CANCEL") ?>" /><input type="submit" class="or-form-btn or-form-btn--primary" value="OK" /></div></form>
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/language/remove.php b/modules/cms-ui/themes/default/html/views/language/remove.php
@@ -2,15 +2,15 @@
- <form name="" target="_self" data-target="view" action="./" data-method="remove" data-action="language" data-id="<?php echo OR_ID ?>" method="post" enctype="application/x-www-form-urlencoded" class="language" 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="language" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="remove" /><input type="hidden" name="<?php echo REQ_PARAM_ID ?>" value="<?php echo OR_ID ?>" />
+ <form name="" target="_self" data-target="view" action="./" data-method="remove" data-action="language" data-id="<?php echo OR_ID ?>" method="post" enctype="application/x-www-form-urlencoded" class="or-form language" 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="language" /><input type="hidden" name="<?php echo REQ_PARAM_SUBACTION ?>" value="remove" /><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":"" ?>"><div>
<div class="line">
<div class="label">
- <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_NAME')))); ?></span>
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_NAME')))); ?></span>
</div>
<div class="input">
- <span class="text"><?php echo nl2br(encodeHtml(htmlentities($name))); ?></span>
+ <span><?php echo nl2br(encodeHtml(htmlentities($name))); ?></span>
</div>
</div>
@@ -35,11 +35,11 @@
} ?>
<label for="<?php echo REQUEST_ID ?>_confirm" class="label">
- <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('CONFIRM_DELETE')))); ?></span>
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang('CONFIRM_DELETE')))); ?></span>
</label>
</div>
</div>
</div></fieldset>
- <div class="bottom"><div class="command "><input type="submit" class="submit ok" value="OK" /></div></div></form>
+ <div class="or-form-actionbar"><input type="submit" class="or-form-btn or-form-btn--primary" value="OK" /></div></form>
\ No newline at end of file