Exemplo n.º 1
0
                <th style="width: 37%;">' . $gL10n->get('SYS_CONTENT') . '</th>
                <th style="width: 18%;">' . $gL10n->get('SYS_ORDER') . '</th>
                <th style="width: 25%;">' . $gL10n->get('SYS_CONDITION') . '
                    <a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal"
                        href="' . $g_root_path . '/adm_program/system/msg_window.php?message_id=mylist_condition&amp;inline=true">
                        <img src="' . THEME_PATH . '/icons/help.png" alt="Help" />
                    </a>
                </th>
            </tr>
        </thead>
        <tbody id="mylist_fields_tbody">
        </tbody>
    </table>
    </div>');
$form->openButtonGroup();
$form->addButton('btn_add_column', $gL10n->get('LST_ADD_COLUMN'), array('icon' => THEME_PATH . '/icons/add.png'));
if ($getListId > 0 && $list->getValue('lst_name') !== '') {
    $form->addButton('btn_save_changes', $gL10n->get('LST_SAVE_CHANGES'), array('icon' => THEME_PATH . '/icons/disk.png'));
} else {
    $form->addButton('btn_save', $gL10n->get('LST_SAVE_CONFIGURATION'), array('icon' => THEME_PATH . '/icons/disk.png'));
}
// your lists could be deleted, webmasters are allowed to delete system configurations
if ($gCurrentUser->isWebmaster() && $list->getValue('lst_global') == 1 || $gCurrentUser->getValue('usr_id') == $list->getValue('lst_usr_id') && strlen($list->getValue('lst_name')) > 0) {
    $form->addButton('btn_delete', $gL10n->get('LST_DELETE_CONFIGURATION'), array('icon' => THEME_PATH . '/icons/delete.png'));
}
// current configuration can be duplicated and saved with another name
if (strlen($list->getValue('lst_name')) > 0) {
    $form->addButton('btn_copy', $gL10n->get('SYS_COPY_VAR', $gL10n->get('LST_CONFIGURATION')), array('icon' => THEME_PATH . '/icons/application_double.png'));
}
$form->closeButtonGroup();
$form->closeGroupBox();
Exemplo n.º 2
0
        // Foto aus PHP-Temp-Ordner einlesen
        $user_image_data = fread(fopen($_FILES['userfile']['tmp_name'][0], 'r'), $_FILES['userfile']['size'][0]);
        // Zwischenspeichern des neuen Fotos in der Session
        $gCurrentSession->setValue('ses_binary', $user_image_data);
        $gCurrentSession->save();
    }
    //Image-Objekt löschen
    $user_image->delete();
    if ($getItemId == $gCurrentUser->getValue('inv_id')) {
        $headline = $gL10n->get('PRO_EDIT_MY_PROFILE_PICTURE');
    } else {
        $headline = $gL10n->get('PRO_EDIT_PROFILE_PIC_FROM', $inventory->getValue('FIRST_NAME'), $inventory->getValue('LAST_NAME'));
    }
    // create html page object
    $page = new HtmlPage($headline);
    $page->addJavascript('$("#btn_cancel").click(function() {
        self.location.href=\'' . $g_root_path . '/adm_program/modules/inventory/item_photo_edit.php?mode=dont_save&inv_id=' . $getItemId . '\';
    });', true);
    // show form
    $form = new HtmlForm('show_new_profile_picture_form', $g_root_path . '/adm_program/modules/inventory/item_photo_edit.php?mode=save&amp;inv_id=' . $getItemId, $page);
    $form->addCustomContent($gL10n->get('PRO_CURRENT_PICTURE'), '<img class="imageFrame" src="item_photo_show.php?inv_id=' . $getItemId . '" alt="' . $gL10n->get('PRO_CURRENT_PICTURE') . '" />');
    $form->addCustomContent($gL10n->get('PRO_NEW_PICTURE'), '<img class="imageFrame" src="item_photo_show.php?inv_id=' . $getItemId . '&new_photo=1" alt="' . $gL10n->get('PRO_NEW_PICTURE') . '" />');
    $form->addLine();
    $form->openButtonGroup();
    $form->addButton('btn_cancel', $gL10n->get('SYS_ABORT'), array('icon' => THEME_PATH . '/icons/error.png'));
    $form->addSubmitButton('btn_update', $gL10n->get('SYS_APPLY'), array('icon' => THEME_PATH . '/icons/database_in.png'));
    $form->closeButtonGroup();
    // add form to html page and show page
    $page->addHtml($form->show(false));
    $page->show();
}
Exemplo n.º 3
0
$page->addInline('p', 'Mit diesem Werkzeug lassen sich Unterschiede zwischen den lokalen Auszeichnungsvorlagen und den Daten auf Wikidata feststellen.');
$page->addInline('h2', 'Optionen');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('mode', 'Kategorie');
$optionForm->addHTML('</td><td>');
$optionForm->addHTML('<select id="mode" name="mode">');
$optionForm->addHTML('<option value="lesenswert">lesenswerte Artikel</option>');
$optionForm->addHTML('<option value="exzellent">exzellente Artikel</option>');
$optionForm->addHTML('<option value="informativ">informative Listen</option>');
$optionForm->addHTML('<option value="portal">informatives Portal</option>');
$optionForm->addHTML('</select>');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td colspan="2">');
$optionForm->addButton('submit', 'Abgleichen');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('</table>');
$optionForm->output();
$page->closeBlock();
if ($rq->allRequiredDefined() == true) {
    $page->openBlock('div', 'iw-content');
    $page->addInline('h2', 'Ergebnisse');
    $db->replicaConnect(Database::getName('de', 'wikipedia'));
    $t1 = 'SELECT page_title FROM page, page_props';
    switch ($par['mode']) {
        case 'lesenswert':
            $t1 .= ' WHERE pp_propname = \'wikibase-badge-Q17437798\' AND pp_page = page_id AND page_namespace = 0';
            break;
        case 'exzellent':
            $t1 .= ' WHERE pp_propname = \'wikibase-badge-Q17437796\' AND pp_page = page_id AND page_namespace = 0';
Exemplo n.º 4
0
         LEFT JOIN ' . TBL_USER_DATA . ' as last_name
                ON last_name.usd_usr_id = usr_id
               AND last_name.usd_usf_id = ' . $gProfileFields->getProperty('LAST_NAME', 'usf_id') . '
         LEFT JOIN ' . TBL_USER_DATA . ' as first_name
                ON first_name.usd_usr_id = usr_id
               AND first_name.usd_usf_id = ' . $gProfileFields->getProperty('FIRST_NAME', 'usf_id') . '
             WHERE usr_valid  = 1
               AND mem_begin <= \'' . DATE_NOW . '\'
               AND mem_end    > \'' . DATE_NOW . '\'
               AND mem_rol_id IN (' . implode(',', $arrayUniqueRoles) . ')
          GROUP BY usr_id, first_name.usd_value, last_name.usd_value, email.usd_value
          ORDER BY first_name, last_name';
$statement = $gDb->query($sql);
while ($row = $statement->fetch()) {
    $list[] = array($row['usr_id'], $row['first_name'] . ' ' . $row['last_name'] . ' (' . $row['email'] . ')', $gL10n->get('SYS_MEMBERS'));
}
$form->addSelectBox('ecard_recipients', $gL10n->get('SYS_TO'), $list, array('property' => FIELD_REQUIRED, 'defaultValue' => $recipients, 'multiselect' => true));
$form->addLine();
$form->addInput('name_from', $gL10n->get('MAI_YOUR_NAME'), $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME'), array('maxLength' => 50, 'property' => FIELD_DISABLED));
$form->addInput('mail_from', $gL10n->get('MAI_YOUR_EMAIL'), $gCurrentUser->getValue('EMAIL'), array('maxLength' => 50, 'property' => FIELD_DISABLED));
$form->closeGroupBox();
$form->openGroupBox('gb_message', $gL10n->get('SYS_MESSAGE'), 'admidio-panel-editor');
$form->addEditor('ecard_message', null, $message, array('property' => FIELD_REQUIRED, 'toolbar' => 'AdmidioGuestbook'));
$form->closeGroupBox();
$form->openButtonGroup();
$form->addButton('btn_ecard_preview', $gL10n->get('SYS_PREVIEW'), array('icon' => THEME_PATH . '/icons/eye.png'));
$form->addSubmitButton('btn_ecard_submit', $gL10n->get('SYS_SEND'), array('icon' => THEME_PATH . '/icons/email.png'));
$form->closeButtonGroup();
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
Exemplo n.º 5
0
$page->addInline('p', 'This tool shows a list of categories that redirect to another category in the given project and the number of entries in it.');
$page->addInline('h2', 'Options');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('lang', 'Language');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('lang', $par['lang'], 'Language code of the project, e.g. de', 7, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('project', 'Project');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('project', $par['project'], 'Project code, e.g wikipedia', 20, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td colspan="2">');
$optionForm->addButton('submit', 'View categories');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('</table>');
$optionForm->output();
$page->closeBlock();
if ($rq->allRequiredDefined() == true) {
    $page->openBlock('div', 'iw-content');
    $page->addInline('h2', 'Results');
    $db->replicaConnect(Database::getName($par['lang'], $par['project']));
    $t1 = 'SELECT page.page_title, page.page_len, count(categorylinks.cl_from) AS cl ';
    $t1 .= 'FROM page LEFT JOIN categorylinks ON page.page_title = categorylinks.cl_to ';
    $t1 .= 'WHERE page.page_namespace = 14 AND page.page_is_redirect = 1 GROUP BY page.page_title ';
    if ($par['sort'] == 'name') {
        $t1 .= 'ORDER BY page.page_title;';
    } elseif ($par['sort'] == 'length') {
        $t1 .= 'ORDER BY page.page_len DESC;';
Exemplo n.º 6
0
$page->addInline('p', 'This tool generates a list of DEFAULTSORT keys that match the page title exactly.');
$page->addInline('h2', 'Options');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('lang', 'Language');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('lang', $par['lang'], 'Language code of the project, e.g. de', 7, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('project', 'Project');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('project', $par['project'], 'Project code, e.g wikipedia', 20, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td colspan="2">');
$optionForm->addButton('submit', 'View useless defaultsorts');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('</table>');
$optionForm->output();
$page->closeBlock();
if ($rq->allRequiredDefined() == true) {
    $page->openBlock('div', 'iw-content');
    $page->addInline('h2', 'Results');
    $db->replicaConnect(Database::getName($par['lang'], $par['project']));
    $t1 = 'SELECT page_title, page_namespace, pp_value FROM page, page_props';
    $t1 .= ' WHERE pp_propname = \'defaultsort\' AND pp_page = page_id AND REPLACE(page_title, \'_\', \' \') = pp_value';
    $t1 .= ' ORDER BY page_namespace, page_title;';
    $q1 = $db->query($t1);
    if ($q1->num_rows === 0) {
        $page->addInline('p', 'there were no results for this query', 'iw-info');
    } else {
Exemplo n.º 7
0
$optionForm->addLabel('page', 'Page title');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('page', $par['page'], 'A page title in the main namespace (0)', 0, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('since', 'Revisions since');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('since', $par['since'], '(Format: YYYY-MM-DD)');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('until', 'Revisions until');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('until', $par['until'], '(Format: YYYY-MM-DD)');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td colspan="2">');
$optionForm->addButton('submit', 'Get revisions');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('</table>');
$optionForm->output();
$page->closeBlock();
if ($rq->allRequiredDefined() == true) {
    $page->openBlock('div', 'iw-content');
    $page->addInline('h2', 'Results');
    $db->replicaConnect(Database::getName($par['lang'], $par['project']));
    $par['page'] = str_replace(' ', '_', $par['page']);
    $par['page'] = $db->real_escape_string($par['page']);
    $t1 = 'SELECT revision_userindex.rev_timestamp, revision_userindex.rev_user_text, revision_userindex.rev_comment, revision_userindex.rev_id FROM revision_userindex, page WHERE page.page_title = \'' . $par['page'] . '\' ';
    $t1 .= 'AND page.page_namespace = 0 AND revision_userindex.rev_page = page.page_id ';
    $t1 .= 'ORDER BY revision_userindex.rev_timestamp DESC;';
    $q1 = $db->query($t1);
    if ($q1->num_rows === 0) {
/**
 * @param string $htmlListId
 * @param object $user
 * @param object $roleStatement
 * @param        $count_role
 * @param bool   $directOutput
 * @return string
 */
function getRoleMemberships($htmlListId, $user, $roleStatement, $count_role, $directOutput)
{
    global $gDb, $gL10n, $gCurrentUser, $gPreferences, $g_root_path, $gProfileFields;
    $countShowRoles = 0;
    $member = new TableMembers($gDb);
    $role = new TableRoles($gDb);
    $roleMemHTML = '<ul class="list-group admidio-list-roles-assign" id="' . $htmlListId . '">';
    while ($row = $roleStatement->fetch()) {
        if ($gCurrentUser->hasRightViewRole($row['mem_rol_id']) && $row['rol_visible'] == 1) {
            $formerMembership = false;
            $futureMembership = false;
            $showRoleEndDate = false;
            $deleteMode = 'pro_role';
            $member->clear();
            $member->setArray($row);
            $role->clear();
            $role->setArray($row);
            // if membership will not end, then don't show end date
            if (strcmp($member->getValue('mem_end', 'Y-m-d'), '9999-12-31') !== 0) {
                $showRoleEndDate = true;
            }
            // check if membership ends in the past
            if (strcmp(DATE_NOW, $member->getValue('mem_end', 'Y-m-d')) > 0) {
                $formerMembership = true;
                $deleteMode = 'pro_former';
            }
            // check if membership starts in the future
            if (strcmp($member->getValue('mem_begin', 'Y-m-d'), DATE_NOW) > 0) {
                $futureMembership = true;
                $deleteMode = 'pro_future';
            }
            // create list entry for one role
            $roleMemHTML .= '
            <li class="list-group-item" id="role_' . $row['mem_rol_id'] . '">
                <ul class="list-group admidio-list-roles-assign-pos">
                    <li class="list-group-item">
                        <span>' . $role->getValue('cat_name') . ' - ';
            if ($gCurrentUser->hasRightViewRole($member->getValue('mem_rol_id'))) {
                $roleMemHTML .= '<a href="' . $g_root_path . '/adm_program/modules/lists/lists_show.php?mode=html&amp;rol_ids=' . $member->getValue('mem_rol_id') . '" title="' . $role->getValue('rol_description') . '">' . $role->getValue('rol_name') . '</a>';
            } else {
                echo $role->getValue('rol_name');
            }
            if ($member->getValue('mem_leader') == 1) {
                $roleMemHTML .= ' - ' . $gL10n->get('SYS_LEADER');
            }
            $roleMemHTML .= '&nbsp;
                        </span>
                        <span class="pull-right text-right">';
            if ($showRoleEndDate) {
                $roleMemHTML .= $gL10n->get('SYS_SINCE_TO', $member->getValue('mem_begin', $gPreferences['system_date']), $member->getValue('mem_end', $gPreferences['system_date']));
            } elseif ($futureMembership) {
                $roleMemHTML .= $gL10n->get('SYS_FROM', $member->getValue('mem_begin', $gPreferences['system_date']));
            } else {
                $roleMemHTML .= $gL10n->get('SYS_SINCE', $member->getValue('mem_begin', $gPreferences['system_date']));
            }
            if ($role->allowedToAssignMembers($gCurrentUser)) {
                // You are not allowed to delete your own webmaster membership, other roles could be deleted
                // @ptabaden: Changed icon
                if ($role->getValue('rol_webmaster') == 1 && $gCurrentUser->getValue('usr_id') != $user->getValue('usr_id') || $role->getValue('rol_webmaster') == 0) {
                    $roleMemHTML .= '
                                    <a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal"
                                        href="' . $g_root_path . '/adm_program/system/popup_message.php?type=' . $deleteMode . '&amp;element_id=role_' . $role->getValue('rol_id') . '&amp;database_id=' . $member->getValue('mem_id') . '&amp;name=' . urlencode($role->getValue('rol_name')) . '"><i class="fa fa-times" alt="' . $gL10n->get('PRO_CANCEL_MEMBERSHIP') . '" title="' . $gL10n->get('PRO_CANCEL_MEMBERSHIP') . '"></i></a>';
                } else {
                    $roleMemHTML .= '
                                    <a class="admidio-icon-link"><img src="' . THEME_PATH . '/icons/dummy.png" alt=""/></a>';
                }
                // do not edit webmaster role
                // @ptabaden: Changed icon
                if ($row['rol_webmaster'] == 0) {
                    $roleMemHTML .= '<a class="admidio-icon-link" style="cursor:pointer;" onclick="profileJS.toggleDetailsOn(' . $member->getValue('mem_id') . ')"><i class="fa fa-pencil" alt="' . $gL10n->get('PRO_CHANGE_DATE') . '" title="' . $gL10n->get('PRO_CHANGE_DATE') . '"></i></a>';
                } else {
                    $roleMemHTML .= '<a class="admidio-icon-link"><img src="' . THEME_PATH . '/icons/dummy.png" alt=""/></a>';
                }
            }
            // only show info if system setting is activated
            // @ptabaden: Changed icon
            if ($gPreferences['system_show_create_edit'] > 0) {
                $roleMemHTML .= '<a class="admidio-icon-link admMemberInfo" id="member_info_' . $member->getValue('mem_id') . '" href="javascript:"><i class="fa fa-info" alt="' . $gL10n->get('SYS_INFORMATIONS') . '" title="' . $gL10n->get('SYS_INFORMATIONS') . '"></i></a>';
            }
            $roleMemHTML .= '</span>
                    </li>
                    <li class="list-group-item" id="membership_period_' . $member->getValue('mem_id') . '" style="visibility: hidden; display: none;"><div class="collapse navbar-collapse">';
            $form = new HtmlForm('membership_period_form_' . $member->getValue('mem_id'), $g_root_path . '/adm_program/modules/profile/profile_function.php?mode=7&amp;user_id=' . $user->getValue('usr_id') . '&amp;mem_id=' . $row['mem_id'], null, array('type' => 'navbar', 'setFocus' => false, 'class' => 'admidio-form-membership-period'));
            $form->addInput('membership_start_date_' . $member->getValue('mem_id'), $gL10n->get('SYS_START'), $member->getValue('mem_begin', $gPreferences['system_date']), array('type' => 'date', 'maxLength' => 10));
            $form->addInput('membership_end_date_' . $member->getValue('mem_id'), $gL10n->get('SYS_END'), $member->getValue('mem_end', $gPreferences['system_date']), array('type' => 'date', 'maxLength' => 10));
            $form->addButton('btn_send_' . $member->getValue('mem_id'), $gL10n->get('SYS_OK'), array('class' => 'button-membership-period-form', 'data-admidio' => $member->getValue('mem_id')));
            $roleMemHTML .= $form->show(false);
            $roleMemHTML .= '</div></li>
                    <li class="list-group-item" id="member_info_' . $member->getValue('mem_id') . '_Content" style="display: none;">';
            // show information about user who creates the recordset and changed it
            $roleMemHTML .= admFuncShowCreateChangeInfoById($member->getValue('mem_usr_id_create'), $member->getValue('mem_timestamp_create'), $member->getValue('mem_usr_id_change'), $member->getValue('mem_timestamp_change')) . '
                    </li>
                </ul>
            </li>';
            ++$countShowRoles;
        }
    }
    if ($countShowRoles === 0) {
        $roleMemHTML = '<div class="block-padding">' . $gL10n->get('PRO_NO_ROLES_VISIBLE') . '</div>';
    } else {
        $roleMemHTML .= '</ul>';
    }
    if ($directOutput) {
        echo $roleMemHTML;
        return '';
    } else {
        return $roleMemHTML;
    }
}
Exemplo n.º 9
0
$page->addInline('p', 'This tool generates a list of bots in a given project with their total editcount and registration date.');
$page->addInline('h2', 'Options');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('lang', 'Language');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('lang', $par['lang'], 'Language code of the project, e.g. de', 7, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('project', 'Project');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('project', $par['project'], 'Project code, e.g wikipedia', 20, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td colspan="2">');
$optionForm->addButton('submit', 'View statistics');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('</table>');
$optionForm->output();
$page->closeBlock();
if ($rq->allRequiredDefined() == true) {
    $page->openBlock('div', 'iw-content');
    $page->addInline('h2', 'Results');
    $db->replicaConnect(Database::getName($par['lang'], $par['project']));
    $t1 = 'SELECT DISTINCT user_id, user_name, user_registration, user_editcount FROM user, user_groups';
    $t1 .= ' WHERE ug_group = \'bot\' AND ug_user = user_id';
    $t1 .= ' ORDER BY ';
    switch ($par['sort']) {
        case 'name':
            $t1 .= 'user_name ';
            break;
Exemplo n.º 10
0
$optionForm->addHTML('</td><td>');
$optionForm->addInput('project', $par['project'], 'Project code, e.g wikipedia', 20, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('mode', 'Mode');
$optionForm->addHTML('</td><td>');
$optionForm->addHTML('<select id="mode" name="mode">');
$optionForm->addHTML('<option value="ns0-noindex">NOINDEX in main namespace</option>');
$optionForm->addHTML('<option value="ns0-index">INDEX in main namespace</option>');
$optionForm->addHTML('<option value="ns0-noeditsection">NOEDITSECTION in main namespace</option>');
$optionForm->addHTML('<option value="ns0-newsectionlink">NEWSECTIONLINK in main namespace</option>');
$optionForm->addHTML('<option value="staticredirect">STATICREDIRECT on non-redirect pages</option>');
$optionForm->addHTML('</select>');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td colspan="2">');
$optionForm->addButton('submit', 'View list');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('</table>');
$optionForm->output();
$page->closeBlock();
if ($rq->allRequiredDefined() == true) {
    $page->openBlock('div', 'iw-content');
    $page->addInline('h2', 'Results');
    $db->replicaConnect(Database::getName($par['lang'], $par['project']));
    $t1 = 'SELECT page_title, page_namespace, pp_value FROM page, page_props';
    switch ($par['mode']) {
        case 'ns0-noindex':
            $t1 .= ' WHERE pp_propname = \'noindex\' AND pp_page = page_id AND page_namespace = 0';
            break;
        case 'ns0-index':
            $t1 .= ' WHERE pp_propname = \'index\' AND pp_page = page_id AND page_namespace = 0';
Exemplo n.º 11
0
$page->closeBlock();
$page->addInline('h2', 'Options');
$optionForm = new HtmlForm('index.php', 'GET');
$optionForm->addHTML('<table class="iw-nostyle">');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('lang', 'Language');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('lang', $par['lang'], 'Language code of the project, e.g. de', 7, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td>');
$optionForm->addLabel('project', 'Project');
$optionForm->addHTML('</td><td>');
$optionForm->addInput('project', $par['project'], 'Project code, e.g wikipedia', 20, true);
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('<tr><td colspan="2">');
$optionForm->addButton('submit', 'View useless protections');
$optionForm->addHTML('</td></tr>');
$optionForm->addHTML('</table>');
$optionForm->output();
$page->closeBlock();
if ($rq->allRequiredDefined() == true) {
    $page->openBlock('div', 'iw-content');
    $page->addInline('h2', 'Results');
    $db->replicaConnect(Database::getName($par['lang'], $par['project']));
    $t1 = 'SELECT page_title, page_namespace FROM page, page_restrictions WHERE pr_page = page_id AND pr_type = \'move\' AND pr_level = \'autoconfirmed\'';
    $t1 .= ' AND page_id NOT IN (SELECT page_id FROM page, page_restrictions WHERE pr_page = page_id AND pr_type = \'edit\')';
    $t1 .= ' ORDER BY page_namespace, page_title;';
    $q1 = $db->query($t1);
    if ($q1->num_rows === 0) {
        $page->addInline('p', 'there were no results for this query', 'iw-info');
    } else {