commit 40d2c2654935fa145b92c87c7ee3f674bfb6a773
parent 324d19fd7009ca3f8daa2f843c00358d4e3e04c6
Author: Jan Dankert <devnull@localhost>
Date: Wed, 12 Sep 2018 22:42:10 +0200
Bei Sprachen und Varianten: Auswahl der Standard-Vorbelegung funktioniert wieder.
Diffstat:
8 files changed, 44 insertions(+), 96 deletions(-)
diff --git a/modules/cms-core/action/LanguageAction.class.php b/modules/cms-core/action/LanguageAction.class.php
@@ -61,7 +61,9 @@ class LanguageAction extends Action
public function setdefaultPost()
{
$this->language->setDefault();
- }
+
+ $this->addNotice('language',$this->language->name,'DONE',OR_NOTICE_OK);
+ }
diff --git a/modules/cms-core/action/LanguagelistAction.class.php b/modules/cms-core/action/LanguagelistAction.class.php
@@ -76,14 +76,11 @@ class LanguagelistAction extends Action
$list[$id]['isocode'] = $l->isoCode;
if ( $this->userIsAdmin() )
- {
$list[$id]['id' ] = $id;
-
- if ( ! $l->isDefault )
- $list[$id]['default_url'] = Html::url( 'language','setdefault',$id );
- }
-
- $list[$id]['select_url'] = Html::url( 'index','language',$id );
+
+ $list[$id]['is_default'] = $l->isDefault;
+
+ $list[$id]['select_url'] = Html::url( 'index','language',$id );
}
$this->setTemplateVar('el',$list);
diff --git a/modules/cms-core/action/ModelAction.class.php b/modules/cms-core/action/ModelAction.class.php
@@ -107,7 +107,7 @@ class ModelAction extends Action
$this->model->setDefault();
- $this->callSubAction('listing');
+ $this->addNotice('model',$this->model->name,'DONE',OR_NOTICE_OK);
}
diff --git a/modules/cms-core/action/ModellistAction.class.php b/modules/cms-core/action/ModellistAction.class.php
@@ -64,8 +64,7 @@ class ModellistAction extends Action
if ( $this->userIsAdmin() )
$list[$id]['id' ] = $id;
- if ( ! $m->isDefault && $this->userIsAdmin() )
- $list[$id]['default_url'] = Html::url('model','setdefault',$id);
+ $list[$id]['is_default'] = $m->isDefault;
$list[$id]['select_url' ] = Html::url('index','model',$id);
}
diff --git a/modules/cms-ui/themes/default/html/views/languagelist/show.php b/modules/cms-ui/themes/default/html/views/languagelist/show.php
@@ -14,10 +14,6 @@
<span class="text"><?php echo nl2br(encodeHtml(htmlentities(''))); ?></span>
</td>
- <td>
- <span class="text"><?php echo nl2br(encodeHtml(htmlentities(''))); ?></span>
-
- </td>
</tr>
<?php foreach($el as $list_key=>$list_value){ ?><?php extract($list_value) ?>
<tr class="data">
@@ -34,13 +30,17 @@
<span class="text"><?php echo nl2br(encodeHtml(htmlentities($isocode))); ?></span>
</td>
- <?php $if5=(isset($default_url)); if($if5){?>
+ <?php $if5=(!$is_default); if($if5){?>
<td class="clickable">
- <a target="_self" data-type="post" data-action="language" data-method="setdefault" data-id="<?php echo $id ?>" data-extra="[]" data-data="{"action":"language","subaction":"setdefault","id":"<?php echo $id ?>","token":"<?php echo token() ?>","none":"0"}">
- <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_make_default')))); ?></span>
-
- </a>
+ <?php $if7=(isset($id)); if($if7){?>
+ <a target="_self" data-type="post" data-action="language" data-method="setdefault" data-id="<?php echo $id ?>" data-extra="[]" data-data="{"action":"language","subaction":"setdefault","id":"<?php echo $id ?>","token":"<?php echo token() ?>","none":"0"}">
+ <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_make_default')))); ?></span>
+
+ </a>
+ <?php } ?>
+ <?php if(!$if7){?>
+ <?php } ?>
</td>
<?php } ?>
<?php if(!$if5){?>
@@ -49,21 +49,6 @@
</td>
<?php } ?>
- <?php $if5=(isset($select_url)); if($if5){?>
- <td class="clickable">
- <a target="_self" data-type="post" data-action="start" data-method="language" data-id="<?php echo $id ?>" data-extra="[]" data-data="{"action":"start","subaction":"language","id":"<?php echo $id ?>","token":"<?php echo token() ?>","none":"0"}">
- <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_select')))); ?></span>
-
- </a>
-
- </td>
- <?php } ?>
- <?php if(!$if5){?>
- <td>
- <em class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_selected')))); ?></em>
-
- </td>
- <?php } ?>
</tr>
<?php unset($select_url) ?>
@@ -71,7 +56,7 @@
<?php } ?>
<tr class="data">
- <td colspan="4" class="clickable">
+ <td colspan="3" class="clickable">
<a target="_self" data-type="dialog" data-action="" data-method="add" data-id="<?php echo OR_ID ?>" data-extra="{'dialogAction':null,'dialogMethod':'add'}" href="<?php echo Html::url('','add','',array('dialogAction'=>'','dialogMethod'=>'add')) ?>">
<img class="image-icon image-icon--method" title="" src="./modules/cms-ui/themes/default/images/icon/method/add.svg" />
diff --git a/modules/cms-ui/themes/default/html/views/languagelist/show.tpl.src.xml b/modules/cms-ui/themes/default/html/views/languagelist/show.tpl.src.xml
@@ -11,9 +11,6 @@
<column>
<text raw=""></text>
</column>
- <column>
- <text raw=""></text>
- </column>
</row>
<list list="el" extract="true">
<row class="data">
@@ -26,11 +23,16 @@
<column>
<text var="isocode"></text>
</column>
- <if present="default_url">
+ <if false="var:is_default">
+
<column class="clickable">
- <link type="post" action="language" subaction="setdefault" id="var:id">
- <text text="GLOBAL_make_default"></text>
- </link>
+ <if present="id">
+ <link type="post" action="language" subaction="setdefault" id="var:id">
+ <text text="GLOBAL_make_default"></text>
+ </link>
+ </if>
+ <else>
+ </else>
</column>
</if>
<else>
@@ -38,24 +40,12 @@
<text text="GLOBAL_is_default" type="emphatic" />
</column>
</else>
- <if present="select_url">
- <column class="clickable">
- <link type="post" action="start" subaction="language" id="var:id">
- <text text="GLOBAL_select"></text>
- </link>
- </column>
- </if>
- <else>
- <column>
- <text text="GLOBAL_selected" type="emphatic" />
- </column>
- </else>
</row>
<set var="select_url"></set>
<set var="default_url"></set>
</list>
<row class="data">
- <column colspan="4" class="clickable">
+ <column colspan="3" class="clickable">
<link type="dialog" subaction="add">
<image method="add"/>
<text text="new"/>
diff --git a/modules/cms-ui/themes/default/html/views/modellist/show.php b/modules/cms-ui/themes/default/html/views/modellist/show.php
@@ -26,13 +26,15 @@
</a>
</td>
- <?php $if5=(isset($default_url)); if($if5){?>
+ <?php $if5=(!$is_default); if($if5){?>
<td class="clickable">
- <a target="_self" data-type="post" data-action="model" data-method="setdefault" data-id="<?php echo $id ?>" data-extra="[]" data-data="{"action":"model","subaction":"setdefault","id":"<?php echo $id ?>","token":"<?php echo token() ?>","none":"0"}">
- <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_make_default')))); ?></span>
-
- </a>
+ <?php $if7=(isset($id)); if($if7){?>
+ <a target="_self" data-type="post" data-action="model" data-method="setdefault" data-id="<?php echo $id ?>" data-extra="[]" data-data="{"action":"model","subaction":"setdefault","id":"<?php echo $id ?>","token":"<?php echo token() ?>","none":"0"}">
+ <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_make_default')))); ?></span>
+
+ </a>
+ <?php } ?>
</td>
<?php } ?>
<?php if(!$if5){?>
@@ -41,21 +43,6 @@
</td>
<?php } ?>
- <?php $if5=(isset($select_url)); if($if5){?>
- <td class="clickable">
- <a target="_self" data-type="post" data-action="start" data-method="model" data-id="<?php echo $id ?>" data-extra="[]" data-data="{"action":"start","subaction":"model","id":"<?php echo $id ?>","token":"<?php echo token() ?>","none":"0"}">
- <span class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_select')))); ?></span>
-
- </a>
-
- </td>
- <?php } ?>
- <?php if(!$if5){?>
- <td>
- <em class="text"><?php echo nl2br(encodeHtml(htmlentities(lang('GLOBAL_selected')))); ?></em>
-
- </td>
- <?php } ?>
</tr>
<?php unset($select_url) ?>
@@ -63,7 +50,7 @@
<?php } ?>
<tr class="data">
- <td colspan="3" class="clickable">
+ <td colspan="2" class="clickable">
<a target="_self" data-type="dialog" data-action="" data-method="add" data-id="<?php echo OR_ID ?>" data-extra="{'dialogAction':null,'dialogMethod':'add'}" href="<?php echo Html::url('','add','',array('dialogAction'=>'','dialogMethod'=>'add')) ?>">
<img class="image-icon image-icon--method" title="" src="./modules/cms-ui/themes/default/images/icon/method/add.svg" />
diff --git a/modules/cms-ui/themes/default/html/views/modellist/show.tpl.src.xml b/modules/cms-ui/themes/default/html/views/modellist/show.tpl.src.xml
@@ -22,11 +22,13 @@
</link>
</column>
- <if present="default_url">
+ <if false="var:is_default">
<column class="clickable">
- <link type="post" action="model" subaction="setdefault" id="var:id">
- <text text="GLOBAL_make_default"></text>
- </link>
+ <if present="id">
+ <link type="post" action="model" subaction="setdefault" id="var:id">
+ <text text="GLOBAL_make_default"></text>
+ </link>
+ </if>
</column>
</if>
<else>
@@ -34,26 +36,12 @@
<text text="GLOBAL_is_default" type="emphatic" />
</column>
</else>
-
-
- <if present="select_url">
- <column class="clickable">
- <link type="post" action="start" subaction="model" id="var:id">
- <text text="GLOBAL_select"></text>
- </link>
- </column>
- </if>
- <else>
- <column>
- <text text="GLOBAL_selected" type="emphatic" />
- </column>
- </else>
</row>
<set var="select_url"></set>
<set var="default_url"></set>
</list>
<row class="data">
- <column colspan="3" class="clickable">
+ <column colspan="2" class="clickable">
<link type="dialog" subaction="add">
<image method="add" />
<text text="new" />