Пример #1
0
 /**
  * @param string $lang the language code of the Wikisource like 'en' or 'fr'
  * @param string $domainName
  * @param ClientInterface $client
  */
 public function __construct($lang = '', $domainName = '', ClientInterface $client = null)
 {
     if ($lang == '') {
         $lang = Api::getHttpLang();
     }
     $this->lang = $lang;
     if ($domainName != '') {
         $this->domainName = $domainName;
     } elseif ($this->lang == 'www' || $this->lang == '') {
         $this->domainName = 'wikisource.org';
         $this->lang = '';
     } elseif ($this->lang == 'wl' || $this->lang == 'wikilivres') {
         $this->domainName = 'wikilivres.ca';
         $this->lang = '';
     } else {
         $this->domainName = $this->lang . '.wikisource.org';
     }
     if ($client === null) {
         $client = static::createClient(ToolLogger::get(__CLASS__));
     }
     $this->client = $client;
 }
Пример #2
0
<?php

include 'header.php';
?>
<form method="get" action="book.php" role="form" class="form-horizontal">
	<fieldset>
		<legend>Export a file</legend>
		<div class="form-group">
			<label for="lang" class="col-lg-2 control-label">Language code</label>

			<div class="col-lg-10">
				<input name="lang" id="lang" type="text" size="3" maxlength="20" required="required"
				       value="<?php 
echo Api::getHttpLang();
?>
" class="form-control input-mini"/>
				<span class="help-block">Language code of Wikisource domain, like en or fr</span>
			</div>
		</div>
		<div class="form-group">
			<label for="page" class="col-lg-2 control-label">Title of the page</label>

			<div class="col-lg-10">
				<input name="page" id="page" type="text" size="30" required="required" class="form-control"
					   value="<?php 
echo $title;
?>
"/>
				<span class="help-block">Name of the mainpage of the book in Wikisource</span>
			</div>
		</div>