Ejemplo n.º 1
0
$page = new HtmlPage('Useless defaultsorts');
// create new database object
$db = new Database();
// create new request validator
$rq = new RequestValidator();
// get parameters
$rq->addAllowed('GET', 'lang', '', '/^[a-z]{1,7}$/', true);
$rq->addAllowed('GET', 'project', '', '/^[a-z]{1,15}$/', true);
$par = $rq->getParams();
$page->openBlock('div', 'iw-content');
$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) {
Ejemplo n.º 2
0
// create new page object
$page = new HtmlPage('Wikidata-Auszeichnungs-Abgleich');
// create new database object
$db = new Database();
// create new request validator
$rq = new RequestValidator();
// get parameters
$rq->addAllowed('GET', 'mode', '', '/^(lesenswert|exzellent|informativ|portal)$/', true);
$par = $rq->getParams();
$page->openBlock('div', 'iw-content');
$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) {
Ejemplo n.º 3
0
// create new request validator
$rq = new RequestValidator();
// get parameters
$rq->addAllowed('GET', 'lang', '', '/^[a-z]{1,7}$/', true);
$rq->addAllowed('GET', 'project', '', '/^[a-z]{1,15}$/', true);
$rq->addAllowed('GET', 'page', '', '', true, false);
$rq->addAllowed('GET', 'since', '0000-00-00', '/^\\d{4}-\\d{2}-\\d{2}$/', false, false);
$rq->addAllowed('GET', 'until', '0000-00-00', '/^\\d{4}-\\d{2}-\\d{2}$/', false, false);
$par = $rq->getParams();
$page->openBlock('div', 'iw-content');
$page->addInline('p', 'This tool creates a list of contributors to a given article on a given project in wikitext.');
$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>');
$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');