sprache widget added

This commit is contained in:
Gerry Raab
2016-06-22 13:09:16 +02:00
parent 642f700cae
commit 437959221e
3 changed files with 35 additions and 1 deletions
@@ -14,7 +14,7 @@
<td><?php echo $this->templatelib->widget("organisationseinheit_widget", array('oe_kurzbz' => $orgeinheit_kurzbz)); ?></td>
<td>Preview</td>
</tr>
<tr><td>Sprache</td><td><input type="text" name="sprache" value="<?php echo $sprache?>"></td><td></td></tr>
<tr><td>Sprache</td><td><?php echo $this->templatelib->widget("sprache_widget", array('sprache' => $sprache)); ?></td><td></td></tr>
<tr><td>Text</td><td><textarea name="text" style="width:500px; height:300px;" id="markitup"><?php echo $text ?></textarea></td>
<td valign="top">
<div id="textile-preview" style="width:500px; height:300px; border: 1px solid gray; overflow: auto;"></div>
+7
View File
@@ -0,0 +1,7 @@
<select name="<?php echo 'sprache'; ?>">
<?php foreach($items as $item): ?>
<option value="<?php echo $item['sprache']; ?>" <?php if ($item['selected']) echo 'selected'?>>
<?php echo $item['sprache']; ?>
</option>
<?php endforeach; ?>
</select>
+27
View File
@@ -0,0 +1,27 @@
<?php
/*
* OE widget
*/
class sprache_widget extends Widget
{
public function display($data)
{
$this->load->model('system/Sprache_model');
$res = $this->Sprache_model->loadWhole();
//var_dump($res);
foreach ($res->retval as $obj)
{
$item = array('sprache' => $obj->sprache);
if (isset($data['sprache']) && $obj->sprache == $data['sprache'])
$item['selected'] = true;
else
$item['selected'] = false;
$data['items'][] = $item;
}
if (! isset($data['sprache']))
$data['sprache'] = 'German';
$this->view('widgets/sprache', $data);
}
}