Exemple #1
0
<?php

$id = '';
eval('$id=' . var_export($data['id'], true) . ';');
$edit = !in_array('noedit', $flags);
$label = Label::getByName($id);
if (null === $label) {
    $label = Label::INSERT();
    $label->setName($id);
    $label->setText($data['text']);
}
$text = $label->getText();
if (array_key_exists('edit', $_GET) && Session::isLoggedIn() && $edit) {
    ?>
<span component="Label" edit_id="<?php 
    echo $id;
    ?>
" style="display:inherit;"><?php 
    echo $text;
    ?>
</span>
<?php 
} else {
    echo $text;
}
Exemple #2
0
<?php

if (Session::isLoggedIn()) {
    Label::getByName($_POST['id'])->setText($_POST['text']);
}