<?php

# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.

# If you customize your file layout, set $IP to the directory that contains
# the other MediaWiki files. It will be used as a base to locate files.
if( defined( 'MW_INSTALL_PATH' ) ) {
	$IP = MW_INSTALL_PATH;
} else {
	$IP = dirname( __FILE__ );
}


$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );


# Tohle přidáno kvůli mailu
# ini_set( "include_path", ".:$IP:$IP/includes:$IP/languages:/usr/bin" );
# konec přidání

// require_once( "$IP/includes/DefaultSettings.php" );

$wgSecretKey = "Tojealeslepice";

# $wgCategoryCollation = 'identify';

// REVIZE - dočasně potlačeno
//include_once( "$IP/extensions/FlaggedRevs/FlaggedRevs.php" );

//$wgFlaggedRevTags = array(
//	'accuracy' => array( 'levels' => 4, 'quality' => 1, 'pristine' => 2 ),
//	'depth'    => array( 'levels' => 4, 'quality' => 2, 'pristine' => 4 ),
//	'style'    => array( 'levels' => 4, 'quality' => 2, 'pristine' => 4 ),
//);

wfLoadExtension ('Scribunto');
//$wgScribuntoDefaultEngine = 'luastandalone';
//$wgScribuntoDefaultEngine = 'luasandbox';

wfLoadExtension( 'CookieWarning' );
$wgCookieWarningEnabled = true;

wfLoadExtension( 'TemplateSandbox' );

$wgServer = "https://www.enviwiki.cz";

//$wgSearchType = 'SphinxMWSearch';
//require_once "$IP/extensions/SphinxSearch/SphinxSearch.php";



//$wgFlaggedRevsOverride = true;
//$wgFlaggedRevsWhitelist = array( 'Hlavní_strana' );
//$wgSimpleFlaggedRevsUI = true;
//$wgFlaggedRevsLowProfile = false;
//$wgFlaggedRevsComments = true;
//$wgFlaggedRevsAutoReview = false;

//require_once "$IP/skins/CologneBlue/CologneBlue.php";
//require_once "$IP/skins/Modern/Modern.php";
//require_once "$IP/skins/MonoBook/MonoBook.php";

wfLoadSkin('Vector');
wfLoadSkin( 'MinervaNeue' );
$wgDefaultSkin = 'minerva';

wfLoadExtension ('Widgets');
wfLoadExtension( 'MobileFrontend' );
wfLoadExtension ("Echo");
wfLoadExtension ("Thanks");

$wgMFAutodetectMobileView = true;
$wgMFDefaultSkinClass = 'SkinMinerva'; // use Minerva skin

wfLoadExtension( 'Gadgets' );
wfLoadExtension('ImageMap');
//wfLoadExtension ('GraphViz');
wfLoadExtension ('Math');
wfLoadExtension ('AdvancedSearch');

// Set MathML as default rendering option;
//$wgUseTeX = true;
//$wgDefaultUserOptions['math'] = 'mathml';
//$wgMathFullRestbaseURL= 'https://api.formulasearchengine.com/';
//$wgMathDisableTexFilter = 'never';
//$wgMathValidModes = array('svg', 'source', 'mathml' );

//wfLoadExtension ('SimpleMathJax');
//require_once "$IP/extensions/SimpleMathJax/SimpleMathJax.php";
//$wgSimpleMathJaxSize = 120;

//Google Analytics - začátek
require_once "$IP/extensions/googleAnalytics/googleAnalytics.php";
$wgGoogleAnalyticsAccount = 'UA-77036740-1'; 
// Add HTML code for any additional web analytics (can be used alone or with $wgGoogleAnalyticsAccount)
// $wgGoogleAnalyticsOtherCode = '<script type="text/javascript" src="https://analytics.example.com/tracking.js"></script>';

// Optional configuration (for defaults see googleAnalytics.php)
// Store full IP address in Google Universal Analytics (see https://support.google.com/analytics/answer/2763052?hl=en for details)
$wgGoogleAnalyticsAnonymizeIP = false; 
// Array with NUMERIC namespace IDs where web analytics code should NOT be included.
$wgGoogleAnalyticsIgnoreNsIDs = array(500);
// Array with page names (see magic word Extension:Google Analytics Integration) where web analytics code should NOT be included.
$wgGoogleAnalyticsIgnorePages = array('ArticleX', 'Foo:Bar');
// Array with special pages where web analytics code should NOT be included.
$wgGoogleAnalyticsIgnoreSpecials = array( 'Userlogin', 'Userlogout', 'Preferences', 'ChangePassword', 'OATH');
// Use 'noanalytics' permission to exclude specific user groups from web analytics, e.g.
$wgGroupPermissions['sysop']['noanalytics'] = true;
$wgGroupPermissions['bot']['noanalytics'] = true;
// To exclude all logged in users give 'noanalytics' permission to 'user' group, i.e.
$wgGroupPermissions['user']['noanalytics'] = true;
// Google Analytics - konec

#Možnost natahování obrázku z Commons
$wgUseInstantCommons = true;


# If PHP's memory limit is very low, some operations may fail.
# ini_set( 'memory_limit', '20M' );

if ( $wgCommandLineMode ) {
	if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
		die( "This script must be run from the command line\n" );
	}
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

$wgSitename         = "Enviwiki";


//$wgExtraNamespaces = array( 104 => "Recenzované", 105 => "Recenzované_diskuse", 106 => "Studenti", 107 => "Studenti_diskuse" ); 

define("Tezaurus",100);
define("Tezaurus_diskuse",101);
define("Portal",102);
define("Portal_diskuse",103);
define("Recenzovane",104);
define("Recenzovane_diskuse",105);
define("Studenti",106);
define("Studenti_diskuse",107);


$wgExtraNamespaces[Tezaurus] = "Tezaurus";
$wgExtraNamespaces[Tezaurus_diskuse]="Diskuse_k_tezauru";
$wgExtraNamespaces[Portal]="Portál";
$wgExtraNamespaces[Portal_diskuse]="Diskuse_k_portálu";
$wgExtraNamespaces[Recenzovane]="Recenzované";
$wgExtraNamespaces[Recenzovane_diskuse]="Diskuse_k_recenzovaným";
$wgExtraNamespaces[Studenti]="Studenti";
$wgExtraNamespaces[Studenti_diskuse]="Diskuse_k_studenti";



$wgFavicon = "/w/favicon.ico";

$wgFileExtensions[] = 'svg';
$wgFileExtensions[] = 'ogg';

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
$wgScriptExtension  = ".php";

## For more information on customizing the URLs please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL

$wgLogo             = "/w/images/enviwiki_small.png";

$wgNamespacesWithSubpages[NS_MAIN] = true;
$wgNamespacesWithSubpages[NS_USER] = true;
$wgNamespacesWithSubpages[NS_PROJECT] = true;
$wgNamespacesWithSubpages[102] = true;
$wgNamespacesWithSubpages[106] = true;

$wgGroupPermissions['*']['edit'] = true;
$wgGroupPermissions['*'            ]['createpage'] = false;
$wggGroupPermissions['user'         ]['createpage'] = true;
$wgGroupPermissions['autoconfirmed']['createpage'] = true;

$wgGroupPermissions['*']['createaccount'] = true;


$wgSMTP = array(
'host'     => "golias.ruk.cuni.cz", //could also be an IP address
'IDHost'   => "envigogika.cz",
'port'     => 25,
'auth'     => FALSE,
'username' => "",
 'password' => ""
);


$wgEnableEmail      = true;
$wgEnableUserEmail  = true;


$wgEmergencyContact = "jiri.dlouhy@czp.cuni.cz";
$wgPasswordSender = "jiri.dlouhy@czp.cuni.cz";

## For a detailed description of the following switches see
## http://www.mediawiki.org/wiki/Extension:Email_notification 
## and http://www.mediawiki.org/wiki/Extension:Email_notification
## There are many more options for fine tuning available see
## /includes/DefaultSettings.php
## UPO means: this is also a user preference option
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;

$wgDBtype           = "mysql";
$wgDBserver         = "localhost";
$wgDBname           = "wiking007";
$wgDBuser           = "czpdlouhy";
$wgDBpassword       = "Zazvor11*57sql";

# MySQL specific settings
$wgDBprefix         = "";

# MySQL table options to use during installation or update
$wgDBTableOptions   = "TYPE=InnoDB";

# Experimental charset support for MySQL 4.1/5.0.
$wgDBmysql5 = false;


## Shared memory settings
//$wgMainCacheType = CACHE_NONE;
$wgMainCacheType = CACHE_DB;
$wgMemCachedServers = array();


## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads       = true;
$wgUploadDirectory  = "$IP/images";
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

$wgEnableMWSuggest = true;

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
# $wgHashedUploadDirectory = false;

## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX           = true;

$wgLocalInterwiki   = $wgSitename;
$wgLanguageCode = "cs";

$wgProxyKey = "4243ab624d6c9f3617d5ab8e1632d98c7004b5da301c42b36e1ae4665fe3a21";


## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
$wgEnableCreativeCommonsRdf = true;
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "http://creativecommons.org/licenses/by-sa/3.0/deed.cs";
$wgRightsText = "licencí Creative Commons Uveďte autora – Zachovejte licenci 3.0 Unported ";
$wgRightsIcon = "";
# $wgRightsCode = ""; # Not yet used

$wgDiff3 = "";

# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) );
$wgCacheEpoch = max( $wgCacheEpoch, $configdate );

wfLoadExtension( 'Cite' );
wfLoadExtension( 'ParserFunctions');
wfLoadExtension( 'CategoryTree' );

$wgUseAjax = true;
$linkattr['style'] = 'display: inline !important;'; // Unhidden by JS


wfLoadExtension( 'UserMerge' );
$wgGroupPermissions['bureaucrat']['usermerge'] = true;

$wgCategoryTreeDefaultOptions['showcount'] = 'on';

$wgScriptPath = "/w";           # Path to the actual files. This should already be there
$wgScript = "$wgScriptPath/index.php";
$wgArticlePath = '/wiki/$1';  # Virtual path. This directory MUST be different from the one used in $wgScriptPath
$wgUsePathInfo = true;

$wgAllowExternalImages = true;
$wgSVGConverter = 'rsvg';
$wgSVGConverterPath = '/usr/bin/';

#$wgRepositoryBaseUrl = "http://commons.wikimedia.org/wiki/Image:";
#$wgSharedUploadDBname = false;
#$wgUseSharedUploads = true;
#$wgSharedUploadPath = "http://commons.wikimedia.org/shared/images";
#$wgSharedUploadDirectory = "$IP/images";
#$wgFetchCommonsDescriptions = true;
#$wgCacheSharedUploads = false;
#$wgAllowCopyUploads = true;
#$wgUseInstantCommons = true;


# FCK editor - je nainstalovaný, funguje
//wfLoadExtension ('FCKeditor');
#require_once("$IP/extensions/FCKeditor/FCKeditor.php");

#require_once("$IP/extensions/UsabilityInitiative/Vector/Vector.php");
$wgVectorModules['editwarning']['global'] = false; // Don't enable EditWarning globally
$wgVectorModules['editwarning']['user'] = true; // Allow users to enable EditWarning in their preferences
//$wgVectorUseSimpleSearch = true; // Need this as well for SimpleSearch
$wgDefaultSkin = 'vector'; // If you want to change the default skin for new users
$wgVectorUseIconWatch = true; //Enable star icon to add/remove page from watchlist

// UsabilityInitiative/WikiEditor
//require_once("$IP/extensions/WikiEditor/WikiEditor.php");
//$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;  // Default user preference to use toolbar dialogs
//$wgWikiEditorModules['toolbar']['global'] = true;  // Enable the WikiEditor toolbar for everyone
//$wgWikiEditorModules['toolbar']['user'] = true;  // Don't allow users to turn the WikiEditor toolbar on/off individually

#Tohle je tu dočasně a v ostré verzi vyhodit
error_reporting(E_ALL);
ini_set("display_errors", 1);


//require_once("$IP/extensions/Renameuser/SpecialRenameuser.php");




wfLoadExtension('ConfirmEdit');
wfLoadExtension('ConfirmEdit/QuestyCaptcha');

$wgCaptchaClass = 'QuestyCaptcha';
$wgCaptchaQuestions[] = array( 'question' => "Napište písmeno s s háčkem", 'answer' => "š" );
$wgCaptchaQuestions[] = array( 'question' => 'Jak se jmenuje samička od kohouta - napište malými písmeny zde:', 'answer' => 'slepice' );
$wgCaptchaQuestions[] = array( 'question' => 'Napište číslo padesáttři číslem zde:', 'answer' => '53' );



wfLoadExtension( 'CheckUser' );
$wgGroupPermissions['sysop']['userrights'] = true;

$wgShowSQLErrors = true;

wfLoadExtension("SpamBlacklist");

$wgSpamBlacklistFiles = array(
   "[[m:Spam blacklist]]",
   "http://en.wikipedia.org/wiki/MediaWiki:Spam-blacklist"
);

wfLoadExtension( 'CiteThisPage' );

wfLoadExtension( 'VisualEditor' );

// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
// Don't allow users to disable it
// $wgHiddenPrefs[] = 'visualeditor-enable';

// OPTIONAL: Enable VisualEditor's experimental code features
$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;

$wgVisualEditorSupportedSkins = array( 'vector' );

$wgVirtualRestConfig['modules']['parsoid'] = array(
    // URL to the Parsoid instance
    // Use port 8142 if you use the Debian package
    'url' => 'http://localhost:8142',
    // Parsoid "domain", see below (optional)
     'domain' => 'enviwiki',
    // Parsoid "prefix", see below (optional)
     'prefix' => 'enviwiki'
 );

$wgGroupPermissions['*']['createaccount'] = false;

$wgVisualEditorNamespaces = array_merge( $wgContentNamespaces, array( NS_USER, NS_CATEGORY, 102, 104, 106 ) );
$wgVisualEditorAvailableNamespaces = [NS_MAIN => true, NS_USER => true, NS_HELP => true, 102 => true, 106  => true,  "_merge_strategy" => "array_plus"];

wfLoadExtension( 'ReplaceText' );
$wgGroupPermissions['bureaucrat']['replacetext'] = true;

//wfLoadExtension( 'AntiSpoof' );
wfLoadExtension( 'CodeEditor' );
$wgScribuntoUseCodeEditor = true;

wfLoadExtension ('Elastica');
//wfLoadExtension ('CirrusSearch');
wfLoadExtension ("CreatedPagesList");
//$wgDisableSearchUpdate = true;
//$wgSearchType = 'CirrusSearch';


wfLoadExtension( 'WikiEditor' );

# Enables use of WikiEditor by default but still allows users to disable it in preferences
$wgDefaultUserOptions['usebetatoolbar'] = 1;
# Enables link and table wizards by default but still allows users to disable them in preferences
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
# Displays the Preview and Changes tabs
$wgDefaultUserOptions['wikieditor-preview'] = 1;
# Displays the Publish and Cancel buttons on the top right side
$wgDefaultUserOptions['wikieditor-publish'] = 1;

wfLoadExtension( 'SyntaxHighlight_GeSHi' );

$wgScribuntoUseGeSHi = true;
$wgScribuntoUseCodeEditor = true;

wfLoadExtension( 'TemplateData' );

//$wgDebugToolbar = true;

//wfLoadExtension( 'Citoid' );
//$wgCitoidServiceUrl = 'https://en.wikipedia.org/api/rest_v1/#!/Citation/getCitation';

wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'CharInsert' );
wfLoadExtension ('MobileApp');
wfLoadExtension ("CodeMirror");
wfLoadExtension ("PageImages");
wfLoadExtension ("Popups");
wfLoadExtension ("MultimediaViewer");
wfLoadExtension ('HeadScript');


$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;
$wgDefaultUserOptions["usecodemirror"] = 1;
$wgPopupsOptInDefaultState = "1";