Exemplo n.º 1
1
function display_html($formname, $textarea, $html = TRUE, $colors = FALSE, $images = FALSE, $folder = "")
{
    global $locale;
    $res = "";
    if ($html) {
        $res .= "<div class='btn-group m-b-10'>\n";
        $res .= "<button type='button' value='b' class='btn btn-sm btn-default button' style='font-weight:bold;' onclick=\"addText('" . $textarea . "', '&lt;strong&gt;', '&lt;/strong&gt;', '" . $formname . "');\">b</button>\n";
        $res .= "<button type='button' value='i' class='btn btn-sm btn-default button' style='font-style:italic;' onclick=\"addText('" . $textarea . "', '&lt;i&gt;', '&lt;/i&gt;', '" . $formname . "');\">i</button>\n";
        $res .= "<button type='button' value='u' class='btn btn-sm btn-default button' style='text-decoration:underline;' onclick=\"addText('" . $textarea . "', '&lt;u&gt;', '&lt;/u&gt;', '" . $formname . "');\">u</button>\n";
        $res .= "<button type='button' value='link' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;a href=\\'', '\\' target=\\'_blank\\'>Link&lt;/a&gt;', '" . $formname . "');\">link</button>\n";
        $res .= "<button type='button' value='img' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;img src=\\'" . str_replace("../", "", $folder) . "', '\\' style=\\'margin:5px\\' alt=\\'\\' align=\\'left\\' /&gt;', '" . $formname . "');\">img</button>\n";
        $res .= "<button type='button' value='center' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;center&gt;', '&lt;/center&gt;', '" . $formname . "');\">center</button>\n";
        $res .= "<button type='button' value='small' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;span class=\\'small\\'&gt;', '&lt;/span&gt;', '" . $formname . "');\">small</button>\n";
        $res .= "<button type='button' value='small2' class='btn btn-sm  btn-default button' onclick=\"addText('" . $textarea . "', '&lt;span class=\\'small2\\'&gt;', '&lt;/span&gt;', '" . $formname . "');\">small2</button>\n";
        $res .= "<button type='button' value='alt' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;span class=\\'alt\\'&gt;', '&lt;/span&gt;', '" . $formname . "');\">alt</button>\n";
        $res .= "</div>\n";
    }
    if ($colors) {
        $color_array = array('maroon' => $locale['html402'], 'red' => $locale['html403'], 'orange' => $locale['html404'], 'brown' => $locale['html405'], 'yellow' => $locale['html406'], 'green' => $locale['html407'], 'lime' => $locale['html408'], 'olive' => $locale['html409'], 'cyan' => $locale['html410'], 'blue' => $locale['html411'], 'navy' => $locale['html412'], 'purple' => $locale['html413'], 'violet' => $locale['html414'], 'black' => $locale['html415'], 'gray' => $locale['html416'], 'silver' => $locale['html417'], 'white' => $locale['html418']);
        $placeholder = $locale['html400'];
        $res .= form_select('', "setcolor-{$formname}", "setcolor-{$formname}", $color_array, '', array('placeholder' => $placeholder, 'class' => 'pull-left m-r-10', 'allowclear' => 1));
        add_to_jquery("\r\n                function color(item) {\r\n                if(!item.id) {return item.text;}\r\n                var color = item.text;\r\n                return '<table><tr><td><label style=\\'display: inline-block; width: 18px; height:18px; margin:3px; margin-right:5px; padding: 0px 8px; background:'+item.text+'\\'></label>'+item.text+'</td></tr></table>';\r\n                }\r\n                \$('#setcolor-{$formname}').select2({\r\n                formatSelection: color,\r\n                escapeMarkup: function(m) { return m; },\r\n                formatResult: color,\r\n                placeholder:'{$placeholder}',\r\n                allowClear:true,\r\n                });\r\n            \$('#setcolor-{$formname}').on('change', function(e){\r\n            addText('" . $textarea . "', '<span style=\\'color:' + this.options[this.selectedIndex].value + '\\'>', '</span>', '" . $formname . "');this.selectedIndex=0;\r\n            \$(this).select2({\r\n                formatSelection: color,\r\n                escapeMarkup: function(m) { return m; },\r\n                formatResult: color,\r\n                placeholder:'{$placeholder}',\r\n                allowClear:true}).val('');\r\n            });\r\n        ");
    }
    if ($images && $folder) {
        $image_files = makefilelist($folder, ".|..|index.php", TRUE);
        $image_list = makefileopts($image_files);
        $res .= "<select name='insertimage' class='form-control textbox' style='margin-top:5px' onchange=\"insertText('" . $textarea . "', '&lt;img src=\\'" . str_replace("../", "", $folder) . "' + this.options[this.selectedIndex].value + '\\' alt=\\'\\' style=\\'margin:5px\\' align=\\'left\\' /&gt;', '" . $formname . "');this.selectedIndex=0;\">\n";
        $res .= "<option value=''>" . $locale['html401'] . "</option>\n" . $image_list . "</select>\n";
    }
    return $res;
}
Exemplo n.º 2
0
 function generateForm()
 {
     $output = form_hidden('edit[step]', 'confirm');
     $player = $this->registration->user();
     if (!$player) {
         return false;
     }
     $noneditable = array();
     $noneditable[] = array('Name', l($player->fullname, url("person/view/{$player->id}")));
     $noneditable[] = array('Member&nbsp;ID', $player->member_id);
     $noneditable[] = array('Event', l($this->event->name, url("event/view/{$this->event->registration_id}")));
     $noneditable[] = array('Registered Price', $this->registration->total_amount);
     $form = '<div class="pairtable">' . table(NULL, $noneditable) . '</div>';
     $pay_opts = getOptionsFromEnum('registrations', 'payment');
     array_shift($pay_opts);
     $form .= form_select('Registration Status', 'edit[payment]', $this->registration->payment, $pay_opts);
     $form .= form_textarea('Notes', 'edit[notes]', $this->registration->notes, 45, 5);
     $output .= form_group('Registration details', $form);
     if ($this->formbuilder) {
         $this->formbuilder->bulk_set_answers_sql('SELECT qkey, akey FROM registration_answers WHERE order_id = ?', array($this->registration->order_id));
         if (count($this->formbuilder->_answers) > 0) {
             $output .= form_group('Registration answers', $this->formbuilder->render_editable(true));
         } else {
             $output .= form_group('Registration answers', $this->formbuilder->render_editable(false));
         }
     }
     $output .= form_submit('Submit') . form_reset('Reset');
     return form($output);
 }
Exemplo n.º 3
0
 function selectDate()
 {
     global $dbh;
     if (!$this->league->load_teams()) {
         error_exit("Error loading teams for league {$league->fullname}");
     }
     $output .= "<p>Games for " . strftime("%A %B %d %Y", $this->day_id) . " should be moved to: </p>";
     $sth = $dbh->prepare("SELECT COUNT(*) from schedule s, gameslot g WHERE s.game_id = g.game_id AND s.league_id = ? AND UNIX_TIMESTAMP(g.game_date) = ?");
     $sth->execute(array($this->league->league_id, $this->day_id));
     $need_slots = $sth->fetchColumn();
     $sth = $dbh->prepare("SELECT\n\t\t\t\tUNIX_TIMESTAMP(s.game_date) AS datestamp,\n\t\t\t\tCOUNT(*) AS num_avail\n\t\t\t FROM\n\t\t\t \tleague_gameslot_availability a, gameslot s\n\t\t\t WHERE (a.slot_id = s.slot_id)\n\t\t\t \tAND isnull(s.game_id)\n\t\t\t\tAND a.league_id = ?\n\t\t\t\tAND UNIX_TIMESTAMP(s.game_date) != ?\n\t\t\t GROUP BY s.game_date\n\t\t\t ORDER BY s.game_date");
     $sth->execute(array($this->league->league_id, $this->day_id));
     $possible_dates = array();
     while ($date = $sth->fetch(PDO::FETCH_OBJ)) {
         $possible_dates[$date->datestamp] = strftime("%A %B %d %Y", $date->datestamp);
     }
     if (count($possible_dates) == 0) {
         error_exit("Sorry, there are no future fields available for your league.  Check that fields have been allocated before attempting to proceed.");
     }
     $output .= form_hidden('edit[step]', 'confirm');
     $output .= form_hidden('edit[type]', $type);
     $output .= form_hidden('edit[olddate]', $this->day_id);
     $output .= form_select('Start date', 'edit[newdate]', null, $possible_dates);
     $output .= form_submit('Next step');
     return form($output);
 }
Exemplo n.º 4
0
function global_settings()
{
    $group = form_textfield('Organization name', 'edit[app_org_name]', variable_get('app_org_name', ''), 60, 120, 'Your organization\'s full name.');
    $group .= form_textfield('Organization short name', 'edit[app_org_short_name]', variable_get('app_org_short_name', ''), 60, 120, 'Your organization\'s abbreviated name or acronym.');
    $group .= form_textfield('Address', 'edit[app_org_address]', variable_get('app_org_address', ''), 60, 120, 'Your organization\'s street address.');
    $group .= form_textfield('Unit', 'edit[app_org_address2]', variable_get('app_org_address2', ''), 60, 120, 'Your organization\'s unit number, if any.');
    $group .= form_textfield('City', 'edit[app_org_city]', variable_get('app_org_city', ''), 60, 120, 'Your organization\'s city.');
    $group .= form_select('Province/State', 'edit[app_org_province]', variable_get('app_org_province', ''), getProvinceNames(), 'Your organization\'s province or state.');
    $group .= form_textfield('Postal code', 'edit[app_org_postal]', variable_get('app_org_postal', ''), 60, 120, 'Your organization\'s postal code.');
    $group .= form_textfield('Phone', 'edit[app_org_phone]', variable_get('app_org_phone', ''), 60, 120, 'Your organization\'s phone number.');
    $group .= form_textfield('Administrator name', 'edit[app_admin_name]', variable_get('app_admin_name', 'Leaguerunner Administrator'), 60, 120, 'The name (or descriptive role) of the system administrator. Mail from Leaguerunner will come from this name.');
    $group .= form_textfield('Administrator e-mail address', 'edit[app_admin_email]', variable_get('app_admin_email', $_SERVER['SERVER_ADMIN']), 60, 120, 'The e-mail address of the system administrator.  Mail from Leaguerunner will come from this address.');
    $output = form_group('Organization Details', $group);
    $group = form_textfield('Latitude', 'edit[location_latitude]', variable_get('location_latitude', ''), 10, 10, 'Latitude in decimal degrees for game location (center of city).  Used for calculating sunset times.');
    $group .= form_textfield('Longitude', 'edit[location_longitude]', variable_get('location_longitude', ''), 10, 10, 'Longitude in decimal degrees for game location (center of city).  Used for calculating sunset times.');
    $output .= form_group('Location Details', $group);
    $group = form_textfield('Name of application', 'edit[app_name]', variable_get('app_name', 'Leaguerunner'), 60, 120, 'The name this application will be known as to your users.');
    $group .= form_textfield('Items per page', 'edit[items_per_page]', variable_get('items_per_page', 25), 10, 10, 'The number of items that will be shown per page on long reports, 0 for no limit (not recommended).');
    $group .= form_textfield('Base location of static league files (filesystem)', 'edit[league_file_base]', variable_get('league_file_base', '/opt/websites/www.ocua.ca/static-content/leagues'), 60, 120, 'The filesystem location where files for permits, exported standings, etc, shall live.');
    $group .= form_textfield('Base location of static league files (URL)', 'edit[league_url_base]', variable_get('league_url_base', 'http://www.ocua.ca/leagues'), 60, 120, 'The web-accessible URL where files for permits, exported standings, etc, shall live.');
    $group .= form_textfield('Location of privacy policy (URL)', 'edit[privacy_policy]', variable_get('privacy_policy', "{$_SERVER['SERVER_NAME']}/privacy"), 60, 120, 'The web-accessible URL where the organization\'s privacy policy is located. Leave blank if you don\'t have an online privacy policy.');
    $group .= form_textfield('Location of password reset (URL)', 'edit[password_reset]', variable_get('password_reset', url('person/forgotpassword')), 60, 120, 'The web-accessible URL where the password reset page is located.');
    $group .= form_textfield('Google Maps API Key', 'edit[gmaps_key]', variable_get('gmaps_key', ''), 60, 120, 'An API key for the <a href="http://www.google.com/apis/maps/signup.html">Google Maps API</a>. Required for rendering custom Google Maps');
    $output .= form_group('Site configuration', $group);
    $group = form_select('Current Season', 'edit[current_season]', variable_get('current_season', 'Summer'), getOptionsFromQuery("SELECT id AS theKey, display_name AS theValue FROM season ORDER BY year, id"), 'Season of play currently in effect');
    $output .= form_group('Season Information', $group);
    $group = form_textfield('Spirit penalty for not entering score', 'edit[missing_score_spirit_penalty]', variable_get('missing_score_spirit_penalty', 3), 10, 10);
    $group .= form_textfield('Winning score to record for defaults', 'edit[default_winning_score]', variable_get('default_winning_score', 6), 10, 10);
    $group .= form_textfield('Losing score to record for defaults', 'edit[default_losing_score]', variable_get('default_losing_score', 0), 10, 10);
    $group .= form_radios('Transfer ratings points for defaults', 'edit[default_transfer_ratings]', variable_get('default_transfer_ratings', 0), array('Disabled', 'Enabled'));
    $group .= form_select('Spirit Questions', 'edit[spirit_questions]', variable_get('spirit_questions', 'team_spirit'), array('team_spirit' => 'team_spirit', 'ocua_team_spirit' => 'ocua_team_spirit'), 'Type of spirit questions to use.');
    $output .= form_group('Game Finalization', $group);
    return $output;
}
Exemplo n.º 5
0
function showratings($rating_type, $rating_item_id, $rating_link)
{
    global $locale, $userdata;
    $settings = \fusion_get_settings();
    if ($settings['ratings_enabled'] == "1") {
        if (iMEMBER) {
            $d_rating = dbarray(dbquery("SELECT rating_vote,rating_datestamp FROM " . DB_RATINGS . " WHERE rating_item_id='" . $rating_item_id . "' AND rating_type='" . $rating_type . "' AND rating_user='******'user_id'] . "'"));
            if (isset($_POST['post_rating'])) {
                // Rate
                if (isnum($_POST['rating']) && $_POST['rating'] > 0 && $_POST['rating'] < 6 && !isset($d_rating['rating_vote'])) {
                    $result = dbquery("INSERT INTO " . DB_RATINGS . " (rating_item_id, rating_type, rating_user, rating_vote, rating_datestamp, rating_ip, rating_ip_type) VALUES ('{$rating_item_id}', '{$rating_type}', '" . $userdata['user_id'] . "', '" . $_POST['rating'] . "', '" . time() . "', '" . USER_IP . "', '" . USER_IP_TYPE . "')");
                    if ($result) {
                        defender::unset_field_session();
                    }
                }
                redirect($rating_link);
            } elseif (isset($_POST['remove_rating'])) {
                // Unrate
                $result = dbquery("DELETE FROM " . DB_RATINGS . " WHERE rating_item_id='{$rating_item_id}' AND rating_type='{$rating_type}' AND rating_user='******'user_id'] . "'");
                if ($result) {
                    defender::unset_field_session();
                }
                redirect($rating_link);
            }
        }
        $ratings = array(5 => $locale['r120'], 4 => $locale['r121'], 3 => $locale['r122'], 2 => $locale['r123'], 1 => $locale['r124']);
        if (!iMEMBER) {
            $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a>", $locale['r104']);
            if (fusion_get_settings("enable_registration") == TRUE) {
                $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a> " . $locale['or'] . " <a href='" . BASEDIR . "register.php'>" . $locale['register'] . "</a>", $locale['r104']);
            }
            echo "<div class='text-center'>" . $message . "</div>\n";
        } elseif (isset($d_rating['rating_vote'])) {
            echo "<div class='display-block'>\n";
            echo openform('removerating', 'post', $rating_link, array('class' => 'display-block text-center'));
            echo sprintf($locale['r105'], $ratings[$d_rating['rating_vote']], showdate("longdate", $d_rating['rating_datestamp'])) . "<br /><br />\n";
            echo form_button('remove_rating', $locale['r102'], $locale['r102'], array('class' => 'btn-default', 'icon' => 'fa fa-times m-r-10'));
            echo closeform();
            echo "</div>\n";
        } else {
            echo "<div class='display-block'>\n";
            echo openform('postrating', 'post', $rating_link, array('max_tokens' => 1, 'notice' => 0, 'class' => 'm-b-20 text-center'));
            echo form_select('rating', $locale['r106'], '', array('options' => $ratings, 'class' => 'display-block text-center'));
            echo form_button('post_rating', $locale['r103'], $locale['r103'], array('class' => 'btn-primary btn-sm', 'icon' => 'fa fa-thumbs-up m-r-10'));
            echo closeform();
            echo "</div>\n";
        }
        $rating_votes = dbarray(dbquery("\n\t\tSELECT\n\t\tSUM(IF(rating_vote='5', 1, 0)) as r120,\n\t\tSUM(IF(rating_vote='4', 1, 0)) as r121,\n\t\tSUM(IF(rating_vote='3', 1, 0)) as r122,\n\t\tSUM(IF(rating_vote='2', 1, 0)) as r123,\n\t\tSUM(IF(rating_vote='1', 1, 0)) as r124\n\t\tFROM " . DB_RATINGS . " WHERE rating_type='" . $rating_type . "' and rating_item_id='" . intval($rating_item_id) . "'\n\t\t"));
        if (!empty($rating_votes)) {
            echo "<div id='ratings' class='rating_container'>\n";
            foreach ($rating_votes as $key => $num) {
                echo progress_bar($num, $locale[$key], FALSE, '10px', TRUE, FALSE);
            }
            echo "</div>\n";
        } else {
            echo "<div class='text-center'>" . $locale['r101'] . "</div>\n";
        }
    }
}
function UserAngelType_add_view($angeltype, $users_source, $user_id)
{
    $users = array();
    foreach ($users_source as $user_source) {
        $users[$user_source['UID']] = User_Nick_render($user_source);
    }
    return page_with_title(_("Add user to angeltype"), array(msg(), buttons(array(button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _("back"), 'back'))), form(array(form_info(_("Angeltype"), $angeltype['name']), form_select('user_id', _("User"), $users, $user_id), form_submit('submit', _("Add"))))));
}
Exemplo n.º 7
0
function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $shifttype_id)
{
    $angeltypes_select = ['' => _('All')];
    foreach ($angeltypes as $angeltype) {
        $angeltypes_select[$angeltype['id']] = $angeltype['name'];
    }
    return page_with_title($shifttype_id ? _('Edit shifttype') : _('Create shifttype'), [msg(), buttons([button(page_link_to('shifttypes'), shifttypes_title(), 'back')]), form([form_text('name', _('Name'), $name), form_select('angeltype_id', _('Angeltype'), $angeltypes_select, $angeltype_id), form_textarea('description', _('Description'), $description), form_info('', _('Please use markdown for the description.')), form_submit('submit', _('Save'))])]);
}
Exemplo n.º 8
0
function admin_free()
{
    global $privileges;
    $search = "";
    if (isset($_REQUEST['search'])) {
        $search = strip_request_item('search');
    }
    $angeltypesearch = "";
    if (empty($_REQUEST['angeltype'])) {
        $_REQUEST['angeltype'] = '';
    } else {
        $angeltypesearch = " INNER JOIN `UserAngelTypes` ON (`UserAngelTypes`.`angeltype_id` = '" . sql_escape($_REQUEST['angeltype']) . "' AND `UserAngelTypes`.`user_id` = `User`.`UID`";
        if (isset($_REQUEST['confirmed_only'])) {
            $angeltypesearch .= " AND `UserAngelTypes`.`confirm_user_id`";
        }
        $angeltypesearch .= ") ";
    }
    $angel_types_source = sql_select("SELECT `id`, `name` FROM `AngelTypes` ORDER BY `name`");
    $angel_types = array('' => 'alle Typen');
    foreach ($angel_types_source as $angel_type) {
        $angel_types[$angel_type['id']] = $angel_type['name'];
    }
    $users = sql_select("\n      SELECT `User`.* \n      FROM `User` \n      {$angeltypesearch} \n      LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` \n      LEFT JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID` AND `Shifts`.`start` < '" . sql_escape(time()) . "' AND `Shifts`.`end` > '" . sql_escape(time()) . "') \n      WHERE `User`.`Gekommen` = 1 AND `Shifts`.`SID` IS NULL \n      GROUP BY `User`.`UID` \n      ORDER BY `Nick`");
    $free_users_table = array();
    if ($search == "") {
        $tokens = array();
    } else {
        $tokens = explode(" ", $search);
    }
    foreach ($users as $usr) {
        if (count($tokens) > 0) {
            $match = false;
            $index = join("", $usr);
            foreach ($tokens as $t) {
                if (stristr($index, trim($t))) {
                    $match = true;
                    break;
                }
            }
            if (!$match) {
                continue;
            }
        }
        $free_users_table[] = array('name' => User_Nick_render($usr), 'shift_state' => User_shift_state_render($usr), 'handy' => $usr['Handy'], 'telefon' => $usr['Telefon'], 'email' => $usr['email'], 'kommentar' => $usr['kommentar'], 'actions' => in_array('admin_user', $privileges) ? button(page_link_to('admin_user') . '&amp;id=' . $usr['UID'], _("edit"), 'btn-xs') : '');
    }
    return page_with_title(admin_free_title(), array(form(array(div('row', array(div('col-md-4', array(form_text('search', _("Search"), $search))), div('col-md-4', array(form_select('angeltype', _("Angeltype"), $angel_types, $_REQUEST['angeltype']))), div('col-md-2', array(form_checkbox('confirmed_only', _("Only confirmed"), isset($_REQUEST['confirmed_only'])))), div('col-md-2', array(form_submit('submit', _("Search")))))))), table(array('name' => _("Nick"), 'shift_state' => '', 'handy' => _("Mobile"), 'telefon' => _("Phone"), 'email' => _("E-Mail"), 'kommentar' => _("add. Info"), 'actions' => ''), $free_users_table)));
}
function location_upgrade_page()
{
    global $user, $sql_updates;
    if (isset($_POST['edit'])) {
        $edit = $_POST['edit'];
    }
    if (isset($_POST['op'])) {
        $op = $_POST['op'];
    }
    switch ($op) {
        case "Update":
            $edit = $_POST['edit'];
            if (!isset($edit['location_update_version']) || $edit['location_update_version'] == 0) {
                //*****************************
                $form = form_select('Select the update after your most recent update', 'location_update_version', '', $sql_updates, 'Please select what you think was the last update for this module.  If you\'re not sure of what your last update was, it is better to select one that is older than what you think than to select one that is newer.  Updates that are too old for you will fail while the newer ones will still execute.');
                $form .= form_submit('Update');
                $form = form($form);
                print location_upgrade_page_header('location.module database update');
                print location_upgrade_info();
                print '<font color="#FF0000">You need to select your last update first!</font>' . "<br/>\n";
                print $form;
                print location_upgrade_page_footer();
                break;
                //*****************************
            } else {
                // make sure we have updates to run.
                print location_upgrade_page_header("location.module database update");
                $links[] = "<a href=\"index.php\">main page</a>";
                $links[] = "<a href=\"index.php?q=admin\">administration pages</a>";
                print theme("item_list", $links);
                location_upgrade($edit['location_update_version']);
                print location_upgrade_page_footer();
            }
            break;
        default:
            $form = form_select('Select the update after your most recent update.', 'location_update_version', '', array_merge(array('' => ''), $sql_updates), 'Please select what you think was the last update for this module.  If you\'re not sure of what your last update was, it is better to select one that is older than what you think than to select one that is newer.  Updates that are too old for you will fail while the newer ones will still execute.');
            $form .= form_submit('Update');
            $form = form($form);
            print location_upgrade_page_header('location.module database update');
            print location_upgrade_info();
            print $form;
            print location_upgrade_page_footer();
            break;
    }
}
Exemplo n.º 10
0
 function generateForm($data = array())
 {
     $output = form_hidden("edit[step]", "confirm");
     $output .= form_textfield("Field Identification", 'edit[num]', $data['num'], 15, 15, "Location of this field at the given site; cannot be 0");
     $output .= form_select("Field Status", 'edit[status]', $data['status'], array('open' => 'open', 'closed' => 'closed'));
     $output .= form_select("Field Rating", 'edit[rating]', $data['rating'], field_rating_values(), "Rate this field on the scale provided");
     // TODO: Should become Field::get_eligible_parents()
     $sth = Field::query(array('_extra' => 'ISNULL(parent_fid)', '_order' => 'f.name,f.num'));
     $parents = array();
     $parents[0] = "---";
     while ($p = $sth->fetch(PDO::FETCH_OBJ)) {
         $parents[$p->fid] = $p->fullname;
     }
     $output .= form_select("Parent Field", 'edit[parent_fid]', $data['parent_fid'], $parents, "Inherit location and name from other field");
     if (!$data['parent_fid']) {
         $output .= form_textfield("Field Name", 'edit[name]', $data['name'], 35, 255, "Name of field (do not append number)");
         $output .= form_textfield("Field Code", 'edit[code]', $data['code'], 3, 3, "Three-letter abbreviation for field site");
         $output .= form_select("Region", 'edit[region]', $data['region'], getOptionsFromEnum('field', 'region'), "Area of city this field is located in");
         $output .= form_select("Is indoor", 'edit[is_indoor]', $data['is_indoor'], array(0 => 'No', 1 => 'Yes'), "Is this an indoor field");
         $output .= form_textfield('Street and Number', 'edit[location_street]', $data['location_street'], 25, 100);
         $output .= form_textfield('City', 'edit[location_city]', $data['location_city'], 25, 100, 'Name of city');
         $output .= form_select('Province', 'edit[location_province]', $data['location_province'], getProvinceNames(), 'Select a province from the list');
         $output .= form_textfield("Location Map", 'edit[location_url]', $data['location_url'], 50, 255, "URL for image that shows how to reach the field");
         $output .= form_textfield("Layout Map", 'edit[layout_url]', $data['layout_url'], 50, 255, "URL for image that shows how to set up fields at the site");
         $output .= form_textarea("Driving Directions", 'edit[driving_directions]', $data['driving_directions'], 60, 5, "");
         $output .= form_textarea("Parking Details", 'edit[parking_details]', $data['parking_details'], 60, 5, "");
         $output .= form_textarea("Transit Directions", 'edit[transit_directions]', $data['transit_directions'], 60, 5, "");
         $output .= form_textarea("Biking Directions", 'edit[biking_directions]', $data['biking_directions'], 60, 5, "");
         $output .= form_textarea("Public Washrooms", 'edit[washrooms]', $data['washrooms'], 60, 5, "");
         $output .= form_textarea("Special Instructions", 'edit[public_instructions]', $data['public_instructions'], 60, 5, "Specific instructions for this site that don't fit any other category.");
         $output .= form_textarea("Private Instructions", 'edit[site_instructions]', $data['site_instructions'], 60, 5, "Instructions for this site that should be shown only to logged-in members.");
         $output .= form_textarea("Sponsorship", 'edit[sponsor]', $data['sponsor'], 60, 5, "");
     }
     $output .= form_submit('Submit') . form_reset('Reset');
     return form($output);
 }
Exemplo n.º 11
0
<?php

require '../../include/mellivora.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('Site management');
menu_management();
section_subhead('Search');
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/search');
form_input_text('Search for');
$opts[] = array('id' => 'users', 'name' => 'Users');
$opts[] = array('id' => 'ip_log', 'name' => 'IP log');
form_select($opts, 'Search in', 'id', 'users', 'name');
form_button_submit('Search');
form_xsrf_token();
form_end();
foot();
Exemplo n.º 12
0
    if (dbcount("(user_id)", DB_USERS, "user_groups REGEXP('^\\\\.{$_GET['group_id']}\$|\\\\.{$_GET['group_id']}\\\\.|\\\\.{$_GET['group_id']}\$')")) {
        redirect(FUSION_SELF . $aidlink . "&status=deln");
    } else {
        $result = dbquery("DELETE FROM " . DB_USER_GROUPS . " WHERE group_id='" . $_GET['group_id'] . "'");
        redirect(FUSION_SELF . $aidlink . "&status=dely");
    }
}
$result = dbquery("SELECT group_id, group_name FROM " . DB_USER_GROUPS . " ORDER BY group_name");
if (dbrows($result)) {
    opentable($locale['420']);
    echo openform('selectform', 'selectform', 'post', FUSION_SELF . $aidlink, array('downtime' => 0, 'notice' => 0));
    $sel_opts = array();
    while ($data = dbarray($result)) {
        $sel_opts[$data['group_id']] = "ID: " . $data['group_id'] . " - " . $data['group_name'];
    }
    echo form_select('', 'group_id', 'group_id', $sel_opts, '', array('placeholder' => $locale['choose'], 'class' => 'pull-left'));
    echo form_button($locale['421'], 'edit', 'edit', $locale['421'], array('class' => 'btn-primary m-l-10 pull-left'));
    echo form_button($locale['422'], 'delete', 'delete', $locale['422'], array('class' => 'btn-primary m-l-10 pull-left'));
    echo closeform();
    closetable();
}
if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {
    $result = dbquery("SELECT group_name, group_description FROM " . DB_USER_GROUPS . " WHERE group_id='" . $_GET['group_id'] . "'");
    if (dbrows($result)) {
        $data = dbarray($result);
        $group_name = $data['group_name'];
        $group_description = $data['group_description'];
        $form_action = FUSION_SELF . $aidlink . "&amp;group_id=" . $_GET['group_id'];
        opentable($locale['430']);
    } else {
        redirect(FUSION_SELF . $aidlink);
Exemplo n.º 13
0
<?php

require '../../include/ctf.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('Site management');
menu_management();
section_subhead('New hint');
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_hint');
form_textarea('Body');
$opts = db_query_fetch_all('
    SELECT
       ch.id,
       ch.title,
       ca.title AS category
    FROM challenges AS ch
    LEFT JOIN categories AS ca ON ca.id = ch.category
    ORDER BY ca.title, ch.title');
form_select($opts, 'Challenge', 'id', array_get($_GET, 'id', 0), 'title', 'category');
form_input_checkbox('Visible');
form_hidden('action', 'new');
form_button_submit('Create hint');
form_end();
foot();
Exemplo n.º 14
0
function afficher_form_prefs($erreurs = '')
{
    afficher_html_head($GLOBALS['lang']['preferences']);
    echo '<div id="top">';
    afficher_msg();
    afficher_topnav(basename($_SERVER['PHP_SELF']), $GLOBALS['lang']['preferences']);
    echo '</div>';
    echo '<div id="axe">' . "\n";
    echo '<div id="page">' . "\n";
    echo erreurs($erreurs);
    echo '<form id="preferences" class="bordered-formbloc" method="post" action="' . basename($_SERVER['PHP_SELF']) . '" >';
    $fld_user = '******';
    /* no fieldset because browset can’t style them correctly */
    $fld_user .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_utilisateur'], 'legend-user') . '</div>' . "\n";
    $fld_user .= '<div class="form-lines">' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="auteur">' . $GLOBALS['lang']['pref_auteur'] . '</label>' . "\n";
    $fld_user .= "\t" . '<input type="text" id="auteur" name="auteur" size="30" value="' . (empty($GLOBALS['auteur']) ? $GLOBALS['identifiant'] : $GLOBALS['auteur']) . '" class="text" />' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="email">' . $GLOBALS['lang']['pref_email'] . '</label>' . "\n";
    $fld_user .= "\t" . '<input type="text" id="email" name="email" size="30" value="' . $GLOBALS['email'] . '" class="text" />' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="nomsite">' . $GLOBALS['lang']['pref_nom_site'] . '</label>' . "\n";
    $fld_user .= "\t" . '<input type="text" id="nomsite" name="nomsite" size="30" value="' . $GLOBALS['nom_du_site'] . '" class="text" />' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="racine">' . $GLOBALS['lang']['pref_racine'] . '</label>' . "\n";
    $fld_user .= "\t" . '<input type="text" id="racine" name="racine" size="30" value="' . $GLOBALS['racine'] . '" class="text" />' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="description">' . $GLOBALS['lang']['label_dp_description'] . '</label>' . "\n";
    $fld_user .= "\t" . '<textarea id="description" name="description" cols="35" rows="2" class="text" >' . $GLOBALS['description'] . '</textarea>' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="keywords">' . $GLOBALS['lang']['pref_keywords'] . '</label>';
    $fld_user .= "\t" . '<textarea id="keywords" name="keywords" cols="35" rows="2" class="text" >' . $GLOBALS['keywords'] . '</textarea>' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '</div>' . "\n";
    $fld_user .= '</div>';
    echo $fld_user;
    $fld_securite = '<div role="group" class="pref">';
    $fld_securite .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_securite'], 'legend-securite') . '</div>' . "\n";
    $fld_securite .= '<div class="form-lines">' . "\n";
    $fld_securite .= '<p>' . "\n";
    $fld_securite .= "\t" . '<label for="identifiant">' . $GLOBALS['lang']['pref_identifiant'] . '</label>' . "\n";
    $fld_securite .= "\t" . '<input type="text" id="identifiant" name="identifiant" size="30" value="' . $GLOBALS['identifiant'] . '" class="text" />' . "\n";
    $fld_securite .= '</p>' . "\n";
    $fld_securite .= '<p>' . "\n";
    $fld_securite .= "\t" . '<label for="mdp">' . $GLOBALS['lang']['pref_mdp'] . '</label>';
    $fld_securite .= "\t" . '<input type="password" id="mdp" name="mdp" size="30" value="" class="text" autocomplete="off" />' . "\n";
    $fld_securite .= '</p>' . "\n";
    $fld_securite .= '<p>' . "\n";
    $fld_securite .= "\t" . '<label for="mdp_rep">' . $GLOBALS['lang']['pref_mdp_nouv'] . '</label>';
    $fld_securite .= "\t" . '<input type="password" id="mdp_rep" name="mdp_rep" size="30" value="" class="text" autocomplete="off" />' . "\n";
    $fld_securite .= '</p>' . "\n";
    if (in_array('gd', get_loaded_extensions())) {
        // captcha only possible if GD library is installed.
        $fld_securite .= '<p>' . "\n";
        $fld_securite .= select_yes_no('connexion_captcha', $GLOBALS['connexion_captcha'], $GLOBALS['lang']['pref_connexion_captcha']);
        $fld_securite .= '</p>' . "\n";
    } else {
        $fld_securite .= hidden_input('connexion_captcha', '0');
    }
    $fld_securite .= '</div>';
    $fld_securite .= '</div>';
    echo $fld_securite;
    $fld_apparence = '<div role="group" class="pref">';
    $fld_apparence .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_apparence'], 'legend-apparence') . '</div>' . "\n";
    $fld_apparence .= '<div class="form-lines">' . "\n";
    $fld_apparence .= '<p>' . "\n";
    $fld_apparence .= form_select('theme', liste_themes($GLOBALS['BT_ROOT_PATH'] . $GLOBALS['dossier_themes']), $GLOBALS['theme_choisi'], $GLOBALS['lang']['pref_theme']);
    $fld_apparence .= '</p>' . "\n";
    $fld_apparence .= '<p>' . "\n";
    $fld_apparence .= form_select('nb_maxi', array('5' => '5', '10' => '10', '15' => '15', '20' => '20', '25' => '25', '50' => '50'), $GLOBALS['max_bill_acceuil'], $GLOBALS['lang']['pref_nb_maxi']);
    $fld_apparence .= '</p>' . "\n";
    $fld_apparence .= '<p>' . "\n";
    $fld_apparence .= select_yes_no('aff_onglet_rss', $GLOBALS['onglet_rss'], $GLOBALS['lang']['pref_afficher_rss']);
    $fld_apparence .= '</p>' . "\n";
    $fld_apparence .= '<p>' . "\n";
    $fld_apparence .= select_yes_no('aff_onglet_liens', $GLOBALS['onglet_liens'], $GLOBALS['lang']['pref_afficher_liens']);
    $fld_apparence .= '</p>' . "\n";
    $fld_apparence .= '</div>' . "\n";
    $fld_apparence .= '</div>';
    echo $fld_apparence;
    $fld_dateheure = '<div role="group" class="pref">';
    $fld_dateheure .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_langdateheure'], 'legend-dateheure') . '</div>' . "\n";
    $fld_dateheure .= '<div class="form-lines">' . "\n";
    $fld_dateheure .= '<p>' . "\n";
    $fld_dateheure .= form_langue($GLOBALS['lang']['id']);
    $fld_dateheure .= '</p>' . "\n";
    $fld_dateheure .= '<p>' . "\n";
    $fld_dateheure .= form_format_date($GLOBALS['format_date']);
    $fld_dateheure .= '</p>' . "\n";
    $fld_dateheure .= '<p>' . "\n";
    $fld_dateheure .= form_format_heure($GLOBALS['format_heure']);
    $fld_dateheure .= '</p>' . "\n";
    $fld_dateheure .= '<p>' . "\n";
    $fld_dateheure .= form_fuseau_horaire($GLOBALS['fuseau_horaire']);
    $fld_dateheure .= '</p>' . "\n";
    $fld_dateheure .= '</div>' . "\n";
    $fld_dateheure .= '</div>';
    echo $fld_dateheure;
    $fld_cfg_blog = '<div role="group" class="pref">';
    $fld_cfg_blog .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_configblog'], 'legend-config') . '</div>' . "\n";
    $fld_cfg_blog .= '<div class="form-lines">' . "\n";
    $nbs = array('10' => '10', '25' => '25', '50' => '50', '100' => '100', '300' => '300', '-1' => $GLOBALS['lang']['pref_all']);
    $fld_cfg_blog .= '<p>' . "\n";
    $fld_cfg_blog .= form_select('nb_list', $nbs, $GLOBALS['max_bill_admin'], $GLOBALS['lang']['pref_nb_list']);
    $fld_cfg_blog .= '</p>' . "\n";
    $fld_cfg_blog .= '<p>' . "\n";
    $fld_cfg_blog .= form_select('nb_list_com', $nbs, $GLOBALS['max_comm_admin'], $GLOBALS['lang']['pref_nb_list_com']);
    $fld_cfg_blog .= '</p>' . "\n";
    $fld_cfg_blog .= '<p>' . "\n";
    $fld_cfg_blog .= select_yes_no('activer_categories', $GLOBALS['activer_categories'], $GLOBALS['lang']['pref_categories']);
    $fld_cfg_blog .= '</p>' . "\n";
    $fld_cfg_blog .= '<p>' . "\n";
    $fld_cfg_blog .= select_yes_no('auto_keywords', $GLOBALS['automatic_keywords'], $GLOBALS['lang']['pref_automatic_keywords']);
    $fld_cfg_blog .= '</p>' . "\n";
    $fld_cfg_blog .= '<p>' . "\n";
    $fld_cfg_blog .= select_yes_no('global_comments', $GLOBALS['global_com_rule'], $GLOBALS['lang']['pref_allow_global_coms']);
    $fld_cfg_blog .= '</p>' . "\n";
    $fld_cfg_blog .= '<p>' . "\n";
    $fld_cfg_blog .= select_yes_no('require_email', $GLOBALS['require_email'], $GLOBALS['lang']['pref_force_email']);
    $fld_cfg_blog .= '</p>' . "\n";
    $fld_cfg_blog .= '<p>' . "\n";
    $fld_cfg_blog .= form_select('comm_defaut_status', array('1' => $GLOBALS['lang']['pref_comm_black_list'], '0' => $GLOBALS['lang']['pref_comm_white_list']), $GLOBALS['comm_defaut_status'], $GLOBALS['lang']['pref_comm_BoW_list']);
    $fld_cfg_blog .= '</p>' . "\n";
    $fld_cfg_blog .= '</div>' . "\n";
    $fld_cfg_blog .= '</div>';
    echo $fld_cfg_blog;
    $fld_cfg_linx = '<div role="group" class="pref">';
    $fld_cfg_linx .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_configlinx'], 'legend-config') . '</div>' . "\n";
    $fld_cfg_linx .= '<div class="form-lines">' . "\n";
    // nb liens côté admin
    $nbs = array('50' => '50', '100' => '100', '200' => '200', '300' => '300', '500' => '500', '-1' => $GLOBALS['lang']['pref_all']);
    $fld_cfg_linx .= '<p>' . "\n";
    $fld_cfg_linx .= form_select('nb_list_linx', $nbs, $GLOBALS['max_linx_admin'], $GLOBALS['lang']['pref_nb_list_linx']);
    $fld_cfg_linx .= '</p>' . "\n";
    // partage de fichiers !pages : télécharger dans fichiers automatiquement ?
    $nbs = array('0' => $GLOBALS['lang']['non'], '1' => $GLOBALS['lang']['oui'], '2' => $GLOBALS['lang']['pref_ask_everytime']);
    $fld_cfg_linx .= '<p>' . "\n";
    $fld_cfg_linx .= form_select('dl_link_to_files', $nbs, $GLOBALS['dl_link_to_files'], $GLOBALS['lang']['pref_linx_dl_auto']);
    $fld_cfg_linx .= '</p>' . "\n";
    // lien à glisser sur la barre des favoris
    $a = explode('/', dirname($_SERVER['PHP_SELF']));
    $fld_cfg_linx .= '<p>';
    $fld_cfg_linx .= '<label>' . $GLOBALS['lang']['pref_label_bookmark_lien'] . '</label>' . "\n";
    $fld_cfg_linx .= '<a class="dnd-to-favs" onclick="alert(\'' . $GLOBALS['lang']['pref_alert_bookmark_link'] . '\');return false;" href="javascript:javascript:(function(){window.open(\'' . $GLOBALS['racine'] . $a[count($a) - 1] . '/links.php?url=\'+encodeURIComponent(location.href));})();"><b>Save link</b></a>';
    $fld_cfg_linx .= '</p>' . "\n";
    $fld_cfg_linx .= '</div>' . "\n";
    $fld_cfg_linx .= '</div>';
    echo $fld_cfg_linx;
    $fld_maintenance = '<div role="group" class="pref">';
    $fld_maintenance .= '<div class="form-legend">' . legend($GLOBALS['lang']['titre_maintenance'], 'legend-sweep') . '</div>' . "\n";
    $fld_maintenance .= '<div class="form-lines">' . "\n";
    $fld_maintenance .= '<p>' . "\n";
    $fld_maintenance .= select_yes_no('check_update', $GLOBALS['check_update'], $GLOBALS['lang']['pref_check_update']);
    $fld_maintenance .= '</p>' . "\n";
    $fld_maintenance .= '<p>' . "\n";
    $fld_maintenance .= "\t" . '<label>' . $GLOBALS['lang']['pref_go_to_maintenance'] . '</label>' . "\n";
    $fld_maintenance .= "\t" . '<a href="maintenance.php">Maintenance</a>' . "\n";
    $fld_maintenance .= '</p>' . "\n";
    $fld_maintenance .= '</div>' . "\n";
    $fld_maintenance .= '</div>';
    echo $fld_maintenance;
    // check if a new Blogotext version is available (code from Shaarli, by Sebsauvage).
    // Get latest version number at most once a day.
    if ($GLOBALS['check_update'] == 1) {
        if (!is_file($GLOBALS['last-online-file']) or filemtime($GLOBALS['last-online-file']) < time() - 24 * 60 * 60) {
            $last_version = get_external_file('http://lehollandaisvolant.net/blogotext/version.php', 6);
            if (empty($last_version['body'])) {
                $last_version = $GLOBALS['version'];
            }
            // If failed, nevermind. We don't want to bother the user with that.
            file_put_contents($GLOBALS['last-online-file'], $last_version['body']);
            // touch file date
        }
        // Compare versions:
        $newestversion = file_get_contents($GLOBALS['last-online-file']);
        if (version_compare($newestversion, $GLOBALS['version']) == 1) {
            $fld_update = '<div role="group" class="pref">';
            $fld_update .= '<div class="form-legend">' . legend($GLOBALS['lang']['maint_chk_update'], 'legend-update') . '</div>' . "\n";
            $fld_update .= '<div class="form-lines">' . "\n";
            $fld_update .= '<p>' . "\n";
            $fld_update .= "\t" . '<label>' . $GLOBALS['lang']['maint_update_youisbad'] . ' (' . $newestversion . '). ' . $GLOBALS['lang']['maint_update_go_dl_it'] . '</label>' . "\n";
            $fld_update .= "\t" . '<a href="http://lehollandaisvolant.net/blogotext/">lehollandaisvolant.net/blogotext</a>.';
            $fld_update .= '</p>' . "\n";
            $fld_update .= '</div>' . "\n";
            $fld_update .= '</div>' . "\n";
            echo $fld_update;
        }
    }
    echo '<div class="submit-bttns">';
    echo hidden_input('_verif_envoi', '1');
    echo hidden_input('token', new_token());
    echo '<button class="submit white-square" type="button" onclick="annuler(\'preferences.php\');" >' . $GLOBALS['lang']['annuler'] . '</button>' . "\n";
    echo '<input class="submit blue-square" type="submit" name="enregistrer" value="' . $GLOBALS['lang']['enregistrer'] . '" />' . "\n";
    echo '</div>';
    echo '</form>';
}
Exemplo n.º 15
0
?>

<?php 
foreach ($profiles as $profile) {
    $optional_public_flag = array();
    if ($profile->is_edit_public_flag) {
        $value = isset($member_profile_public_flags[$profile->id]) ? $member_profile_public_flags[$profile->id] : $profile->default_public_flag;
        $optional_public_flag = array('name' => sprintf('member_profile_public_flag[%s]', $profile->id), 'value' => $value);
    }
    if ($profile->form_type == 'input') {
        ?>
	<?php 
        echo form_input($val, $profile->name, '', 7, $label_size, $profile->information, $optional_public_flag);
    } elseif ($profile->form_type == 'textarea') {
        ?>
	<?php 
        echo form_textarea($val, $profile->name, '', $label_size, true, $profile->information, $optional_public_flag);
    } elseif ($profile->form_type == 'select') {
        ?>
	<?php 
        echo form_select($val, $profile->name, 0, 7, $label_size, false, false, $profile->information, $optional_public_flag);
    } elseif ($profile->form_type == 'radio') {
        ?>
	<?php 
        echo form_radio($val, $profile->name, 0, $label_size, 'grid', $profile->information, $optional_public_flag);
    } elseif ($profile->form_type == 'checkbox') {
        ?>
	<?php 
        echo form_checkbox($val, $profile->name, array(), $label_size, 'grid', $profile->information, $optional_public_flag);
    }
}
Exemplo n.º 16
0
 public function viewSettingsAdmin()
 {
     global $aidlink;
     pageAccess('F');
     $forum_settings = $this->get_forum_settings();
     add_breadcrumb(array('link' => ADMIN . 'settings_forum.php' . $aidlink, 'title' => self::$locale['forum_settings']));
     if (isset($_POST['recount_user_post'])) {
         $result = dbquery("SELECT post_author, COUNT(post_id) as num_posts FROM " . DB_FORUM_POSTS . " GROUP BY post_author");
         if (dbrows($result)) {
             while ($data = dbarray($result)) {
                 $result2 = dbquery("UPDATE " . DB_USERS . " SET user_posts='" . $data['num_posts'] . "' WHERE user_id='" . $data['post_author'] . "'");
             }
             addNotice('success', self::$locale['forum_061']);
         }
     }
     if (isset($_POST['savesettings'])) {
         $numofthreads = form_sanitizer($_POST['numofthreads'], 20, 'numofthreads');
         $threads_num = form_sanitizer($_POST['threads_per_page'], 20, 'threads_per_page');
         $posts_num = form_sanitizer($_POST['posts_per_page'], 20, 'posts_per_page');
         $forum_ips = form_sanitizer($_POST['forum_ips'], -103, 'forum_ips');
         $attachmax = form_sanitizer($_POST['calc_b'], 1, 'calc_b') * form_sanitizer($_POST['calc_c'], 1000000, 'calc_c');
         $attachmax_count = form_sanitizer($_POST['forum_attachmax_count'], 5, 'forum_attachmax_count');
         $attachtypes = form_sanitizer($_POST['forum_attachtypes'], '.pdf,.gif,.jpg,.png,.zip,.rar,.tar,.bz2,.7z', 'forum_attachtypes');
         $thread_notify = form_sanitizer($_POST['thread_notify'], '0', 'thread_notify');
         $forum_ranks = form_sanitizer($_POST['forum_ranks'], '0', 'forum_ranks');
         $forum_rank_style = form_sanitizer($_POST['forum_rank_style'], '0', 'forum_rank_style');
         $forum_edit_lock = form_sanitizer($_POST['forum_edit_lock'], '0', 'forum_edit_lock');
         $forum_edit_timelimit = form_sanitizer($_POST['forum_edit_timelimit'], '0', 'forum_edit_timelimit');
         $popular_threads_timeframe = form_sanitizer($_POST['popular_threads_timeframe'], '604800', 'popular_threads_timeframe');
         $forum_last_posts_reply = form_sanitizer($_POST['forum_last_posts_reply'], '0', 'forum_last_posts_reply');
         $forum_last_post_avatar = form_sanitizer($_POST['forum_last_post_avatar'], '0', 'forum_last_post_avatar');
         $forum_editpost_to_lastpost = form_sanitizer($_POST['forum_editpost_to_lastpost'], '0', 'forum_editpost_to_lastpost');
         if (\defender::safe()) {
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$numofthreads}' WHERE settings_name='numofthreads' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$threads_num}' WHERE settings_name='threads_per_page' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$posts_num}' WHERE settings_name='posts_per_page'  AND settings_inf='forum'");
             //".(isnum($_POST['forum_ips']) ? $_POST['forum_ips'] : "103")."
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_ips}' WHERE settings_name='forum_ips' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$attachmax}' WHERE settings_name='forum_attachmax' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$attachmax_count}' WHERE settings_name='forum_attachmax_count' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$attachtypes}' WHERE settings_name='forum_attachtypes' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$thread_notify}' WHERE settings_name='thread_notify' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_ranks}' WHERE settings_name='forum_ranks' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_rank_style}' WHERE settings_name='forum_rank_style' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_edit_lock}' WHERE settings_name='forum_edit_lock' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_edit_timelimit}' WHERE settings_name='forum_edit_timelimit' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$popular_threads_timeframe}' WHERE settings_name='popular_threads_timeframe' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_last_posts_reply}' WHERE settings_name='forum_last_posts_reply' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_last_post_avatar}' WHERE settings_name='forum_last_post_avatar' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$forum_editpost_to_lastpost}' WHERE settings_name='forum_editpost_to_lastpost' AND settings_inf='forum'");
             addNotice('success', self::$locale['900']);
             redirect(FUSION_SELF . $aidlink . '&section=fs');
         }
     }
     $yes_no_array = array('1' => self::$locale['yes'], '0' => self::$locale['no']);
     echo "<div class='well'>" . self::$locale['forum_description'] . "</div>";
     echo openform('forum_settings_form', 'post', FUSION_REQUEST, array('class' => 'm-t-20'));
     echo "<div class='row'>\n";
     echo "<div class='col-xs-12 col-sm-8'>\n";
     openside('');
     echo "<span class='small pull-right'>* " . self::$locale['506'] . "</span><br/>\n";
     echo form_text('numofthreads', self::$locale['505'], $forum_settings['numofthreads'], array('error_text' => self::$locale['error_value'], 'inline' => 1, 'width' => '150px', 'type' => 'number'));
     closeside();
     openside('');
     echo form_text('threads_per_page', self::$locale['forum_080'], $forum_settings['threads_per_page'], array('error_text' => self::$locale['error_value'], 'inline' => 1, 'width' => '150px', 'type' => 'number'));
     echo form_text('posts_per_page', self::$locale['forum_081'], $forum_settings['posts_per_page'], array('error_text' => self::$locale['error_value'], 'inline' => 1, 'width' => '150px', 'type' => 'number'));
     closeside();
     openside('');
     echo form_select('thread_notify', self::$locale['512'], $forum_settings['thread_notify'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1));
     closeside();
     openside('');
     echo "<span class='pull-right position-absolute small' style='right:30px;'>" . self::$locale['537'] . "</span>\n";
     echo form_select('forum_edit_timelimit', self::$locale['536'], $forum_settings['forum_edit_timelimit'], array('options' => array('0', '10', '30', '45', '60'), 'max_length' => 2, 'width' => '100px', 'required' => 1, 'error_text' => self::$locale['error_value'], 'inline' => 1));
     echo form_select('forum_ips', self::$locale['507'], $forum_settings['forum_ips'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1));
     echo form_select('forum_ranks', self::$locale['520'], $forum_settings['forum_ranks'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1));
     echo form_select('forum_rank_style', self::$locale['forum_064'], $forum_settings['forum_rank_style'], array('options' => array(self::$locale['forum_063'], self::$locale['forum_062']), 'error_text' => self::$locale['error_value'], 'inline' => 1));
     echo form_select('forum_last_post_avatar', self::$locale['539'], $forum_settings['forum_last_post_avatar'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1));
     echo form_select('forum_edit_lock', self::$locale['521'], $forum_settings['forum_edit_lock'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1));
     echo form_select('forum_editpost_to_lastpost', self::$locale['538'], $forum_settings['forum_editpost_to_lastpost'], array('options' => $yes_no_array, 'error_text' => self::$locale['error_value'], 'inline' => 1));
     closeside();
     echo "</div>\n";
     echo "<div class='col-xs-12 col-sm-4'>\n";
     openside('');
     $calc_opts = array(1 => 'Bytes (bytes)', 1000 => 'KB (Kilobytes)', 1000000 => 'MB (Megabytes)');
     $calc_c = self::calculate_byte($forum_settings['forum_attachmax']);
     $calc_b = $forum_settings['forum_attachmax'] / $calc_c;
     require_once INCLUDES . "mimetypes_include.php";
     $mime = mimeTypes();
     $mime_opts = array();
     foreach ($mime as $m => $Mime) {
         $ext = ".{$m}";
         $mime_opts[$ext] = $ext;
     }
     sort($mime_opts);
     echo "<div class='clearfix'>\n";
     echo "<span class='pull-right small'>" . self::$locale['509'] . "</span>";
     echo "<label for='calc_c'>" . self::$locale['508'] . "</label><br />\n";
     echo form_text('calc_b', '', $calc_b, array('required' => 1, 'number' => 1, 'error_text' => self::$locale['error_rate'], 'width' => '100px', 'max_length' => '3', 'class' => 'm-r-10 pull-left'));
     echo form_select('calc_c', '', $calc_c, array('options' => $calc_opts, 'placeholder' => self::$locale['choose'], 'class' => 'pull-left', 'width' => '100%'));
     echo "</div>\n";
     echo "<div class='clearfix'>\n";
     echo "<span class='small pull-right'>" . self::$locale['535'] . "</span>\n";
     echo "<label for='attachmax_count'>" . self::$locale['534'] . "</label>\n";
     echo form_select('forum_attachmax_count', '', $forum_settings['forum_attachmax_count'], array('options' => range(1, 10), 'error_text' => self::$locale['error_value'], 'width' => '100%'));
     echo "</div>\n";
     echo "<div class='clearfix'>\n";
     echo "<span class='small pull-right'>" . self::$locale['511'] . "</span>\n";
     echo form_select('forum_attachtypes', self::$locale['510'], $forum_settings['forum_attachtypes'], array('options' => $mime_opts, 'width' => '100%', 'error_text' => self::$locale['error_type'], 'tags' => 1, 'multiple' => 1, 'placeholder' => self::$locale['choose']));
     echo "</div>\n";
     closeside();
     openside('');
     $timeframe_opts = array('604800' => self::$locale['527'], '2419200' => self::$locale['528'], '31557600' => self::$locale['529'], '0' => self::$locale['530']);
     $lastpost_opts = array('0' => self::$locale['519'], '1' => self::$locale['533']);
     for ($i = 2; $i <= 20; $i++) {
         $array_opts[$i] = sprintf(self::$locale['532'], $i);
     }
     if (isset($_GET['action']) && $_GET['action'] == "count_posts") {
         echo alert(self::$locale['524'], '', array('class' => 'warning'));
     }
     echo "<div class='clearfix'>\n";
     echo form_select('popular_threads_timeframe', self::$locale['525'], $forum_settings['popular_threads_timeframe'], array('options' => $timeframe_opts, 'error_text' => self::$locale['error_value'], 'width' => '100%'));
     echo "</div>\n";
     echo "<div class='clearfix'>\n";
     echo form_select('forum_last_posts_reply', self::$locale['531'], $forum_settings['forum_last_posts_reply'], array('options' => $lastpost_opts, 'error_text' => self::$locale['error_value'], 'width' => '100%'));
     echo "</div>\n";
     echo form_button('recount_user_post', self::$locale['523'], '1', array('class' => 'btn-primary btn-block'));
     closeside();
     echo "</div>\n";
     echo "</div>\n";
     echo form_button('savesettings', self::$locale['750'], self::$locale['750'], array('class' => 'btn-success'));
     echo closeform();
 }
Exemplo n.º 17
0
function admin_import()
{
    global $rooms_import;
    global $user;
    $html = "";
    $step = "input";
    if (isset($_REQUEST['step']) && in_array($step, ['input', 'check', 'import'])) {
        $step = $_REQUEST['step'];
    }
    if ($test_handle = fopen('../import/tmp', 'w')) {
        fclose($test_handle);
        unlink('../import/tmp');
    } else {
        error(_('Webserver has no write-permission on import directory.'));
    }
    $import_file = '../import/import_' . $user['UID'] . '.xml';
    $shifttype_id = null;
    $shifttypes_source = ShiftTypes();
    if ($shifttypes_source === false) {
        engelsystem_error('Unable to load shifttypes.');
    }
    $shifttypes = [];
    foreach ($shifttypes_source as $shifttype) {
        $shifttypes[$shifttype['id']] = $shifttype['name'];
    }
    switch ($step) {
        case 'input':
            $ok = false;
            if (isset($_REQUEST['submit'])) {
                $ok = true;
                if (isset($_REQUEST['shifttype_id']) && isset($shifttypes[$_REQUEST['shifttype_id']])) {
                    $shifttype_id = $_REQUEST['shifttype_id'];
                } else {
                    $ok = false;
                    error(_('Please select a shift type.'));
                }
                if (isset($_FILES['xcal_file']) && $_FILES['xcal_file']['error'] == 0) {
                    if (move_uploaded_file($_FILES['xcal_file']['tmp_name'], $import_file)) {
                        libxml_use_internal_errors(true);
                        if (simplexml_load_file($import_file) === false) {
                            $ok = false;
                            error(_('No valid xml/xcal file provided.'));
                            unlink($import_file);
                        }
                    } else {
                        $ok = false;
                        error(_('File upload went wrong.'));
                    }
                } else {
                    $ok = false;
                    error(_('Please provide some data.'));
                }
            }
            if ($ok) {
                redirect(page_link_to('admin_import') . "&step=check&shifttype_id=" . $shifttype_id);
            } else {
                $html .= div('well well-sm text-center', [_('File Upload') . mute(glyph('arrow-right')) . mute(_('Validation')) . mute(glyph('arrow-right')) . mute(_('Import'))]) . div('row', [div('col-md-offset-3 col-md-6', [form(array(form_info('', _("This import will create/update/delete rooms and shifts by given FRAB-export file. The needed file format is xcal.")), form_select('shifttype_id', _('Shifttype'), $shifttypes, $shifttype_id), form_file('xcal_file', _("xcal-File (.xcal)")), form_submit('submit', _("Import"))))])]);
            }
            break;
        case 'check':
            if (!file_exists($import_file)) {
                error(_('Missing import file.'));
                redirect(page_link_to('admin_import'));
            }
            if (isset($_REQUEST['shifttype_id']) && isset($shifttypes[$_REQUEST['shifttype_id']])) {
                $shifttype_id = $_REQUEST['shifttype_id'];
            } else {
                error(_('Please select a shift type.'));
                redirect(page_link_to('admin_import'));
            }
            list($rooms_new, $rooms_deleted) = prepare_rooms($import_file);
            list($events_new, $events_updated, $events_deleted) = prepare_events($import_file, $shifttype_id);
            $html .= div('well well-sm text-center', ['<span class="text-success">' . _('File Upload') . glyph('ok-circle') . '</span>' . mute(glyph('arrow-right')) . _('Validation') . mute(glyph('arrow-right')) . mute(_('Import'))]) . form([div('row', [div('col-sm-6', ['<h3>' . _("Rooms to create") . '</h3>', table(_("Name"), $rooms_new)]), div('col-sm-6', ['<h3>' . _("Rooms to delete") . '</h3>', table(_("Name"), $rooms_deleted)])]), '<h3>' . _("Shifts to create") . '</h3>', table(array('day' => _("Day"), 'start' => _("Start"), 'end' => _("End"), 'shifttype' => _('Shift type'), 'title' => _("Title"), 'room' => _("Room")), shifts_printable($events_new, $shifttypes)), '<h3>' . _("Shifts to update") . '</h3>', table(array('day' => _("Day"), 'start' => _("Start"), 'end' => _("End"), 'shifttype' => _('Shift type'), 'title' => _("Title"), 'room' => _("Room")), shifts_printable($events_updated, $shifttypes)), '<h3>' . _("Shifts to delete") . '</h3>', table(array('day' => _("Day"), 'start' => _("Start"), 'end' => _("End"), 'shifttype' => _('Shift type'), 'title' => _("Title"), 'room' => _("Room")), shifts_printable($events_deleted, $shifttypes)), form_submit('submit', _("Import"))], page_link_to('admin_import') . '&step=import&shifttype_id=' . $shifttype_id);
            break;
        case 'import':
            if (!file_exists($import_file)) {
                error(_('Missing import file.'));
                redirect(page_link_to('admin_import'));
            }
            if (!file_exists($import_file)) {
                redirect(page_link_to('admin_import'));
            }
            if (isset($_REQUEST['shifttype_id']) && isset($shifttypes[$_REQUEST['shifttype_id']])) {
                $shifttype_id = $_REQUEST['shifttype_id'];
            } else {
                error(_('Please select a shift type.'));
                redirect(page_link_to('admin_import'));
            }
            list($rooms_new, $rooms_deleted) = prepare_rooms($import_file);
            foreach ($rooms_new as $room) {
                $result = Room_create($room, true, true);
                if ($result === false) {
                    engelsystem_error('Unable to create room.');
                }
                $rooms_import[trim($room)] = sql_id();
            }
            foreach ($rooms_deleted as $room) {
                sql_query("DELETE FROM `Room` WHERE `Name`='" . sql_escape($room) . "' LIMIT 1");
            }
            list($events_new, $events_updated, $events_deleted) = prepare_events($import_file, $shifttype_id);
            foreach ($events_new as $event) {
                $result = Shift_create($event);
                if ($result === false) {
                    engelsystem_error('Unable to create shift.');
                }
            }
            foreach ($events_updated as $event) {
                $result = Shift_update_by_psid($event);
                if ($result === false) {
                    engelsystem_error('Unable to update shift.');
                }
            }
            foreach ($events_deleted as $event) {
                $result = Shift_delete_by_psid($event['PSID']);
                if ($result === false) {
                    engelsystem_error('Unable to delete shift.');
                }
            }
            engelsystem_log("Pentabarf import done");
            unlink($import_file);
            $html .= div('well well-sm text-center', ['<span class="text-success">' . _('File Upload') . glyph('ok-circle') . '</span>' . mute(glyph('arrow-right')) . '<span class="text-success">' . _('Validation') . glyph('ok-circle') . '</span>' . mute(glyph('arrow-right')) . '<span class="text-success">' . _('Import') . glyph('ok-circle') . '</span>']) . success(_("It's done!"), true);
            break;
        default:
            redirect(page_link_to('admin_import'));
    }
    return page_with_title(admin_import_title(), [msg(), $html]);
}
Exemplo n.º 18
0
echo "<td class='tbl' width='50%'><label for='pm_inbox'>" . $locale['701'] . "</label><br /><span class='small2'>" . $locale['704'] . "</span></td>\n";
echo "<td class='tbl' width='50%'>\n";
echo form_text('', 'pm_inbox', 'pm_inbox', $pm_inbox, array('max_length' => 4, 'width' => '100px'));
echo "</td>\n</tr>\n<tr>\n";
echo "<td class='tbl' width='50%'><label for='pm_sentbox'>" . $locale['702'] . "</label><br /><span class='small2'>" . $locale['704'] . "</span></td>\n";
echo "<td class='tbl' width='50%'>\n";
echo form_text('', 'pm_sentbox', 'pm_sentbox', $pm_sentbox, array('max_length' => 4, 'width' => '100px'));
echo "</td>\n</tr>\n<tr>\n";
echo "<td class='tbl' width='50%'><label for='pm_savebox'>" . $locale['703'] . "</label><br /><span class='small2'>" . $locale['704'] . "</span></td>\n";
echo "<td class='tbl' width='50%'>\n";
echo form_text('', 'pm_savebox', 'pm_savebox', $pm_savebox, array('max_length' => 4, 'width' => '100px'));
echo "</td>\n</tr>\n<tr>\n";
echo "<td class='tbl2' align='center' colspan='2'><strong>" . $locale['708'] . "</strong></td>\n";
echo "</tr>\n<tr>\n";
echo "<td class='tbl' width='50%'><label for='pm_email_notify'>" . $locale['709'] . "</label></td>\n";
echo "<td class='tbl' width='50%'>\n";
$opts = array('0' => $locale['519'], '1' => $locale['518']);
echo form_select('', 'pm_email_notify', 'pm_email_notify', $opts, $options['pm_email_notify']);
echo "</td>\n</tr>\n<tr>\n";
echo "<td class='tbl' width='50%'><label for='pm_save_sent'>" . $locale['710'] . "</label></td>\n";
echo "<td class='tbl' width='50%'>\n";
echo form_select('', 'pm_save_sent', 'pm_save_sent', $opts, $options['pm_save_sent']);
echo "</td>\n</tr>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl'><span class='small2'>" . $locale['711'] . "</span></td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl'><br />\n";
echo form_button($locale['750'], 'saveoptions', 'saveoptions', $locale['750'], array('class' => 'btn-primary'));
echo "</td>\n</tr>\n</tbody>\n</table>\n";
echo closeform();
closetable();
require_once THEMES . "templates/footer.php";
Exemplo n.º 19
0
function showModulesDropDown($module = "")
{
    $table = getModules();
    div_open();
    form_start_post();
    form_select("module");
    if ($table) {
        while ($row = nextResultInTable($table)) {
            if ($module == $row['module']) {
                form_option($row['module'], $row['module'], "true");
            } else {
                form_option($row['module'], $row['module']);
            }
        }
    } else {
        // no modules with settings available
        form_option("-", "");
    }
    form_select_end();
    // this module
    form_hidden("m_c", "showSettingsGUI");
    // button
    form_submit("submit", getString("settings_show_settings", "Vis innstillinger"));
    form_end();
    div_close();
}
Exemplo n.º 20
0
        }
        add_to_title($locale['global_200'] . $locale['news_0400']);
        echo "<div class='panel panel-default tbl-border'>\n<div class='panel-body'>\n";
        echo "<div class='alert alert-info m-b-20 submission-guidelines'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['news_0703']) . "</div>\n";
        echo openform('submit_form', 'post', BASEDIR . "submit.php?stype=n", array("enctype" => $news_settings['news_allow_submission_files'] ? TRUE : FALSE));
        echo form_text('news_subject', $locale['news_0200'], $criteriaArray['news_subject'], array("required" => TRUE, "inline" => TRUE));
        if (multilang_table("NS")) {
            echo form_select('news_language', $locale['global_ML100'], $criteriaArray['news_language'], array("options" => fusion_get_enabled_languages(), "placeholder" => $locale['choose'], "width" => "250px", "inline" => TRUE));
        } else {
            echo form_hidden('news_language', '', $criteriaArray['news_language']);
        }
        echo form_select('news_keywords', $locale['news_0205'], $criteriaArray['news_keywords'], array("max_length" => 320, "inline" => TRUE, "placeholder" => $locale['news_0205a'], "width" => "100%", "error_text" => $locale['news_0255'], "tags" => TRUE, "multiple" => TRUE));
        echo form_select_tree("news_cat", $locale['news_0201'], $criteriaArray['news_cat'], array("width" => "250px", "inline" => TRUE, "parent_value" => $locale['news_0202'], "query" => multilang_table("NS") ? "WHERE news_cat_language='" . LANGUAGE . "'" : ""), DB_NEWS_CATS, "news_cat_name", "news_cat_id", "news_cat_parent");
        if ($news_settings['news_allow_submission_files']) {
            $file_input_options = array('upload_path' => IMAGES_N, 'max_width' => $news_settings['news_photo_max_w'], 'max_height' => $news_settings['news_photo_max_h'], 'max_byte' => $news_settings['news_photo_max_b'], 'thumbnail' => 1, 'thumbnail_w' => $news_settings['news_thumb_w'], 'thumbnail_h' => $news_settings['news_thumb_h'], 'thumbnail_folder' => 'thumbs', 'delete_original' => 0, 'thumbnail2' => 1, 'thumbnail2_w' => $news_settings['news_photo_w'], 'thumbnail2_h' => $news_settings['news_photo_h'], 'type' => 'image', "inline" => TRUE);
            echo form_fileinput("news_image", $locale['news_0216'], "", $file_input_options);
            echo "<div class='small col-sm-offset-3 m-b-10'><span class='p-l-15'>" . sprintf($locale['news_0217'], parsebytesize($news_settings['news_photo_max_b'])) . "</span></div>\n";
            $alignOptions = array('pull-left' => $locale['left'], 'news-img-center' => $locale['center'], 'pull-right' => $locale['right']);
            echo form_select('news_ialign', $locale['news_0218'], $criteriaArray['news_ialign'], array("options" => $alignOptions, "inline" => TRUE));
        }
        echo form_textarea('news_news', $locale['news_0203'], $criteriaArray['news_snippet'], array("required" => TRUE, "html" => TRUE, "form_name" => "submit_form", "autosize" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE));
        echo form_textarea('news_body', $locale['news_0203b'], $criteriaArray['news_body'], array("required" => $news_settings['news_extended_required'] ? TRUE : FALSE, "html" => TRUE, "form_name" => "submit_form", "autosize" => fusion_get_settings("tinymce_enabled") ? FALSE : TRUE));
        echo fusion_get_settings("site_seo") ? "" : form_button('preview_news', $locale['news_0240'], $locale['news_0240'], array('class' => 'btn-primary m-r-10'));
        echo form_button('submit_news', $locale['news_0700'], $locale['news_0700'], array('class' => 'btn-primary'));
        echo closeform();
        echo "</div>\n</div>\n";
    }
} else {
    echo "<div class='well text-center'>" . $locale['news_0138'] . "</div>\n";
}
closetable();
Exemplo n.º 21
0
 /**
  *
  * @return string Return HTML string output for select tag
  */
 public function getHtml()
 {
     $input = form_select($this);
     return $input;
 }
Exemplo n.º 22
0
 echo "\t" . '<p><label for="json">' . $GLOBALS['lang']['bak_export_json'] . '</label>' . '<input type="radio" name="exp-format" value="json" id="json" onchange="switch_export_type(\'e_json\')" /></p>' . "\n";
 echo "\t" . '<p><label for="html">' . $GLOBALS['lang']['bak_export_netscape'] . '</label>' . '<input type="radio" name="exp-format" value="html" id="html" onchange="switch_export_type(\'e_html\')" /></p>' . "\n";
 echo "\t" . '<p><label for="zip">' . $GLOBALS['lang']['bak_export_zip'] . '</label>' . '<input type="radio" name="exp-format" value="zip"  id="zip"  onchange="switch_export_type(\'e_zip\')"  /></p>' . "\n";
 echo "\t" . '<p><label for="opml">' . $GLOBALS['lang']['bak_export_opml'] . '</label>' . '<input type="radio" name="exp-format" value="opml"  id="opml"  onchange="switch_export_type(\'e_opml\')"  /></p>' . "\n";
 echo '</fieldset>' . "\n";
 // export in JSON.
 echo '<fieldset id="e_json">';
 echo legend($GLOBALS['lang']['maintenance_incl_quoi'], 'legend-backup');
 echo "\t" . '<p>' . select_yes_no('incl-artic', 0, $GLOBALS['lang']['bak_articles_do']) . form_select_no_label('nb-artic', $nbs, 50) . '</p>' . "\n";
 echo "\t" . '<p>' . select_yes_no('incl-comms', 0, $GLOBALS['lang']['bak_comments_do']) . '</p>' . "\n";
 echo "\t" . '<p>' . select_yes_no('incl-links', 0, $GLOBALS['lang']['bak_links_do']) . form_select_no_label('nb-links', $nbs, 50) . '</p>' . "\n";
 echo '</fieldset>' . "\n";
 // export links in html
 echo '<fieldset id="e_html">' . "\n";
 echo legend($GLOBALS['lang']['bak_combien_linx'], 'legend-backup');
 echo "\t" . '<p>' . form_select('nb-links2', $nbs, 50, $GLOBALS['lang']['bak_combien_linx']) . '</p>' . "\n";
 echo '</fieldset>' . "\n";
 // export data in zip
 echo '<fieldset id="e_zip">';
 echo legend($GLOBALS['lang']['maintenance_incl_quoi'], 'legend-backup');
 if ($GLOBALS['sgdb'] == 'sqlite') {
     echo "\t" . '<p>' . select_yes_no('incl-sqlit', 0, $GLOBALS['lang']['bak_incl_sqlit']) . '</p>' . "\n";
 }
 echo "\t" . '<p>' . select_yes_no('incl-files', 0, $GLOBALS['lang']['bak_incl_files']) . '</p>' . "\n";
 echo "\t" . '<p>' . select_yes_no('incl-confi', 0, $GLOBALS['lang']['bak_incl_confi']) . '</p>' . "\n";
 echo "\t" . '<p>' . select_yes_no('incl-theme', 0, $GLOBALS['lang']['bak_incl_theme']) . '</p>' . "\n";
 echo '</fieldset>' . "\n";
 echo '<p class="submit-bttns">' . "\n";
 echo "\t" . '<button class="submit white-square" type="button" onclick="annuler(\'maintenance.php\');">' . $GLOBALS['lang']['annuler'] . '</button>' . "\n";
 echo "\t" . '<button class="submit blue-square" type="submit" name="do" value="export">' . $GLOBALS['lang']['valider'] . '</button>' . "\n";
 echo '</p>' . "\n";
Exemplo n.º 23
0
form_input_checkbox('Case insensitive', $challenge['case_insensitive']);
form_input_text('Points', $challenge['points']);
form_input_text('Num attempts allowed', $challenge['num_attempts_allowed']);
form_input_text('Min seconds between submissions', $challenge['min_seconds_between_submissions']);
$opts = db_query_fetch_all('SELECT * FROM categories ORDER BY title');
form_select($opts, 'Category', 'id', $challenge['category'], 'title');
$opts = db_query_fetch_all('
    SELECT
       ch.id,
       ch.title,
       ca.title AS category
    FROM challenges AS ch
    LEFT JOIN categories AS ca ON ca.id = ch.category
    ORDER BY ca.title, ch.title');
array_unshift($opts, array('id' => 0, 'title' => '-- User must solve selected challenge before revealing this one --'));
form_select($opts, 'Relies on', 'id', $challenge['relies_on'], 'title', 'category');
form_input_checkbox('Exposed', $challenge['exposed']);
form_input_text('Available from', date_time($challenge['available_from']));
form_input_text('Available until', date_time($challenge['available_until']));
form_hidden('action', 'edit');
form_hidden('id', $_GET['id']);
form_button_submit('Save changes');
form_end();
section_subhead('Files');
echo '
  <table id="files" class="table table-striped table-hover">
    <thead>
      <tr>
        <th>Filename</th>
        <th>Size</th>
        <th>Added</th>
Exemplo n.º 24
0
                if (!in_array($available_rewrite, $enabled_rewrites)) {
                    if (file_exists(INCLUDES . "rewrites/" . $available_rewrite . "_rewrite_info.php") && file_exists(LOCALE . LOCALESET . "permalinks/" . $available_rewrite . ".php")) {
                        include LOCALE . LOCALESET . "permalinks/" . $available_rewrite . ".php";
                        include INCLUDES . "rewrites/" . $available_rewrite . "_rewrite_info.php";
                        echo "<tr>\n";
                        echo "<td width='15%' style='white-space:nowrap'><strong>" . $permalink_name . "</strong></td>\n";
                        echo "<td style='white-space:nowrap'>" . $permalink_desc . "</td>\n";
                        echo "<td width='1%' style='white-space:nowrap'><a href='" . FUSION_SELF . $aidlink . "&amp;enable=" . $available_rewrite . "'>" . $locale['404a'] . "</td>\n";
                        echo "</tr>\n";
                    }
                }
            }
        }
        echo "</tbody>\n</table>\n";
        break;
    case "pls":
        echo openform('settingsseo', 'post', FUSION_SELF . $aidlink);
        echo "<div class='well m-t-20'><i class='fa fa-lg fa-exclamation-circle m-r-10'></i>" . $locale['seo_htc_warning'] . "</div>";
        echo "<div class='panel panel-default m-t-20'>\n<div class='panel-body'>\n";
        $opts = array('0' => $locale['disable'], '1' => $locale['enable']);
        echo form_select('site_seo', $locale['438'], $settings_seo['site_seo'], array("options" => $opts, 'inline' => 1));
        echo form_select('normalize_seo', $locale['439'], $settings_seo['normalize_seo'], array("options" => $opts, 'inline' => 1));
        echo form_select('debug_seo', $locale['440'], $settings_seo['debug_seo'], array("options" => $opts, 'inline' => 1));
        echo form_button('savesettings', $locale['750'], $locale['750'], array('class' => 'btn-primary', 'inline' => 1));
        echo "</div></div>\n";
        echo closeform();
        break;
}
echo closetab();
closetable();
require_once THEMES . "templates/footer.php";
Exemplo n.º 25
0
        $error = 1;
    }
    if ($error) {
        addNotice('danger', $locale['901']);
    } else {
        addNotice('success', $locale['900']);
    }
    redirect(FUSION_SELF . $aidlink);
}
opentable($locale['register_settings']);
echo openform('settingsform', 'post', FUSION_SELF . $aidlink, array('max_tokens' => 1));
$opts = array('1' => $locale['yes'], '0' => $locale['no']);
echo "<div class='well'>" . $locale['register_description'] . "</div>\n";
echo "<div class='row'>\n";
echo "<div class='col-xs-12 col-sm-8'>\n";
openside('');
echo form_select('enable_terms', $locale['558'], $settings2['enable_terms'], array("options" => $opts));
echo form_textarea('license_agreement', $locale['559'], $settings2['license_agreement'], array('form_name' => 'settingsform', 'input_id' => 'enable_license_agreement', 'autosize' => !$settings['tinymce_enabled'], 'html' => !$settings['tinymce_enabled']));
closeside();
echo "</div><div class='col-xs-12 col-sm-4'>\n";
openside('');
echo form_select('enable_registration', $locale['551'], $settings2['enable_registration'], array("options" => $opts));
echo form_select('email_verification', $locale['552'], $settings2['email_verification'], array("options" => $opts));
echo form_select('admin_activation', $locale['557'], $settings2['admin_activation'], array("options" => $opts));
echo form_select('display_validation', $locale['553'], $settings2['display_validation'], array("options" => $opts));
closeside();
echo "</div>\n</div>\n";
echo form_button('savesettings', $locale['750'], $locale['750'], array('class' => 'btn-success'));
echo closeform();
closetable();
require_once THEMES . "templates/footer.php";
Exemplo n.º 26
0
            opentable($criteriaArray['article_subject']);
            echo "<p class='text-bigger'>" . $criteriaArray['article_snippet'] . "</p>";
            echo $criteriaArray['article_article'];
            closetable();
        }
        add_to_title($locale['global_200'] . $locale['articles_0060']);
        echo "<div class='panel panel-default tbl-border'>\n<div class='panel-body'>\n";
        echo "<div class='alert alert-info m-b-20 submission-guidelines'>" . str_replace("[SITENAME]", fusion_get_settings("sitename"), $locale['articles_0063']) . "</div>\n";
        echo openform('submit_form', 'post', BASEDIR . "submit.php?stype=a");
        echo form_text('article_subject', $locale['articles_0304'], $criteriaArray['article_subject'], array("required" => TRUE, "inline" => TRUE));
        if (multilang_table("AR")) {
            echo form_select('article_language', $locale['global_ML100'], $criteriaArray['article_language'], array("options" => fusion_get_enabled_languages(), "placeholder" => $locale['choose'], "width" => "250px", "inline" => TRUE));
        } else {
            echo form_hidden('article_language', '', $criteriaArray['article_language']);
        }
        echo form_select('article_keywords', $locale['articles_0204'], $criteriaArray['article_keywords'], array("max_length" => 320, "inline" => TRUE, "placeholder" => $locale['articles_0204a'], "width" => "100%", "error_text" => $locale['articles_0204a'], "tags" => TRUE, "multiple" => TRUE));
        echo form_select_tree("article_cat", $locale['articles_0201'], $criteriaArray['article_cat'], array("width" => "250px", "inline" => TRUE, "no_root" => TRUE, "query" => multilang_table("AR") ? "WHERE article_cat_language='" . LANGUAGE . "'" : ""), DB_ARTICLE_CATS, "article_cat_name", "article_cat_id", "article_cat_parent");
        $textArea_opts = array("required" => TRUE, "type" => fusion_get_settings("tinymce_enabled") ? "tinymce" : "html", "tinymce" => fusion_get_settings("tinymce_enabled") && iADMIN ? "advanced" : "simple", "autosize" => TRUE, "form_name" => "submit_form");
        echo form_textarea('article_snippet', $locale['articles_0202'], $criteriaArray['article_snippet'], $textArea_opts);
        $textArea_opts['required'] = $article_settings['article_extended_required'] ? TRUE : FALSE;
        echo form_textarea('article_article', $locale['articles_0203'], $criteriaArray['article_article'], $textArea_opts);
        echo fusion_get_settings("site_seo") ? "" : form_button('preview_article', $locale['articles_0240'], $locale['articles_0240'], array('class' => 'btn-primary m-r-10'));
        echo form_button('submit_article', $locale['articles_0060'], $locale['articles_0060'], array('class' => 'btn-primary'));
        echo closeform();
        echo "</div>\n</div>\n";
    }
} else {
    echo "<div class='well text-center'>\n";
    if (!$cat_exist) {
        echo $locale['articles_0043a'];
    } else {
Exemplo n.º 27
0
    }
    echo '<td>' . bytestostring($file['size'][$i], 1) . '</td><td>' . $file['type'][$i] . '</td>' . '<td>';
    form_hidden_input('actionfile[' . $i . ']', $file['name'][$i]);
    switch ($actionnow) {
        case 'delete':
            echo '<input class="del" type="checkbox" name="deletefile[' . $i . ']" value="1" />';
            break;
        case 'rename':
            $ext = '.' . end(explode('.', $file['name'][$i]));
            form_hidden_input('renameext[' . $i . ']', $ext);
            form_text_input('renamefile[' . $i . ']', false, basename($file['name'][$i], $ext), 30, 120);
            echo $ext;
            break;
        case 'resize':
            form_text_input('resizefile[' . $i . ']', false, '', 4, 4);
            form_select($selectresize, 'resizetype[' . $i . ']', false, '', false);
            break;
        case 'rotate':
            echo '<img src="img/rotate_c.gif" alt="' . TB_ROTATECW . '" /><input class="rad" type="radio" name="rotatefile[' . $i . ']" value="clock"><img src="img/rotate_ac.gif" alt="' . TB_ROTATECCW . '" /><input class="rad" type="radio" name="rotatefile[' . $i . ']" value="anticlock">' . TB_NONE . '<input class="rad" type="radio" name="rotatefile[' . $i . ']" value="none" checked>';
            break;
        default:
            // do nothing
    }
    echo "</td></tr>\n";
}
echo "</table></div>\n" . '<div class="pushright">';
if ($tinybrowser['allowdelete']) {
    form_hidden_input('sortby', $sortbynow);
    form_hidden_input('sorttype', $sorttypenow);
    form_hidden_input('find', $findnow);
    form_hidden_input('showpage', $showpagenow);
Exemplo n.º 28
0
    return 1000000;
}
$calc_opts = array(1 => 'Bytes (bytes)', 1000 => 'KB (Kilobytes)', 1000000 => 'MB (Megabytes)');
$calc_c = calculate_byte($settings['avatar_filesize']);
$calc_b = $settings['avatar_filesize'] / $calc_c;
echo form_text('', 'calc_b', 'calc_b', $calc_b, array('required' => 1, 'number' => 1, 'error_text' => $locale['error_rate'], 'width' => '100px', 'max_length' => '3', 'class' => 'pull-left m-r-10'));
echo form_select('', 'calc_c', 'calc_c', $calc_opts, $calc_c, array('placeholder' => $locale['choose'], 'class' => 'pull-left', 'width' => '180px'));
echo "</td>\n</tr>\n<tr>\n";
echo "<td  class='tbl'>\n<label for='avatar_ratio'>" . $locale['1001'] . "</label></td>\n";
echo "<td  class='tbl'>\n";
$ratio_opts = array('0' => $locale['955'], '1' => $locale['956']);
echo form_select('', 'avatar_ratio', 'avatar_ratio', $ratio_opts, $settings['avatar_ratio']);
echo "</td>\n</tr>\n<tr>\n";
echo "<td  class='tbl'>\n<label for='userNameChange'>" . $locale['691'] . "?</label></td>\n";
echo "<td  class='tbl'>\n";
echo form_select('', 'userNameChange', 'userNameChange', $yes_no_array, $settings['userNameChange']);
echo "</td>\n</tr>\n<tr>\n";
echo "<td  class='tbl'>\n<label for='userthemes'>" . $locale['668'] . "?</label></td>\n";
echo "<td  class='tbl'>\n";
echo form_select('', 'userthemes', 'userthemes', $yes_no_array, $settings['userthemes']);
echo "</td>\n</tr>\n<tr>\n";
echo "<td  class='tbl'>\n<label for='multiple_logins'>" . $locale['1014'] . "</label>\n<br /><span class='small2'>(" . $locale['1014a'] . ")</span></td>\n";
echo "<td  class='tbl'>\n";
echo form_select('', 'multiple_logins', 'multiple_logins', $yes_no_array, $settings['multiple_logins']);
echo "</td>\n</tr>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl'><br />\n";
echo form_button($locale['750'], 'savesettings', 'savesettings', $locale['750'], array('class' => 'btn-primary'));
echo "</td>\n</tr>\n</tbody>\n</table>\n";
echo closeform();
closetable();
require_once THEMES . "templates/footer.php";
Exemplo n.º 29
0
         $breaks = " checked='checked'";
         $comments = " checked='checked'";
         $ratings = " checked='checked'";
     }
     opentable($locale['400']);
 }
 $result = dbquery("SELECT article_cat_id, article_cat_name FROM " . DB_ARTICLE_CATS . " ORDER BY article_cat_name DESC");
 $catlist = array();
 while ($data = dbarray($result)) {
     $catlist[$data['article_cat_id']] = $data['article_cat_name'];
 }
 echo openform('input_form', 'input_form', 'post', FUSION_SELF . $aidlink, array('downtime' => 0));
 echo "<table cellpadding='0' cellspacing='0' class='table table-responsive center'>\n<tr>\n";
 echo "<td width='100' class='tbl'><label for='article_cat'>" . $locale['422'] . "</label></td>\n";
 echo "<td class='tbl'>\n";
 echo form_select('', 'article_cat', 'article_cat', $catlist, $article_cat, array('placeholder' => $locale['choose']));
 echo "</td>\n</tr>\n<tr>\n";
 echo "<td width='100' class='tbl'><label for='subject'>" . $locale['423'] . " <span class='required'>*</span></label></td>\n";
 echo "<td class='tbl'>\n";
 echo form_text('', 'subject', 'subject', $subject, array('required' => 1));
 echo "</td>\n";
 echo "</tr>\n<tr>\n";
 echo "<td valign='top' width='100' class='tbl'><label for='body'>" . $locale['424'] . "</label></td>\n";
 echo "<td class='tbl'>\n";
 echo form_textarea('', 'body', 'body', $body);
 echo "</td>\n";
 echo "</tr>\n";
 if ($settings['tinymce_enabled'] != 1) {
     echo "<tr>\n<td class='tbl'></td>\n<td class='tbl'>\n";
     echo display_html("input_form", "body", true, true, true, IMAGES_A);
     echo "</td>\n</tr>\n";
Exemplo n.º 30
0
    $select[] = array('create', TB_CREATE);
}
if ($tinybrowser['allowdelete']) {
    $select[] = array('delete', TB_DELETE);
}
if ($tinybrowser['allowedit']) {
    $select[] = array('rename', TB_RENAME);
}
form_select($select, 'editaction', TB_ACTION, $actionnow, true);
?>
</form></div><?php 
form_open('actionform', 'custom', 'folders.php', '?type=' . $typenow . $passfolder . $passfeid);
if ($actionnow == 'move') {
    ?>
<div class="pushleft"><?php 
    form_select($editdirs, 'destination', TB_FOLDERDEST, urlencode($foldernow), false);
    ?>
</div><?php 
}
switch ($actionnow) {
    case 'delete':
        $actionhead = TB_DELETE;
        break;
    case 'rename':
        $actionhead = TB_RENAME;
        break;
    case 'create':
        $actionhead = TB_CREATE;
        break;
    default:
        // do nothing