function sed_lib_zemcontact_form()
 {
     $field = '<div class="screenreader" >' . doLabel('Phone') . finput('text', 'phone', htmlspecialchars(ps('phone')), '', '', '', '', '', 'phone') . '<br />' . doLabel('Address') . finput('text', 'mail', htmlspecialchars(ps('mail')), '', '', '', '', '', 'mail') . '</div>';
     return $field;
 }
Esempio n. 2
0
 function prefs($event, $step)
 {
     pagetop('hak_tinymce ' . gTxt('preferences'), $step == 'update' ? gTxt('preferences_saved') : '');
     if ($step == 'install') {
         // Install the preferences table.
         hak_tinymce::install();
     }
     if ($step == 'uninstall') {
         //remove table
         safe_query("DROP TABLE " . PFX . "txp_hak_tinymce");
     }
     if ($step == 'update') {
         extract(doSlash(gpsa(array('hak_show_toggle', 'hak_hide_on_textile_edit', 'hak_tinymce_path', 'hak_tinymce_body_init', 'hak_tinymce_excerpt_init', 'hak_tinymce_callbacks', 'hak_hide_textile_select', 'hak_enable_body', 'hak_enable_excerpt', 'hak_use_compressor', 'hak_tinymce_compressor_init'))));
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_show_toggle}'", "pref_name = 'show_toggle'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_hide_on_textile_edit}'", "pref_name = 'hide_on_textile_edit'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_path}'", "pref_name = 'tinymce_path'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_body_init}'", "pref_name = 'body_init'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_excerpt_init}'", "pref_name = 'excerpt_init'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_callbacks}'", "pref_name = 'callbacks'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_hide_textile_select}'", "pref_name = 'hide_textile_select'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_enable_body}'", "pref_name = 'enable_body'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_enable_excerpt}'", "pref_name = 'enable_excerpt'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_use_compressor}'", "pref_name = 'use_compressor'");
         safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_compressor_init}'", "pref_name = 'compressor_init'");
     }
     if (hak_tinymce::check_install()) {
         extract(hak_tinymce::getPrefs());
         echo n . t . '<div style="margin: auto; width:40%;">' . n . t . t . hed('hak_tinymce ' . gTxt('Preferences'), '1') . n . n . form(n . eInput('hak_tinymce_prefs') . n . sInput('update') . n . fInput('submit', 'update', 'Update', 'smallerbox') . n . graf(hak_tinymce::mce_gTxt('hak_show_toggle') . br . n . yesnoRadio('hak_show_toggle', $show_toggle) . br . n . tag(tag(hak_tinymce::mce_gTxt('auto_disable'), "em"), "small")) . n . graf(hak_tinymce::mce_gTxt('hak_hide_on_textile_edit') . br . n . yesnoRadio('hak_hide_on_textile_edit', $hide_on_textile_edit)) . n . graf(hak_tinymce::mce_gTxt('hak_hide_textile_select') . br . n . yesnoRadio('hak_hide_textile_select', $hide_textile_select)) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_path') . br . n . finput('text', 'hak_tinymce_path', $tinymce_path, '', '', '', 60, '', 'hak_tinymce_path') . hak_tinymce::file_exists($tinymce_path)) . n . graf(hak_tinymce::mce_gTxt('enable_body') . br . n . yesnoRadio('hak_enable_body', $enable_body)) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_body_init') . br . tag(tag("(" . hak_tinymce::mce_gTxt('line_end') . ")", "em"), "small") . n . href(hak_tinymce::mce_gTxt('documentation'), "http://tinymce.moxiecode.com/documentation.php") . br . n . text_area('hak_tinymce_body_init', 200, 400, $body_init)) . n . graf(hak_tinymce::mce_gTxt('enable_excerpt') . br . n . yesnoRadio('hak_enable_excerpt', $enable_excerpt)) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_excerpt_init') . br . tag(tag("(" . hak_tinymce::mce_gTxt('line_end') . ")", "em"), "small") . n . href(hak_tinymce::mce_gTxt('documentation'), "http://tinymce.moxiecode.com/documentation.php") . br . n . text_area('hak_tinymce_excerpt_init', 200, 400, $excerpt_init)) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_callbacks') . br . n . text_area('hak_tinymce_callbacks', 200, 400, $callbacks)) . n . graf(hak_tinymce::mce_gTxt('use_compressor') . br . n . yesnoRadio('hak_use_compressor', $use_compressor) . hak_tinymce::file_exists(hak_compressor_path($tinymce_path), "compressor_not_found")) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_compressor_init') . br . tag(tag("(" . hak_tinymce::mce_gTxt('compressor_line_end') . ")", "em"), "small") . n . href(hak_tinymce::mce_gTxt('documentation'), "http://wiki.moxiecode.com/index.php/TinyMCE:Compressor/PHP") . br . n . text_area('hak_tinymce_compressor_init', 200, 400, $compressor_init)) . n . n . fInput('submit', 'update', 'Update', 'smallerbox')) . '</div>';
         echo n . t . '<div style="margin: 60px auto 0; width:40%;">' . n . hed(hak_tinymce::mce_gTxt('uninstall'), '1') . n . t . t . graf(hak_tinymce::mce_gTxt('uninstall_message')) . n . n . form(n . eInput('hak_tinymce_prefs') . n . sInput('uninstall') . n . n . fInput('submit', 'uninstall', 'Uninstall ', 'smallerbox'), "", "confirm('" . hak_tinymce::mce_gTxt('uninstall_confirm') . "')") . '</div>';
     } else {
         echo n . t . '<div style="margin: auto; width:40%;">' . n . t . t . hed('hak_tinymce ' . gTxt('Preferences'), '1') . n . graf(hak_tinymce::mce_gTxt('install_message')) . n . n . form(n . eInput('hak_tinymce_prefs') . n . sInput('install') . n . n . fInput('submit', 'install', 'Install ', 'smallerbox')) . '</div>';
     }
 }
function bot_wtc_output_rows()
{
    global $bot_items;
    $selectInput_for_position = array('insertBefore' => 'before', 'insertAfter' => 'after');
    // position values for the txp function selectInput
    $data_from_db = bot_wtc_fetch_db();
    // array of values from the db
    $destination_selectInput = bot_all_items_selectinput();
    $items_selectInput = bot_contextual_selectinput();
    // builds rows for new item sections list
    $sections = bot_get_sections();
    // get sections array
    $new_item_sections_rows = '';
    foreach ($sections as $key => $value) {
        $new_item_sections_row = '<label>' . checkbox('new_item_sections[]', $key, '0') . $value . '</label><br />';
        $new_item_sections_rows .= $new_item_sections_row;
    }
    $new_item_sections_rows .= '<p style="margin-top:5px;"><a href="#" class="bot_all">' . gTxt("all") . '</a> | <a href="#" class="bot_none">' . gTxt("none") . '</a></p>';
    // hide all/none
    // new item insertion
    $rows = "";
    $input_row = tr(td(selectInput('new_item', bot_contextual_selectinput(), '', '1'), '', 'bot_hilight') . td(selectInput('new_item_position', $selectInput_for_position, '', '1')) . td(selectInput('new_item_destination', bot_all_items_selectinput(), '', '1')) . td('<p><a href="#" class="bot_push">' . gTxt("tag_section_list") . '</a></p><div class="bot_collapse" style="padding-top:10px">' . $new_item_sections_rows . '</div>') . td(finput('text', 'new_item_class', '')) . td());
    $rows .= $input_row;
    // other rows - output if at least one record was already set
    if ($data_from_db) {
        for ($i = 0; $i < count($data_from_db); $i++) {
            // data for "sections to show" selectinput - decides wether a section is checked or not
            $bot_hide_in_this_sections_array = explode('|', $data_from_db[$i]['sections']);
            $item_sections_rows = '';
            foreach ($sections as $key => $value) {
                // if section is in db mark as checked
                $checked = in_array($key, $bot_hide_in_this_sections_array) ? '1' : '0';
                $item_sections_row = '<label>' . checkbox('bot_wtc_sections_for_id_' . $data_from_db[$i]['id'] . '[]', $key, $checked) . $value . '</label><br />';
                $item_sections_rows .= $item_sections_row;
            }
            $item_sections_rows .= '<p style="margin-top:5px;"><a href="#" class="bot_all">' . gTxt("all") . '</a> | <a href="#" class="bot_none">' . gTxt("none") . '</a></p>';
            // hide all/none
            $single_row = tr(td(selectInput('item[]', bot_contextual_selectinput($data_from_db[$i]['item']), $data_from_db[$i]['item'], '0'), '', 'bot_hilight') . td(selectInput('item_position[]', $selectInput_for_position, $data_from_db[$i]['position'], '1')) . td(selectInput('item_destination[]', bot_all_items_selectinput(), $data_from_db[$i]['destination'], '1')) . td('<p><a href="#" class="bot_push">' . gTxt("tag_section_list") . '</a></p><div class="bot_collapse" style="padding-top:10px">' . $item_sections_rows . '</div>') . td(finput('text', 'item_class[]', $data_from_db[$i]['class'])) . td(checkbox('bot_delete_id[]', $data_from_db[$i]['id'], '0') . '<label for="bot_delete_id"> ' . gTxt('delete') . '</label>')) . hInput('bot_wtc_id[]', $data_from_db[$i]['id']);
            $rows .= $single_row;
        }
    }
    return $rows;
}
Esempio n. 4
0
function adi_menu_display_settings($sections)
{
    $out = '';
    foreach ($sections as $index => $section) {
        $name = $section['name'];
        $title = $section['title'];
        $parent = $section['adi_menu_parent'];
        $alt_title = $section['adi_menu_title'];
        $exclude = $section['adi_menu_exclude'];
        $clone = $section['adi_menu_clone'];
        $sort = $section['adi_menu_sort'];
        $out .= tr(tda($name) . tda($title) . tda(checkbox("exclude[{$name}]", "1", $exclude), ' style="text-align:center"') . tda(adi_menu_section_popup("parent[{$name}]", $parent)) . tda(finput("text", "sort[{$name}]", $sort, '', '', '', 4), ' style="text-align:center"') . tda(checkbox("clone[{$name}]", "1", $clone), ' style="text-align:center"') . tda(finput("text", "alt_title[{$name}]", $alt_title)));
    }
    return $out;
}
function bot_admin_tooltips_tab($event, $step)
{
    global $bot_admin_tooltips_main_array, $plugins;
    if (isset($_POST['bot_item'])) {
        // if there are preferences
        $prefs = bot_get_tips();
        // array of values from the db table
    }
    $r = safe_rows_start('name, val', 'txp_prefs', 'event = "custom" AND val != ""');
    // creates an array of all cfs for selectInput in bot_admin_tooltips_tab
    if ($r) {
        global $arr_custom_fields;
        while ($a = nextRow($r)) {
            $name = 'tab_write|' . str_replace('_set', '', $a['name']);
            $val = $a['val'];
            $arr_custom_fields[$name] = $val;
        }
    }
    pagetop('bot_admin_tooltips ' . gTxt('preferences'), $step == 'update' ? gTxt('preferences_saved') : '');
    echo hed('bot | admin tooltips', '2', ' style="text-align: center; margin:20px auto;   padding-bottom:10px;"');
    if ($step == 'install') {
        // Install the preferences table.
        bot_admin_tooltips_install();
    }
    if ($step == 'uninstall') {
        //remove table
        safe_query("DROP TABLE " . PFX . "bot_admin_tooltips");
        safe_delete('txp_prefs', 'event = "bot_tips_"');
    }
    if ($step == 'update') {
        // set function variables
        $new_item = doslash(ps('bot_new_item'));
        $new_tip = doslash(ps('bot_new_tip'));
        $item = doslash(ps('bot_item'));
        $tip = doslash(ps('bot_saved_tip'));
        $tip_id = ps('bot_id');
        $delete_id = ps('bot_delete_id');
        $hide_pophelp = ps('bot_admin_tooltips_hide_pophelp');
        $js_event = ps('bot_admin_tooltips_js_event');
        $tips_bg = doslash(ps('bot_admin_tooltips_bg'));
        $tips_color = doslash(ps('bot_admin_tooltips_color'));
        $tips_border_color = doslash(ps('bot_admin_tooltips_border_color'));
        $js_path = doslash(ps('bot_admin_tooltips_path'));
        if ($delete_id) {
            // checks if there is something to delete
            foreach ($delete_id as $id) {
                safe_delete('bot_admin_tooltips', 'id ="' . $id . '"');
            }
        }
        safe_update('txp_prefs', 'val= "' . $hide_pophelp . '"', 'name = "bot_admin_tooltips_hide_pophelp"');
        // updates pophelp prefs
        safe_update('txp_prefs', 'val= "' . $js_event . '"', 'name = "bot_admin_tooltips_js_event"');
        // updates click/hover prefs
        safe_update('txp_prefs', 'val= "' . $tips_bg . '"', 'name = "bot_admin_tooltips_bg"');
        // updates bg prefs
        safe_update('txp_prefs', 'val= "' . $tips_color . '"', 'name = "bot_admin_tooltips_color"');
        // updates color prefs
        safe_update('txp_prefs', 'val= "' . $tips_border_color . '"', 'name = "bot_admin_tooltips_border_color"');
        // updates border color prefs
        safe_update('txp_prefs', 'val= "' . $js_path . '"', 'name = "bot_admin_tooltips_path"');
        // updates path prefs
        if ($item != '' && $tip != '') {
            // when tips are set
            for ($i = 0; $i < count($item); $i++) {
                // creates the "posted_variables" array containing item, tip, tip_id
                $posted_variables[$item[$i]]['item'] = $item[$i];
                $posted_variables[$item[$i]]['tip'] = $tip[$i];
                $posted_variables[$item[$i]]['id'] = $tip_id[$i];
            }
            foreach ($posted_variables as $item => $values) {
                // for each posted variable (item, tip, tip_id) updates the db
                $tip = $values['tip'];
                $id = $values['id'];
                if ($item != '' && $tip != '') {
                    // if there is item AND tip
                    safe_update('bot_admin_tooltips', 'item = "' . $item . '", tip = "' . $tip . '"', 'id = "' . $id . '"');
                } elseif ($tip == '') {
                    // if there is no tip, tip is deleted from db
                    safe_delete('bot_admin_tooltips', 'item ="' . $item . '"');
                }
            }
            if ($new_item != '' && $new_tip != '') {
                // if there is a new tip is inserted in db
                safe_insert('bot_admin_tooltips', 'item = "' . $new_item . '", tip = "' . $new_tip . '"');
            }
        } elseif ($new_item != '' && $new_tip != '') {
            // if no tips are set yet deals only with new tip
            safe_insert('bot_admin_tooltips', 'item = "' . $new_item . '", tip = "' . $new_tip . '"');
        }
    }
    if (bot_admin_tooltips_check_install()) {
        extract(bot_admin_tooltips_get_prefs());
        // beginning of the form
        echo form('<div style="text-align:center; background:#f2f2f2; margin:20px auto 40px; padding:10px; border-bottom:solid #ccc 1px; border-top:solid #ccc 1px; ">' . n . '<label for="bot_admin_tooltips_bg">Background color </label>' . finput('text', 'bot_admin_tooltips_bg', $bot_admin_tooltips_bg) . n . '&nbsp; &nbsp;' . n . '<label for="bot_admin_tooltips_color">Text color </label>' . finput('text', 'bot_admin_tooltips_color', $bot_admin_tooltips_color) . n . '&nbsp; &nbsp;' . n . '<label for="bot_admin_tooltips_border_color">Border color </label>' . finput('text', 'bot_admin_tooltips_border_color', $bot_admin_tooltips_border_color) . n . '&nbsp; &nbsp;' . n . '<label for="bot_admin_tooltips_js_event">Show tip on hover </label>' . checkbox2('bot_admin_tooltips_js_event', $bot_admin_tooltips_js_event) . n . '&nbsp; &nbsp;' . n . '<label for="bot_admin_tooltips_hide_pophelp">Hide txp pophelps </label>' . checkbox2('bot_admin_tooltips_hide_pophelp', $bot_admin_tooltips_hide_pophelp) . n . '&nbsp; &nbsp;' . n . '<label for="bot_admin_tooltips_path">Path to js </label>' . finput('text', 'bot_admin_tooltips_path', $bot_admin_tooltips_path) . n . '</div>' . '<div style="margin: 0 auto 20px; width:580px; padding:0 10px;">' . n . eInput('bot_admin_tooltips_tab') . n . sInput('update') . n . fInput('submit', 'update', 'Update', 'publish') . '</div>' . n . startTable('list') . n . tr(td(strong('Item')) . td(strong('Tip'))) . n . bot_admin_tooltips_output_rows() . n . endTable() . '<div style="margin: 20px auto; width:580px; padding:0 10px;">' . n . eInput('bot_admin_tooltips_tab') . n . sInput('update') . n . fInput('submit', 'update', 'Update', 'publish') . '</div>');
        // uninstall button
        echo n . t . '<div style="margin: 20px auto 0; width:580px; border-top:dashed #ccc 1px; margin-top:40px; padding:10px 10px 0;">' . n . t . t . graf(bot_admin_tooltips_gTxt('uninstall_message')) . n . hed(bot_admin_tooltips_gTxt('uninstall'), '1') . n . n . form(n . eInput('bot_admin_tooltips_tab') . n . sInput('uninstall') . n . n . fInput('submit', 'uninstall', 'Uninstall ', 'smallerbox'), "", "confirm('" . bot_admin_tooltips_gTxt('uninstall_confirm') . "')") . '</div>';
    } else {
        // install message
        echo n . t . '<div style="margin: auto; width:40%;">' . n . t . t . hed('bot_admin_tooltips ' . gTxt('Preferences'), '1') . n . graf(bot_admin_tooltips_gTxt('install_message')) . n . n . form(n . eInput('bot_admin_tooltips_tab') . n . sInput('install') . n . n . fInput('submit', 'install', 'Install ', 'publish')) . '</div>';
    }
}