Exemplo n.º 1
0
}
if ($post = mso_check_post(array('f_session_id', 'f_submit', 'f_ushka'))) {
    mso_checkreferer();
    // pr($post);
    $ushki = $post['f_ushka'];
    $ushki_new = array();
    foreach ($ushki as $us) {
        if (!isset($us['delete'])) {
            $ushki_new[] = $us;
        }
    }
    // pr($ushki_new);
    mso_add_float_option($key, $ushki_new, $type);
    echo '<div class="update">' . t('Обновлено!') . '</div>';
}
$ushki = mso_get_float_option($key, $type, array());
/*
[0] => 
		[name] => 'ушка 1'
		[type] => 'html'
		[text] => ''
[1] => 
		[name] => 'ушка 2'
		[type] => 'php'
		[text] => ''				
...
*/
// pr($ushki);
echo '<form method="post">' . mso_form_session('f_session_id') . '
		<p><strong>' . t('Новая ушка:') . '</strong> ' . ' <input name="f_ushka_new" type="text" value="">
		<button type="submit" name="f_submit_new">' . t('Добавить новую ушку') . '</button></p>
Exemplo n.º 2
0
function ushki_get_all($no_cashe = false)
{
    static $all = false;
    if ($no_cashe or !$all) {
        return $all = mso_get_float_option('ushki', 'ushki', array());
    } else {
        return $all;
    }
}