mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-27 08:59:28 +00:00
sprache widget added
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user