commit 91be21bad02d3684957e1fd7f02aa1d22ac1c001
parent 5d76c6ccb95e1ba89e2b5cd20e046b5b02bebc68
Author: Jan Dankert <develop@jandankert.de>
Date: Wed, 1 May 2019 01:36:57 +0200
Seiteninhalte in der Seitenansicht für jede Sprache einzeln bearbeiten.
Diffstat:
6 files changed, 41 insertions(+), 8 deletions(-)
diff --git a/modules/cms-core/Dispatcher.class.php b/modules/cms-core/Dispatcher.class.php
@@ -298,10 +298,10 @@ class Dispatcher
$do->init();
if(!defined('OR_ID'))
- if (isset($REQ[REQ_PARAM_ID]))
- define('OR_ID', $REQ[REQ_PARAM_ID]);
- else
- define('OR_ID', '');
+ //if (isset($REQ[REQ_PARAM_ID]))
+ define('OR_ID', $this->request->id);
+ //else
+ // define('OR_ID', '');
$this->checkAccess($do);
diff --git a/modules/cms-core/action/PageAction.class.php b/modules/cms-core/action/PageAction.class.php
@@ -433,7 +433,9 @@ class PageAction extends ObjectAction
$list = array();
- // Schleife ueber alle Inhalte der Seite
+ $languages = $this->page->getProject()->getLanguages();
+
+ // Schleife ueber alle Inhalte der Seite
foreach( $this->page->values as $id=>$value )
{
// Element wird nur angezeigt, wenn es editierbar ist
@@ -459,6 +461,7 @@ class PageAction extends ObjectAction
$this->setTemplateVar('preview_url',Html::url('page','show',$this->page->objectid,array('withIcons'=>'1',REQ_PARAM_LANGUAGE_ID=>$this->page->languageid,REQ_PARAM_MODEL_ID=>$this->page->modelid,REQ_PARAM_EMBED=>'1') ) );
$this->setTemplateVar('properties',$this->page->getProperties() );
$this->setTemplateVar('el',$list);
+ $this->setTemplateVar('languages',$languages);
}
diff --git a/modules/cms-core/action/PageelementAction.class.php b/modules/cms-core/action/PageelementAction.class.php
@@ -85,7 +85,7 @@ class PageelementAction extends Action
$this->value = new Value();
$this->value->publisher = new PublishPreview();
- $id = $this->getRequestVar('id');
+ $id = $this->request->id;
$ids = explode('_',$id);
if ( count($ids) > 1 )
{
@@ -102,7 +102,7 @@ class PageelementAction extends Action
$this->page = new Page( $pageid );
if ( $this->hasRequestVar('languageid'))
- $this->page->languageid = $this->getRequestVar('languageid',OR_FILTER_NUMBER);
+ $this->page->languageid = $this->getRequestId('languageid');
$this->page->load();
}
diff --git a/modules/cms-core/action/RequestParams.class.php b/modules/cms-core/action/RequestParams.class.php
@@ -56,7 +56,7 @@ namespace cms\action {
if ( isset($_REQUEST[REQ_PARAM_SHORT])) {
list( $type, $id ) = array_pad( explode( '-', $_REQUEST[REQ_PARAM_SHORT] ), 2, '' );
$this->action = Text::clean( strtolower($type),'abcdefghijklmnopqrstuvwxyz');
- $this->id = intval($id);
+ $this->id = $id;
}
// Is this a POST request?
diff --git a/modules/cms-ui/themes/default/html/views/page/edit.php b/modules/cms-ui/themes/default/html/views/page/edit.php
@@ -11,6 +11,10 @@
<span><?php echo nl2br(encodeHtml(htmlentities(lang('PAGE_ELEMENT_VALUE')))); ?></span>
</td>
+ <td class="help">
+ <span><?php echo nl2br(encodeHtml(htmlentities(lang('EDIT')))); ?></span>
+
+ </td>
</tr>
<?php } ?>
<?php $if3=(($el)==FALSE); if($if3){?>
@@ -38,6 +42,19 @@
<span><?php echo nl2br(' '); ?></span>
</td>
+ <td>
+ <?php foreach($languages as $languageid=>$languagename){ ?>
+ <div class="clickable">
+ <a target="_self" data-type="edit" data-action="pageelement" data-method="edit" data-id="<?php echo $pageelementid ?>" data-extra="{'languageid':'<?php echo $languageid ?>'}" href="<?php echo Html::url('pageelement','edit',$pageelementid,array('languageid'=>$languageid)) ?>">
+ <i class="image-icon image-icon--method-edit"></i>
+
+ <span><?php echo nl2br(encodeHtml(htmlentities($languagename))); ?></span>
+
+ </a>
+
+ </div>
+ <?php } ?>
+ </td>
</tr>
<?php } ?>
</table>
diff --git a/modules/cms-ui/themes/default/html/views/page/edit.tpl.src.xml b/modules/cms-ui/themes/default/html/views/page/edit.tpl.src.xml
@@ -9,6 +9,9 @@
<column class="help">
<text text="PAGE_ELEMENT_VALUE"></text>
</column>
+ <column class="help">
+ <text text="EDIT"></text>
+ </column>
</row>
</if>
<if empty="el">
@@ -30,6 +33,16 @@
<text var="value" maxlength="50"></text>
<text raw="_"></text>
</column>
+ <column>
+ <list list="languages" key="languageid" value="languagename">
+ <part class="clickable">
+ <link type="edit" action="pageelement" subaction="edit" id="var:pageelementid" var1="languageid" value1="var:languageid">
+ <image method="edit"></image>
+ <text var="languagename"></text>
+ </link>
+ </part>
+ </list>
+ </column>
</row>
</list>
<!--