[ADD] translations feature for theme materialize
This commit is contained in:
parent
d0f514b9af
commit
b9bbb9598a
58
themes/materialize/views/edit-translation.php
Normal file
58
themes/materialize/views/edit-translation.php
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<div class="container">
|
||||||
|
<?php
|
||||||
|
if(!isset($_SESSION['user'])){
|
||||||
|
?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col s12">
|
||||||
|
<div class="panel panel-danger">
|
||||||
|
<div class="panel-body text-center">
|
||||||
|
<h4>
|
||||||
|
<?php
|
||||||
|
echo $oTrans->getTranslationWithData(
|
||||||
|
'message_noRightToAccessToThisPage',
|
||||||
|
$_SESSION['config']['default_lang_code'],
|
||||||
|
array(
|
||||||
|
'<a href="'.$oTrans->getTranslation('webpage_register_url', $_SESSION['config']['default_lang_code']).'">'.
|
||||||
|
$oTrans->getTranslation('webpage_register_name', $_SESSION['config']['default_lang_code']).'
|
||||||
|
</a>'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
<h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<div class="row">
|
||||||
|
<h1><?php echo $oTrans->getTranslation('webpage_editTranslation_title', $_SESSION['user']['lang_code']); ?></h1>
|
||||||
|
<div class="col s12">
|
||||||
|
<?php
|
||||||
|
echo "session lang = ".$_SESSION['config']['default_lang_code']."<br/>";
|
||||||
|
echo "user lang = ".$_SESSION['user']['lang_code']."<br/>";
|
||||||
|
?>
|
||||||
|
<!--<form method="post" action="< ?php echo $oConf->getURLRoot('list-translations'); ?>">-->
|
||||||
|
<form method="post" action="#">
|
||||||
|
<input type="hidden" id="translation_id" name="translation_id" value="<?php echo $_REQUEST['reference']; ?>" />
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="reverted" for="source"><?php echo $oTrans->getTranslation('webpage_editTranslation_sourceLabel', $_SESSION['user']['lang_code']); ?></label>
|
||||||
|
<textarea class="form-control" id="source" name="source" style="min-height: 400px;"><?php echo $translation['source']; ?></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="reverted" for="translation"><?php echo $oTrans->getTranslation('webpage_editTranslation_translationLabel', $_SESSION['user']['lang_code']); ?></label>
|
||||||
|
<textarea class="form-control" id="translation" name="translation" style="min-height: 400px;"><?php echo $translation[$_SESSION['user']['lang_code']]; ?></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input class="btn btn-primary" type="submit" id="submit_translation" name="submit_translation" value="<?php echo $oTrans->getTranslation('webpage_editTranslation_saveButton', $_SESSION['user']['lang_code']); ?>"/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
} //ENDOF else
|
||||||
|
?>
|
||||||
|
</div>
|
41
themes/materialize/views/list-translations.php
Normal file
41
themes/materialize/views/list-translations.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col s12 ">
|
||||||
|
|
||||||
|
<div class="panel panel-info">
|
||||||
|
<h4 class="text-center box-title">List Translations</h4>
|
||||||
|
<div class="panel-body">
|
||||||
|
<!-- displays columns titles -->
|
||||||
|
<div class="col s12">
|
||||||
|
<div class="col s12"><?php echo $oTrans->getTranslation('webpage_listTranslations_codeTitle', $_SESSION['user']['lang_code']); ?></div>
|
||||||
|
<div class="col s6 "><?php echo $oTrans->getTranslation('webpage_listTranslations_sourceTitle', $_SESSION['user']['lang_code']); ?></div>
|
||||||
|
<div class="col s6"><?php echo $_SESSION['user']['lang_code']; ?></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- displays translations -->
|
||||||
|
<?php foreach($translations as $translation){ ?>
|
||||||
|
<div class="col s12 padding-2" style="border-top: 1px solid gray;">
|
||||||
|
<!-- displays code and action -->
|
||||||
|
<div class="col s12">
|
||||||
|
<a class="workflow_button" href="<?php echo $oConf->getURLRoot($buttonsTranslation."-".$translation['id']); ?>">
|
||||||
|
<?php echo $oTrans->getTranslation('webpage_listTranslations_translateButtons', $_SESSION['user']['lang_code']); ?>
|
||||||
|
</a>
|
||||||
|
<span style="font-weight:bold;"><?php echo $translation['code']; ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- displays source -->
|
||||||
|
<div class="col s6 ">
|
||||||
|
<?php echo substr($translation['source'], 0, 60); ?>
|
||||||
|
</div>
|
||||||
|
<!-- displays language translated -->
|
||||||
|
<div class="col s6 ">
|
||||||
|
<?php echo substr($translation[$_SESSION['user']['lang_code']], 0, 60); ?>
|
||||||
|
</div>
|
||||||
|
</div> <!--ENDOF row -->
|
||||||
|
<?php } ?> <!--ENDOF displays translations -->
|
||||||
|
</div> <!--ENDOF panel-body -->
|
||||||
|
</div> <!--ENDOF panel -->
|
||||||
|
|
||||||
|
</div> <!--ENDOF <div class="col-*-12"> -->
|
||||||
|
</div> <!--ENDOF <div class="row"> -->
|
||||||
|
</div> <!--ENDOF <div class="container"> -->
|
Loading…
Reference in New Issue
Block a user