first commit
2
cgi-bin/.htaccess
Executable file
@ -0,0 +1,2 @@
|
||||
Options +ExecCGI
|
||||
AddHandler cgi-script .pl .exe
|
42
cgi-bin/CleanImages.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// File remove old images from all sub folder of this folder.
|
||||
|
||||
// maxDate in hours.
|
||||
function rrmdir($dir, $extention, $maxDate, &$removedList)
|
||||
{
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object)
|
||||
{
|
||||
if ($object != "." && $object != "..")
|
||||
{
|
||||
$objectName = $dir . "/" . $object;
|
||||
if (filetype($objectName) == "dir")
|
||||
{
|
||||
rrmdir($objectName, $extention, $maxDate, $removedList);
|
||||
}
|
||||
else if (pathinfo($objectName)['extension'] == $extention
|
||||
&& time() - filemtime($objectName) > $maxDate * 3600)
|
||||
{
|
||||
unlink ($objectName);
|
||||
$removedList[] = $objectName;
|
||||
}
|
||||
}
|
||||
}
|
||||
reset($objects);
|
||||
//rmdir($dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Remove only png and 1 month old.
|
||||
$removedList = [];
|
||||
rrmdir(".", "png", 24 * 30, $removedList);
|
||||
|
||||
foreach($removedList as $value)
|
||||
{
|
||||
echo ($value . "<br>");
|
||||
}
|
||||
|
||||
?>
|
16
cgi-bin/addDonate.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
include ("../core/config/main.php");
|
||||
|
||||
//if ("RdukIxdb0Lxc+uNhgfFXb7ll" == $_POST["notification_secret"])
|
||||
{
|
||||
$file = fopen("../" . $g_config['donateTransactions'], "a");
|
||||
if ($file)
|
||||
{
|
||||
fprintf($file, "%d\n", $_POST["amount"]);
|
||||
fclose($file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
9
cgi-bin/addFailedMatrix.php
Executable file
@ -0,0 +1,9 @@
|
||||
<?
|
||||
$matrix = $_GET["matrix"];
|
||||
$text = $_GET["text"];
|
||||
|
||||
$file = fopen("../tmp/faildMatrix.txt", "a");
|
||||
fprintf($file, "\n%s:\n", date("d.m.y"));
|
||||
fprintf($file, "FaildMatrix (%s):\n%s\n", $text, $matrix);
|
||||
fclose($file);
|
||||
?>
|
7
cgi-bin/getPluginsList.php
Executable file
@ -0,0 +1,7 @@
|
||||
<?
|
||||
|
||||
$jsScripts = glob("../script/plugins/*.js");
|
||||
|
||||
echo json_encode($jsScripts);
|
||||
|
||||
?>
|
12
cgi-bin/loadGraph.php
Executable file
@ -0,0 +1,12 @@
|
||||
<?
|
||||
include ("saveGraphHelpers.php");
|
||||
|
||||
$name = $_GET["name"];
|
||||
|
||||
if (isValidName($name))
|
||||
{
|
||||
echo (gzuncompress(file_get_contents(getXMLFileName($name))));
|
||||
}
|
||||
|
||||
echo ("");
|
||||
?>
|
14
cgi-bin/saveGraph.php
Executable file
@ -0,0 +1,14 @@
|
||||
<?
|
||||
include ("saveGraphHelpers.php");
|
||||
|
||||
$graph = file_get_contents("php://input");
|
||||
$name = $_GET["name"];
|
||||
|
||||
if (isValidName($name))
|
||||
{
|
||||
$file = fopen(getXMLFileName($name), "w");
|
||||
fprintf($file, "%s", gzcompress($graph, -1));
|
||||
fclose($file);
|
||||
echo ("OK");
|
||||
}
|
||||
?>
|
62
cgi-bin/saveGraphHelpers.php
Executable file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/*
|
||||
Function to save/open graph
|
||||
*/
|
||||
|
||||
include ("../core/config/main.php");
|
||||
|
||||
// Only latic.
|
||||
function isValidName($name)
|
||||
{
|
||||
return preg_match("(^[a-zA-Z]+$)", $name);
|
||||
}
|
||||
|
||||
|
||||
function getXMLFileName($graphName, $fromRoot=false)
|
||||
{
|
||||
global $g_config;
|
||||
|
||||
$dirName = ($fromRoot ? "" : "../") . $g_config['graphSavePath'] . substr($graphName, 0, 2);
|
||||
|
||||
if(!file_exists($dirName))
|
||||
{
|
||||
mkdir($dirName, 0777, true);
|
||||
}
|
||||
|
||||
return $dirName . "/$graphName.xml";
|
||||
}
|
||||
|
||||
|
||||
function getImageFileName($graphName, $fromRoot=false)
|
||||
{
|
||||
global $g_config;
|
||||
|
||||
$dirName = ($fromRoot ? "" : "../") . $g_config['graphSavePath'] . substr($graphName, 0, 2);
|
||||
|
||||
if(!file_exists($dirName))
|
||||
{
|
||||
mkdir($dirName, 0777, true);
|
||||
}
|
||||
|
||||
return $dirName . "/$graphName.png";
|
||||
}
|
||||
|
||||
|
||||
function saveGraphXML($graph, $name, $fromRoot = false)
|
||||
{
|
||||
$res = false;
|
||||
if (isValidName($name))
|
||||
{
|
||||
$file = fopen(getXMLFileName($name, $fromRoot), "w");
|
||||
if ($file)
|
||||
{
|
||||
fprintf($file, "%s", gzcompress($graph, -1));
|
||||
fclose($file);
|
||||
$res = true;
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
?>
|
30
cgi-bin/saveImage.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
include ("saveGraphHelpers.php");
|
||||
|
||||
$name = $_GET["name"];
|
||||
|
||||
if (isValidName($name))
|
||||
{
|
||||
$imageFilename = getImageFileName($name);
|
||||
$imageData = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $_POST['base64data']));
|
||||
|
||||
if (isset($_GET["x"]) && $_GET["width"] < 4000 && $_GET["height"] < 4000)
|
||||
{
|
||||
$src = imagecreatefromstring($imageData);
|
||||
$dst = imagecreatetruecolor($_GET["width"], $_GET["height"]);
|
||||
imagesavealpha($dst, true);
|
||||
imagealphablending($dst, false);
|
||||
|
||||
imagecopy($dst, $src, 0, 0, $_GET["x"], $_GET["y"], $_GET["width"], $_GET["height"]);
|
||||
imagepng($dst, $imageFilename);
|
||||
}
|
||||
else
|
||||
{
|
||||
file_put_contents($imageFilename, $imageData);
|
||||
}
|
||||
|
||||
chmod($imageFilename, 0644);
|
||||
echo ("OK");
|
||||
}
|
||||
|
||||
?>
|
4
core/config/admin_menu.php
Executable file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
$g_config['admin_menu'] = array();
|
||||
?>
|
11
core/config/admin_sector.php
Executable file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
$g_config['admin_sector'] = array();
|
||||
|
||||
$g_config['admin_sector']['salt'] = "sal"; // Соль для хранения паролей в базе. По сути любой набор символов
|
||||
$g_config['admin_sector']['after_login_page'] = 'admin/home'; // Страница административного раздела, на которую мы попадём после авторизации
|
||||
$g_config['admin_sector']['after_logout_page'] = 'admin/login'; // Страница на которую мы попадем после выхода из админки
|
||||
|
||||
$g_config['admin_sector']['def_login'] = 'root'; // Логин для входа в административный раздел
|
||||
$g_config['admin_sector']['def_pwd'] = 'rootPass'; // Пароль для входа в административный раздел
|
||||
?>
|
12
core/config/ckeditor4.php
Executable file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
if (is_file(BASEPATH . 'core/config/browserdatacache.php'))
|
||||
{
|
||||
require_once BASEPATH . 'core/config/browserdatacache.php';
|
||||
$g_config['browserdatacache_allow_dirs'][] = BASEPATH . 'upl/ckeditor4_files/';
|
||||
//$g_config['browserdatacache_allow_dirs'][] = BASEPATH . 'lib/ckeditor4/';
|
||||
}
|
||||
|
||||
$g_config['ckeditor4']['resize_down_width'] = 1600;
|
||||
$g_config['ckeditor4']['resize_down_height'] = 1200;
|
||||
?>
|
28
core/config/db.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Конфиг работы с БД
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
|
||||
|
||||
$g_config['dbSimple'] = array();
|
||||
$g_config['dbSimple']['logDbError'] = true;
|
||||
$g_config['dbSimple']['dbLogFile'] = BASEPATH . 'tmp/log_db.txt';
|
||||
|
||||
// Имена БД объектов
|
||||
$g_config['dbSimple']['databases'] = array
|
||||
(
|
||||
// Пример: (обращаться потом можно будет к $g_databases->db)
|
||||
// Раскоментируйте следующий блок, если собираетесь использовать базы данных в своём проекте
|
||||
/*'db' => array
|
||||
(
|
||||
'dsn' => DEBUG_MODE ?
|
||||
'mysql://root:@localhost/DataBaseName?charset=UTF8' : // Если локалка то локальная БД
|
||||
'mysql://User:Pwd@Host/DataBaseName?charset=UTF8', // Если сервер то настоящая БД
|
||||
'pCacheFunc' => '' // Указатель на функцию кеширования данных. Для кеширования в запросах пишите перед текстом запроса "-- CACHE: 10m\n" (10m - ttl кеша)
|
||||
)
|
||||
*/
|
||||
);
|
||||
?>
|
50
core/config/file_uploader.php
Executable file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Дефолтный конфиг файла
|
||||
*
|
||||
* @author Zmi и Guul
|
||||
*/
|
||||
|
||||
|
||||
$g_config['uploader']['default_config'] = array
|
||||
(
|
||||
// Путь до папки, куда будет загружен файл
|
||||
'upload_path' => BASEPATH . 'upl/files/',
|
||||
|
||||
// Типы MIME, описывающие типы файлов, разрешенных для загрузки
|
||||
'allowed_types' => 'txt|zip|doc|docx|pdf|bmp|gif|jpeg|jpg|png|rar|tiff',
|
||||
|
||||
// Максимальный размер файла (в килобайтах). Если ограничения нет, то пишем 0
|
||||
'max_size' => 8000,
|
||||
|
||||
// Если TRUE, и в папке уже есть файл с тем же именем, иначе к имени заливаемого файла добавится порядковый номер
|
||||
'overwrite' => false,
|
||||
|
||||
// Если TRUE, то имя файла преобразуется в случайным образом сгенерированную строку
|
||||
'encrypt_name' => true,
|
||||
|
||||
// Если TRUE, то все пробелы в имени файла будут преобразованы в знак подчеркивания
|
||||
'remove_spaces' => true,
|
||||
|
||||
// Максимальная ширина картинки в пикселях. 0 — не ограниченно
|
||||
'max_width' => 5000,
|
||||
|
||||
// Максимальная высота картинки в пикселях. 0 — не ограниченно.
|
||||
'max_height' => 5000,
|
||||
|
||||
// Ширина до которой нужно уменьшить загруженную картинку. 0 — не уменьшать
|
||||
'resize_down_width' => 1800,
|
||||
|
||||
// Высота до которой нужно уменьшить загруженную картинку. 0 — не уменьшать
|
||||
'resize_down_height' => 1800,
|
||||
|
||||
// Cписок thumb-ов который нужно сгенерировать.
|
||||
'thumbs' => array(
|
||||
// path можно не указывать. Тогда он: $config['upload_path'] . $t['width'] . '_' . $t['height'] . '/'
|
||||
|
||||
// array('width' => 50, 'height' => 50, 'path' => BASEPATH . 'upl/files/50_50/'),
|
||||
// array('width' => 100, 'height' => 100, 'path' => BASEPATH . 'upl/files/100_100/')
|
||||
)
|
||||
);
|
||||
?>
|
82
core/config/main.php
Executable file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Базовая конфигурация системы
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
|
||||
|
||||
define('SITE_ROOT', '/'); // Путь к корню сайта
|
||||
define('SITE_IN_DIR', ''); // Если сайт работает в каталоге напишите здесь каталог пример "cabinet" или "book/php"
|
||||
define('DOMAIN_COOKIE', '');
|
||||
|
||||
// Массив языков сайта
|
||||
define('DEF_LANG', 'ru');
|
||||
$g_arrLangs = array(
|
||||
'en' => array('name' => 'English'),
|
||||
'ru' => array('name' => 'Русский')
|
||||
);
|
||||
|
||||
$g_config = array();
|
||||
$g_config['mainTpl'] = 'main_tpl';
|
||||
$g_config['charset'] = 'utf-8';
|
||||
$g_config['defaultComponent'] = 'home';
|
||||
|
||||
if (!defined("E_DEPRECATED"))
|
||||
{
|
||||
define("E_DEPRECATED", 8192);
|
||||
}
|
||||
$g_config['phpIni'] = array
|
||||
(
|
||||
'error_reporting' => E_ALL ^ E_DEPRECATED, // Выдавать все ошибки за исключением нотайсов об устаревшом коде
|
||||
//'display_errors' => DEBUG_MODE, // Выводить ли ошибки в браузер
|
||||
'memory_limit' => '10M', // Максимальное коливество памяти на выполнение скрипта
|
||||
'max_execution_time' => '15', // Максимальное время выполнения скрипта
|
||||
'max_input_time' => '15', // Время в течении которого скрипту разрешено получать данные
|
||||
// "upload_max_filesize" и "post_max_size" - Для изменения размера загружаемыз данных (файлов или POST) но задавать нужно через "php.ini | .htaccess | httpd.conf"
|
||||
);
|
||||
|
||||
$g_config['logPath'] = BASEPATH . 'tmp/log.txt'; // Стандартный лог движка (ф-я ToLog())
|
||||
$g_config['useDebugErrorHook'] = false; // Использовать ли DebugErrorHook для перехвата ошибок
|
||||
$g_config['logErrors'] = array
|
||||
(
|
||||
'repeatTmp' => BASEPATH . 'tmp/log/unRepeatErrTmp',
|
||||
'logFile' => BASEPATH . 'tmp/log/log.txt',
|
||||
'emailTimeRepeat' => 3 * 60, // Письмо каждые 3 минуты
|
||||
'email' => 'admin@unick-soft.ru', // На этот адрес будут присылаться сообщения об ошибках
|
||||
);
|
||||
|
||||
$g_config['extrapacker'] = array();
|
||||
$g_config['extrapacker']['dir'] = 'auto_merge_css_js';
|
||||
$g_config['extrapacker']['packHtml'] = false;
|
||||
$g_config['extrapacker']['packCss'] = true;
|
||||
$g_config['extrapacker']['packJs'] = false;
|
||||
$g_config['extrapacker']['arrExeptions_js'] = array();
|
||||
$g_config['extrapacker']['arrExeptionsNotAdd_js'] = array();
|
||||
$g_config['extrapacker']['arrExeptions_css'] = array();
|
||||
$g_config['extrapacker']['arrExeptionsNotAdd_css'] = array();
|
||||
$g_config['extrapacker']['buffering'] = true; // Включен ли GZIP для склеиных css/js
|
||||
|
||||
// Загружать запущенный компонент в main_template-е ?
|
||||
$g_config['isLoadInMainTpl'] = true;
|
||||
|
||||
$g_config['useModRewrite'] = is_readable(BASEPATH . '.htaccess');
|
||||
|
||||
$g_config['startExecTime'] = microtime(true);
|
||||
|
||||
// Получать ли тайтл автоматически из h1 если не было установлено до этого
|
||||
$g_config['autoGetTitle'] = true;
|
||||
|
||||
// Список ф-ий обрабатывающих вывод контент перед выводом в браузер
|
||||
$g_config['prepareFunctions'] = array
|
||||
(
|
||||
'_PrepareContent' // Стандартная ф-я редактирования вывода (объединяет head-ы в один и склеивает css с js)
|
||||
);
|
||||
// Graph save path.
|
||||
$g_config['graphSavePath'] = "./tmp/saved/";
|
||||
$g_config['graphExamplesFile'] = "samples.cvs";
|
||||
// Donate files
|
||||
$g_config['donateTotal'] = "./tmp/donate/total.txt";
|
||||
$g_config['donateTransactions'] = "./tmp/donate/transactions.txt";
|
||||
?>
|
50
core/config/page_editor.php
Executable file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
//** Инициализация параметов
|
||||
|
||||
require_once BASEPATH . 'core/config/main.php'; // Чтобы использовать $g_config['defaultComponent']
|
||||
$g_config['page_editor'] = array();
|
||||
|
||||
// Какие страницы не показывать в списке страниц
|
||||
$g_config['page_editor']['exceptions'] = array();
|
||||
$g_config['page_editor']['exceptions'][] = 'admin/';
|
||||
|
||||
// Для каких страниц не показывать SEO параметры
|
||||
$g_config['page_editor']['seo_exceptions'] = array();
|
||||
$g_config['page_editor']['seo_exceptions'][] = 'dev/';
|
||||
$g_config['page_editor']['seo_exceptions'][] = 'main_tpl/';
|
||||
$g_config['page_editor']['seo_exceptions'][] = 'main_tpl.php';
|
||||
|
||||
// Нужно ли делать backup-ы страниц
|
||||
// Backup-ы сохраняются по адресу lang/backup/[язык]/[путь_к_файлу]/[имя_файла].[дата_сохранения].php
|
||||
$g_config['page_editor']['with_backup'] = true;
|
||||
|
||||
// Дополнительная информация о некоторых страницах
|
||||
$g_config['page_editor']['labels'] = array();
|
||||
$g_config['page_editor']['labels']["autoload/"] = "Файлы в этой папке задают глобальные параметры";
|
||||
$g_config['page_editor']['labels']["autoload/main.php"] = "Файл для задания глобальных SEO параметров";
|
||||
$g_config['page_editor']['labels']["main_tpl.php"] = "Главный шаблон сайта";
|
||||
$g_config['page_editor']['labels']["404.php"] = "Страница 404 Ошибки (Страница не найдена)";
|
||||
$g_config['page_editor']['labels']["_500.php"] = "Страница 500 Ошибки (Внутренняя ошибки сервера)";
|
||||
$g_config['page_editor']['labels'][$g_config['defaultComponent']] = "Главная страница сайта";
|
||||
|
||||
//** Инициализация меню
|
||||
|
||||
require_once BASEPATH . 'core/config/admin_menu.php';
|
||||
|
||||
GetQuery(); // Чтобы фунция SiteRoot корректно заработала нужно проинициализировать LANG в функции GetQuery
|
||||
$menu = array
|
||||
(
|
||||
'link' => 'javascript:void(0)',
|
||||
'name' => 'Страницы',
|
||||
'label' => 'Редактирование страниц',
|
||||
'css' => '',
|
||||
'list' => array
|
||||
(
|
||||
array('link' => SiteRoot('admin/page_editor'), 'name' => 'Все страницы', 'label' => 'Смотреть все страницы'),
|
||||
array('link' => SiteRoot('admin/page_editor_add'), 'name' => 'Добавить', 'label' => 'Добавить новую страницу')
|
||||
)
|
||||
);
|
||||
|
||||
$g_config['admin_menu'][] = $menu;
|
||||
?>
|
22
core/core.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Ининциализатор системы
|
||||
*
|
||||
* @author Zmi and GYL
|
||||
*/
|
||||
|
||||
|
||||
// Подключаем все файлы которые есть в папках core/{func|config|init}
|
||||
foreach (array(BASEPATH . 'core/func/', BASEPATH . 'core/config/', BASEPATH . 'core/init/') as $dir)
|
||||
{
|
||||
$files = array_merge(array($dir . 'main.php'), glob($dir . "*.php"));
|
||||
foreach ($files as $f)
|
||||
{
|
||||
if (is_readable($f))
|
||||
{
|
||||
require_once $f;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
28
core/func/changelang.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Фукнция для смены языка на нужный
|
||||
*
|
||||
* @param $lang - Язык на который нужно произвести смену
|
||||
* @param $url - Страница на которой нужно произвести смену
|
||||
*/
|
||||
function ChangeLang($lang, $url)
|
||||
{
|
||||
$url = _StrReplaceFirst("/?q=", "/", $url);
|
||||
|
||||
global $g_arrLangs, $g_config;
|
||||
$lang = in_array($lang, array_keys($g_arrLangs)) ? $lang : LANG;
|
||||
|
||||
$siteRoot = SiteRoot();
|
||||
$uri = _StrReplaceFirst($siteRoot, '', $url);
|
||||
|
||||
$dir = SITE_IN_DIR ? (SITE_IN_DIR . '/') : '';
|
||||
$lang = $lang == DEF_LANG ? '' : ($lang . '/');
|
||||
$ret = $lang || $uri ? "/{$dir}?q={$lang}{$uri}" : $dir;
|
||||
$ret = empty($ret) ? '/' : $ret;
|
||||
|
||||
return $g_config['useModRewrite'] ?
|
||||
_StrReplaceFirst("/?q=", "/", strpos($ret, '?') === false ? _StrReplaceFirst('&', '?', $ret) : $ret) :
|
||||
$ret;
|
||||
}
|
||||
?>
|
113
core/func/ckeditor4.php
Executable file
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Обработка текста перед сохранением. Действия:
|
||||
*
|
||||
* 1) Преобразовать все внешние img ссылки во внутренние (соответственно скопировав все изображения на сервер)
|
||||
* 2) Удалить лишний мусор, который добавляет CKEditor (например при проверке грамматики).
|
||||
*
|
||||
* @author GYL
|
||||
*/
|
||||
function CKEditor4PreSave($text, $uploadImgs = true, &$uncopiedImgs = array(), $serverName = NULL)
|
||||
{
|
||||
global $g_config;
|
||||
|
||||
// когда включена проверка орфографии ckeditor добавляет в html много мусора (лишние спаны). Эта штука его убирает.
|
||||
$text = preg_replace('/<span data-scayt_word="[^"]+" data-scaytid="[0-9]*">([^<]+)<\/span>/', '$1', $text);
|
||||
$text = preg_replace('/<span data-scaytid="[0-9]*" data-scayt_word="[^"]+">([^<]+)<\/span>/', '$1', $text);
|
||||
|
||||
if (empty($serverName) && isset($_SERVER['SERVER_NAME'])) // на всякий случай преобразуем все ссылки вида http://наш_сайт/img/1.png в /img/1.png
|
||||
{
|
||||
$serverName = $_SERVER['SERVER_NAME'];
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error("Invalid server name", E_USER_ERROR);
|
||||
}
|
||||
|
||||
require_once BASEPATH . 'lib/simple_html_dom.php';
|
||||
|
||||
$html = str_get_html($text);
|
||||
|
||||
if ($html == NULL) return "";
|
||||
|
||||
foreach ($html->find("img") as $img)
|
||||
{
|
||||
$img->removeAttribute("data-cke-saved-src");
|
||||
|
||||
$src = $img->src;
|
||||
$alt = $img->alt;
|
||||
$style = $img->style;
|
||||
|
||||
$parsed = parse_url($src);
|
||||
$params = array();
|
||||
|
||||
if (isset($parsed['query']))
|
||||
{
|
||||
foreach (explode('&', $parsed['query']) as $elem)
|
||||
{
|
||||
if (strpos($elem, '=') !== false)
|
||||
{
|
||||
$elem = explode('=', $elem);
|
||||
$params[$elem[0]] = isset($elem[1]) ? $elem[1] : NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
$isLocal = empty($parsed["host"]) || (!empty($parsed["host"]) && $parsed["host"] == $serverName); // если нет имени сервера или оно равно имени нашего сервера
|
||||
|
||||
if ($isLocal && strpos($parsed["path"], "/upl/ckeditor_files/") === 0) // http://oursite.ru/upl/ckeditor_files/abc.jpg -> /upl/ckeditor_files/abc.jpg
|
||||
{
|
||||
$src = "/upl/ckeditor_files/" . basename($src);
|
||||
}
|
||||
else if ($isLocal && !empty($params["file"]) && strpos($parsed["path"], "/dev/ckeditor_preview/") === 0) // http://oursite.ru/dev/ckeditor_preview?file=abc.jpg -> /upl/ckeditor_files/abc.jpg
|
||||
{
|
||||
$src = "/upl/ckeditor_files/" . $params["file"];
|
||||
}
|
||||
else if ($isLocal && !empty($params["file"]) && strpos($params["path"], "dev/ckeditor_preview") === 0) // http://oursite.ru/?q=dev/ckeditor_preview?file=abc.jpg -> /upl/ckeditor_files/abc.jpg
|
||||
{
|
||||
$src = "/upl/ckeditor_files/" . $params["file"];
|
||||
}
|
||||
else if ($uploadImgs && pathinfo($src, PATHINFO_EXTENSION) == "webp" && !function_exists("imagecreatefromwebp")) // small hack
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
else if ($uploadImgs)
|
||||
{
|
||||
$info = @getimagesize($src);
|
||||
$ext = @image_type_to_extension($info[2], false);
|
||||
if (empty($ext)) $ext = @pathinfo(@basename($src), PATHINFO_EXTENSION);
|
||||
|
||||
if (!empty($ext))
|
||||
{
|
||||
$ext = strtolower($ext);
|
||||
$name = md5(uniqid(mt_rand())) . "." . $ext;
|
||||
$path = BASEPATH . 'upl/ckeditor_files/' . $name;
|
||||
FileSys::MakeDir(BASEPATH . 'upl/ckeditor_files/');
|
||||
|
||||
//xmp(get_loaded_extensions());
|
||||
|
||||
if (copy($src, $path))
|
||||
{
|
||||
// Уменьшаем размер файла путем ресайза картинки
|
||||
$wImg = WideImage::load($path);
|
||||
$wImg->resizeDown($g_config['ckeditor4']['resize_down_width'],
|
||||
$g_config['ckeditor4']['resize_down_height'])->saveToFile($path);
|
||||
|
||||
$src = '/upl/ckeditor_files/' . $name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$uncopiedImgs[] = $src;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$uncopiedImgs[] = $src;
|
||||
}
|
||||
}
|
||||
|
||||
$img->src = $src;
|
||||
}
|
||||
return $html->save();
|
||||
}
|
||||
?>
|
50
core/func/debug.php
Executable file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Функции используемые при дебаге кода
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
|
||||
|
||||
// Запись в стандартный лог движка
|
||||
function ToLog($msg, $path = '')
|
||||
{
|
||||
global $g_config;
|
||||
$path = empty($path) ? $g_config['logPath'] : $path;
|
||||
$logger = FileLogger::Create($path);
|
||||
$logger->Message($msg);
|
||||
}
|
||||
|
||||
function Xmp($a)
|
||||
{
|
||||
printf("<xmp>%s</xmp>", print_r($a, true));
|
||||
}
|
||||
|
||||
function VarDump($var)
|
||||
{
|
||||
$ret = '';
|
||||
if (is_bool($var))
|
||||
{
|
||||
$ret = ($var) ? 'true' : 'false';
|
||||
}
|
||||
elseif (is_scalar($var))
|
||||
{
|
||||
$ret = htmlspecialchars($var);
|
||||
}
|
||||
elseif (is_null($var))
|
||||
{
|
||||
$ret = 'NULL';
|
||||
}
|
||||
else
|
||||
{
|
||||
ob_start();
|
||||
var_dump($var);
|
||||
$data = ob_get_clean();
|
||||
$data = preg_replace('/=>\n\s+/', ' => ', $data);
|
||||
$data = htmlspecialchars($data);
|
||||
$ret = '<pre>' . $data . '</pre>';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
?>
|
375
core/func/main.php
Executable file
@ -0,0 +1,375 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Главные ф-ии
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
|
||||
|
||||
// Параметры какие защиты отключать
|
||||
define('M_HTML_FILTER_OFF', 2); // Выкл. защиту от HTML текста
|
||||
define('M_XSS_FILTER_OFF', 4); // Выкл. защиту от XSS вставок
|
||||
define('M_DELETE_PARAM', 'micron_not_use_this_param__98gmkhgKfdg');
|
||||
|
||||
|
||||
// Производит замену только 1-го вхождения подстроки в строку
|
||||
function _StrReplaceFirst($search, $replace, $subject)
|
||||
{
|
||||
$ret = $subject;
|
||||
$pos = strpos($subject, $search);
|
||||
if ($pos !== false)
|
||||
{
|
||||
$ret = substr_replace($subject, $replace, $pos, strlen($search));
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Загрузка компонента
|
||||
*
|
||||
* Производит подключение файлов lang/src/tpl
|
||||
*
|
||||
* @global array $g_lang
|
||||
* @global array $g_config
|
||||
* @global string $g_arrLangs
|
||||
*
|
||||
* @param string $_micron_file - URI запроса т.е. подключаемый файл или строка вида file_name&par1=a&par2=b
|
||||
* @param array $_micron_params - массив параметров которые необходимо создать до подключения
|
||||
*
|
||||
* @return int - вовзращает кол-во подключенных файлов этого компонента
|
||||
*/
|
||||
function IncludeCom($_micron_file, $_micron_params = array())
|
||||
{
|
||||
global $g_lang, $g_config, $g_arrLangs;
|
||||
|
||||
$_micron_file = GetQuery($_micron_file);
|
||||
foreach ($_micron_params as $micron_name => $micron_value)
|
||||
{
|
||||
$$micron_name = $micron_value;
|
||||
}
|
||||
|
||||
$micron_has = 0;
|
||||
// Список всех файлов которые требуется полключить
|
||||
$micron_files = array
|
||||
(
|
||||
BASEPATH . 'lang/' . DEF_LANG . "/{$_micron_file}.php",
|
||||
BASEPATH . 'lang/' . LANG . "/{$_micron_file}.php",
|
||||
BASEPATH . "src/{$_micron_file}.php",
|
||||
BASEPATH . "tpl/{$_micron_file}.php"
|
||||
);
|
||||
$micron_files = array_unique($micron_files);
|
||||
|
||||
// Подключаем все возможные файлы компонента
|
||||
foreach ($micron_files as $micron_f)
|
||||
{
|
||||
if (is_readable($micron_f))
|
||||
{
|
||||
$micron_has++;
|
||||
require $micron_f;
|
||||
if (isset($GLOBALS['__breakCurrentCom__']) && $GLOBALS['__breakCurrentCom__'])
|
||||
{
|
||||
$GLOBALS['__breakCurrentCom__'] = 0;
|
||||
return $micron_has;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $micron_has;
|
||||
}
|
||||
|
||||
/**
|
||||
* Фунция выхода из компонента что бы дальше файлы не подключала
|
||||
*/
|
||||
function ExitCom()
|
||||
{
|
||||
$GLOBALS['__breakCurrentCom__'] = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получает строку запроса к движку
|
||||
*
|
||||
* Так же данная функция занимается созданием параметров в $_GET если они были переданны в q и созданием константы LANG если ее еще не было
|
||||
*
|
||||
* @global array $g_config
|
||||
* @global array $g_arrLangs - массив языков сайта
|
||||
*
|
||||
* @param string $q - строка запроса при ее отсутвии то что было в $_GET[q]
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function GetQuery($q = NULL)
|
||||
{
|
||||
global $g_config, $g_arrLangs;
|
||||
|
||||
$langs = array_keys($g_arrLangs);
|
||||
$defPage = $g_config['defaultComponent'];
|
||||
|
||||
require_once BASEPATH . 'lib/InputClean.php';
|
||||
|
||||
$q = is_null($q) ? (isset($_GET['q']) && !empty($_GET['q']) ? rtrim($_GET['q'], "/") : $defPage) : $q;
|
||||
$q = _StrReplaceFirst('&', '?', $q);
|
||||
$parse = parse_url($q);
|
||||
$q = FileSys::FilenameSecurity($parse['path']);
|
||||
if (isset($parse['query']))
|
||||
{
|
||||
foreach (explode('&', $parse['query']) as $elem)
|
||||
{
|
||||
if (strpos($elem, '=') !== false)
|
||||
{
|
||||
$elem = explode('=', $elem);
|
||||
$_GET[$elem[0]] = isset($elem[1]) ? $elem[1] : NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
$parts = explode('/', $q);
|
||||
|
||||
$lang = isset($parts[0]) && in_array($parts[0], $langs) ? $parts[0] : DEF_LANG;
|
||||
|
||||
if (!defined('LANG'))
|
||||
{
|
||||
define('LANG', $lang);
|
||||
}
|
||||
|
||||
if (isset($parts[0]) && in_array($parts[0], $langs))
|
||||
{
|
||||
$q = implode('/', array_splice($parts, 1));
|
||||
}
|
||||
|
||||
$cleaner = new InputClean($g_config['charset']);
|
||||
return empty($q) ? $defPage : $cleaner->_clean_input_data($q);
|
||||
}
|
||||
|
||||
function _HtmlClean(&$value)
|
||||
{
|
||||
$value = htmlspecialchars($value);
|
||||
}
|
||||
|
||||
// Очищает входные данные
|
||||
function _Clean($value, $secureFlags)
|
||||
{
|
||||
if (!($secureFlags & M_XSS_FILTER_OFF)) // Если не отключена защита от XSS
|
||||
{
|
||||
global $g_config;
|
||||
static $cleaner = NULL;
|
||||
if (is_null($cleaner))
|
||||
{
|
||||
$cleaner = new InputClean($g_config['charset']);
|
||||
}
|
||||
$value = $cleaner->_clean_input_data($value);
|
||||
}
|
||||
if (!($secureFlags & M_HTML_FILTER_OFF)) // Если не отключена защита от HTML
|
||||
{
|
||||
is_array($value) ? array_walk_recursive($value, "_HtmlClean") : _HtmlClean($value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает юрл до корня сайта, нужна для данных (image, js, css ...)
|
||||
*/
|
||||
function Root($uri = '')
|
||||
{
|
||||
$dir = SITE_IN_DIR ? (SITE_IN_DIR . '/') : '';
|
||||
return SITE_ROOT . "{$dir}{$uri}";
|
||||
}
|
||||
|
||||
/**
|
||||
* Путь до корня сайта с подставкой языка, нужна для ссылок
|
||||
*/
|
||||
function SiteRoot($uri = '')
|
||||
{
|
||||
global $g_config;
|
||||
|
||||
$uri = $uri == $g_config['defaultComponent'] ? '' : $uri;
|
||||
|
||||
$dir = SITE_IN_DIR ? (SITE_IN_DIR . '/') : '';
|
||||
$lang = LANG == DEF_LANG ? '' : (LANG . '/');
|
||||
$ret = $lang || $uri ? "/{$dir}?q={$lang}{$uri}" : "/{$dir}";
|
||||
$ret = empty($ret) ? '/' : $ret;
|
||||
$ret = $g_config['useModRewrite'] ?
|
||||
_StrReplaceFirst('/?q=', '/', _StrReplaceFirst('&', '?', $ret)) :
|
||||
$ret;
|
||||
$ret = SITE_ROOT . substr($ret , 1);
|
||||
|
||||
// Заменяем начальную страницу в URL а просто корень
|
||||
$ret = in_array(
|
||||
$ret,
|
||||
array(
|
||||
SITE_ROOT . $g_config['defaultComponent'],
|
||||
SITE_ROOT . '?q=' . $g_config['defaultComponent']
|
||||
)
|
||||
) ?
|
||||
SITE_ROOT :
|
||||
$ret;
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// Возвращает дебаг панель располагаемую внизу страницу
|
||||
function GetDebug()
|
||||
{
|
||||
global $g_config;
|
||||
|
||||
$ret = '';
|
||||
// Выводить дебаг-панель только если это режим отладки и только если страница прошла через главный шаблон
|
||||
if (DEBUG_MODE && $g_config['isLoadInMainTpl'])
|
||||
{
|
||||
ob_start();
|
||||
IncludeCom('dev/debug_panel');
|
||||
return ob_get_clean();
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function _PrepareContent($c)
|
||||
{
|
||||
global $g_config;
|
||||
|
||||
require_once BASEPATH . 'lib/ExtraPacker/Config.php';
|
||||
require_once BASEPATH . 'lib/ExtraPacker/ExtraPacker.php';
|
||||
require_once BASEPATH . 'lib/HtmlValidate.php';
|
||||
|
||||
$validator = new HtmlValidate($c);
|
||||
$c = $validator->Get();
|
||||
|
||||
$postfix = str_replace ("/", "", strtok($_SERVER["REQUEST_URI"],'?'));
|
||||
|
||||
$cfg = $g_config['extrapacker'];
|
||||
$extraPacker = new ExtraPacker(
|
||||
array('ExtraPacker_Config', 'GetPathJsFileFromUrl'),
|
||||
array('ExtraPacker_Config', 'GetPathCssFileFromUrl'),
|
||||
array('ExtraPacker_Config', 'GetAddrJsPackFile'),
|
||||
array('ExtraPacker_Config', 'GetAddrCssPackFile'),
|
||||
NULL,
|
||||
NULL,
|
||||
BASEPATH . 'tmp/' . $cfg['dir'] . "/js/$postfix/inf.txt",
|
||||
BASEPATH . 'tmp/' . $cfg['dir'] . "/js/$postfix/js.js",
|
||||
BASEPATH . 'tmp/' . $cfg['dir'] . "/css/$postfix/inf.txt",
|
||||
BASEPATH . 'tmp/' . $cfg['dir'] . "/css/$postfix/css.css",
|
||||
$cfg['packHtml'],
|
||||
$cfg['packCss'],
|
||||
$cfg['packJs'],
|
||||
$cfg['arrExeptions_js'],
|
||||
$cfg['arrExeptionsNotAdd_js'],
|
||||
$cfg['arrExeptions_css'],
|
||||
$cfg['arrExeptionsNotAdd_css'],
|
||||
true,
|
||||
BASEPATH . 'tmp/' . $cfg['dir'] . "/js/$postfix/trans.txt",
|
||||
BASEPATH . 'tmp/' . $cfg['dir'] . "/css/$postfix/trans.txt",
|
||||
$cfg['buffering'],
|
||||
array('ExtraPacker_Config', 'PrepareEachFile'),
|
||||
array('ExtraPacker_Config', 'PrepareAllCss'),
|
||||
array('ExtraPacker_Config', 'PrepareAllJs')
|
||||
);
|
||||
return $extraPacker->Pack($c) . GetDebug();
|
||||
}
|
||||
|
||||
/**
|
||||
* Функиця подготовки вывода контента в браузер
|
||||
*/
|
||||
function PrepareContent($c)
|
||||
{
|
||||
global $g_config;
|
||||
|
||||
foreach ($g_config['prepareFunctions'] as $func)
|
||||
{
|
||||
$c = call_user_func($func, $c);
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Параметр из $_GET
|
||||
*/
|
||||
function Get($name, $def = false, $secureFlags = 0)
|
||||
{
|
||||
return isset($_GET[$name]) ? _Clean($_GET[$name], $secureFlags) : $def;
|
||||
}
|
||||
|
||||
/**
|
||||
* Параметр из $_POST
|
||||
*/
|
||||
function Post($name, $def = false, $secureFlags = 0)
|
||||
{
|
||||
return isset($_POST[$name]) ? _Clean($_POST[$name], $secureFlags) : $def;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получение текущей строки запроса к движку (удобно юзать в action для формы если это компоннет)
|
||||
*/
|
||||
function GetCurUrl($_pars = '')
|
||||
{
|
||||
$pars = '';
|
||||
$all = $_GET;
|
||||
|
||||
foreach (array_filter(explode('&', $_pars)) as $v)
|
||||
{
|
||||
if (strpos($v, '=') === false)
|
||||
{
|
||||
$all[$v] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$t = explode('=', $v);
|
||||
list($id, $val) = $t;
|
||||
$all[$id] = urldecode($val);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($all as $k => $v)
|
||||
{
|
||||
if ($k == 'q') continue;
|
||||
if ($v == M_DELETE_PARAM) continue;
|
||||
$pars .= ("{$k}=" . urlencode($v) . "&");
|
||||
}
|
||||
$pars = substr($pars, 0, -1) ? ('&' . substr($pars, 0, -1)) : '';
|
||||
return SiteRoot(GetQuery() . $pars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Переопределяем функцию автозагрузки классов
|
||||
*/
|
||||
function _AutoLoadLib($className)
|
||||
{
|
||||
if (is_readable(BASEPATH . "lib/{$className}.php"))
|
||||
{
|
||||
require_once BASEPATH . "lib/{$className}.php";
|
||||
}
|
||||
if (is_readable(BASEPATH . "model/{$className}.php"))
|
||||
{
|
||||
require_once BASEPATH . "model/{$className}.php";
|
||||
}
|
||||
}
|
||||
spl_autoload_register('_AutoLoadLib');
|
||||
|
||||
/**
|
||||
* Функция установки title/desk/kw если страница не главная и не было установлено значений до этого
|
||||
*/
|
||||
function AutoTDKW($content)
|
||||
{
|
||||
global $g_lang, $g_config;
|
||||
|
||||
if ($g_config['autoGetTitle']) // Только если это не главная, ибо там то по любому выставлено
|
||||
{
|
||||
if (L('m_title') === L('m_defTitle'))
|
||||
{
|
||||
preg_match('~<h1(.*?)>(.*?)</h1>~is', $content, $m);
|
||||
if (isset($m[2]))
|
||||
{
|
||||
$g_lang['m_title'] = strip_tags($m[2]) . L('m_titlePostfix');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Получить параметр из языкового массива
|
||||
function L($name)
|
||||
{
|
||||
global $g_lang;
|
||||
if (!isset($g_lang[$name]))
|
||||
{
|
||||
trigger_error("Unknown lang ($name) variable", E_USER_ERROR);
|
||||
}
|
||||
return $g_lang[$name];
|
||||
}
|
||||
?>
|
26
core/func/messages.php
Executable file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Стилистически оформленные сообщения
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
|
||||
|
||||
function Msg($message, $css = 'msg')
|
||||
{
|
||||
ob_start();
|
||||
IncludeCom('dev/msg', array('message' => $message, 'css' => $css));
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
function MsgOk($message)
|
||||
{
|
||||
return Msg($message, 'msg-ok');
|
||||
}
|
||||
|
||||
function MsgErr($message)
|
||||
{
|
||||
return Msg($message, 'msg-err');
|
||||
}
|
||||
?>
|
22
core/func/order_files_by_date.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
function __FilesCmpByDate($f1, $f2)
|
||||
{
|
||||
$m1 = filemtime($f1);
|
||||
$m2 = filemtime($f2);
|
||||
if ($m1 == $m2)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return ($m1 < $m2) ? 1 : -1;
|
||||
}
|
||||
|
||||
function OrderFilesByDate($list)
|
||||
{
|
||||
if (count($list))
|
||||
{
|
||||
usort($list, "__FilesCmpByDate");
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
?>
|
35
core/func/page_editor.php
Executable file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Рекурсивно получить все файлы и папки
|
||||
*/
|
||||
function PageEditorGetListFilesDirs($folder, &$allFiles)
|
||||
{
|
||||
$fp = is_readable($folder) ? opendir($folder) : false;
|
||||
if ($fp)
|
||||
{
|
||||
$file = readdir($fp);
|
||||
|
||||
while ($file !== false)
|
||||
{
|
||||
$path = $folder . "/" . $file;
|
||||
|
||||
if (is_file($path))
|
||||
{
|
||||
if (substr($path, -4) == ".php")
|
||||
{
|
||||
$allFiles[] = $folder . "/" . $file;
|
||||
}
|
||||
}
|
||||
elseif ($file != "." && $file != ".." && is_dir($path))
|
||||
{
|
||||
$allFiles[] = $folder . "/" . $file . "/";
|
||||
PageEditorGetListFilesDirs($path, $allFiles);
|
||||
}
|
||||
|
||||
$file = readdir($fp);
|
||||
}
|
||||
closedir($fp);
|
||||
}
|
||||
}
|
||||
?>
|
30
core/func/validation.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Функции для валидации данных
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
|
||||
|
||||
function IsValidEmail($email)
|
||||
{
|
||||
return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
|
||||
}
|
||||
|
||||
function PhoneFilter($phone)
|
||||
{
|
||||
return preg_replace("~[^\+\*|^0-9]~is", '', $phone);
|
||||
}
|
||||
|
||||
function IsValidPhone($phone)
|
||||
{
|
||||
$phone = PhoneFilter($phone);
|
||||
return strlen($phone) > 5;
|
||||
}
|
||||
|
||||
function IsValidUrl($url)
|
||||
{
|
||||
return filter_var($url, FILTER_VALIDATE_URL) !== false;
|
||||
}
|
||||
?>
|
32
core/init/admin_menu.php
Executable file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
// Этот файл должен вызываться, когда меню уже заполнено. Добавляем в конце кнопку 'выход':
|
||||
$g_config['admin_menu'][] = array
|
||||
(
|
||||
'link' => SiteRoot('admin/logout'),
|
||||
'name' => '<span class="glyphicon glyphicon-log-out"></span>',
|
||||
'label' => 'Выйти',
|
||||
'css' => '',
|
||||
'list' => array()
|
||||
);
|
||||
|
||||
// Выделяем нужный элемент в меню:
|
||||
foreach ($g_config['admin_menu'] as $k => $v)
|
||||
{
|
||||
// Выделять если это текущая страница или страница в ее выподающем списке
|
||||
$links = array($v['link']);
|
||||
foreach ($v['list'] as $subLink)
|
||||
{
|
||||
if (is_array($subLink))
|
||||
{
|
||||
$links[] = $subLink['link'];
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array(GetCurUrl(), $links))
|
||||
{
|
||||
$v['css'] = empty($v['css']) ? 'active' : "{$v['css']} active";
|
||||
$g_config['admin_menu'][$k] = $v;
|
||||
}
|
||||
}
|
||||
?>
|
25
core/init/admin_sector.php
Executable file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once BASEPATH . 'core/init/db.php';
|
||||
|
||||
// Изначальная папка нам может понадобится для CKEditor
|
||||
$g_config['extrapacker']['non_admin_dir'] = $g_config['extrapacker']['dir'];
|
||||
|
||||
// Проверяем вход в админку и авторизацию
|
||||
$isAdminSector = (stripos(strtolower(GetQuery()), 'admin/') === 0 || GetQuery() === 'admin');
|
||||
if ($isAdminSector)
|
||||
{
|
||||
// Меняем папку куда будут складироваться css/js админки
|
||||
$g_config['extrapacker']['dir'] = 'extrapacker_admin';
|
||||
$g_config['extrapacker']['packCss'] = false;
|
||||
$g_config['mainTpl'] = 'admin/main_tpl';
|
||||
|
||||
$g_adminAuth = new AdminModel();
|
||||
$g_adminAuth->ChkLogin();
|
||||
define('IS_ADMIN_AUTH', $g_adminAuth->IsAuth());
|
||||
}
|
||||
else
|
||||
{
|
||||
define('IS_ADMIN_AUTH', false);
|
||||
}
|
||||
?>
|
12
core/init/db.php
Executable file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Инициализация подключей ко всем БД и подключение моделей
|
||||
*
|
||||
* @author Zmi
|
||||
*/
|
||||
|
||||
|
||||
require_once BASEPATH . 'lib/Db/Db.php';
|
||||
new Db();
|
||||
?>
|
28
core/init/main.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
new Php(); // Настройка php и включение слежки за ошибками
|
||||
header('Content-type: text/html; charset=' . $g_config['charset']);
|
||||
|
||||
GetQuery(); // Что бы определился язык сайта
|
||||
|
||||
// Подключаем все языковые файлы из автозагруки
|
||||
$dirs = array_unique(
|
||||
array(
|
||||
BASEPATH . 'lang/' . DEF_LANG . '/autoload/',
|
||||
BASEPATH . 'lang/' . LANG . '/autoload/'
|
||||
)
|
||||
);
|
||||
$g_lang = array();
|
||||
foreach ($dirs as $dir)
|
||||
{
|
||||
$files = array_merge(array($dir . 'main.php'), glob($dir . "*.php"));
|
||||
foreach ($files as $f)
|
||||
{
|
||||
if (is_readable($f))
|
||||
{
|
||||
require_once $f;
|
||||
}
|
||||
}
|
||||
}
|
||||
$g_lang['m_defTitle'] = L('m_title');
|
||||
?>
|
10
en/wiki/.htaccess
Normal file
@ -0,0 +1,10 @@
|
||||
# Use mod_rewrite to enable "Clean URLs" for a PmWiki installation.
|
||||
RewriteEngine On
|
||||
# Define the rewrite base.
|
||||
RewriteBase /en/wiki
|
||||
# Send requests without parameters to pmwiki.php.
|
||||
RewriteRule ^$ pmwiki.php [L]
|
||||
# Send requests for index.php to pmwiki.php.
|
||||
RewriteRule ^index\.php$ pmwiki.php [L]
|
||||
# Send requests to pmwiki.php, appending the query string part.
|
||||
RewriteRule ^([A-Z0-9\xa0-\xff].*)$ pmwiki.php?n=$1 [QSA,L]
|
48
en/wiki/README.txt
Normal file
@ -0,0 +1,48 @@
|
||||
This is the README.txt file for PmWiki, a wiki-based system for
|
||||
collaborative creation and maintenance of websites.
|
||||
|
||||
PmWiki is distributed with the following directories:
|
||||
|
||||
docs/ Brief documentation, sample configuration scripts
|
||||
local/ Configuration scripts
|
||||
cookbook/ Recipes (add-ons) from the PmWiki Cookbook
|
||||
pub/skins/ Layout templates ("skins" for custom look and feel)
|
||||
pub/css/ Extra CSS stylesheet files
|
||||
pub/guiedit/ Files for the Edit Form's GUIEdit module
|
||||
scripts/ Scripts that are part of PmWiki
|
||||
wikilib.d/ Bundled wiki pages, including
|
||||
* a default Home Page
|
||||
* PmWiki documentation pages
|
||||
* some Site-oriented pages
|
||||
|
||||
After PmWiki is installed the following directories may also exist:
|
||||
|
||||
wiki.d/ Wiki pages
|
||||
uploads/ Uploaded files (page attachments)
|
||||
|
||||
For quick installation advice, see docs/INSTALL.txt.
|
||||
|
||||
For more extensive information about installing PmWiki, visit
|
||||
http://pmwiki.org/wiki/PmWiki/Installation
|
||||
|
||||
For information about running PmWiki in standalone mode without
|
||||
requiring a webserver, visit
|
||||
http://pmwiki.org/wiki/Cookbook/Standalone
|
||||
|
||||
PmWiki is Copyright 2001-2006 Patrick R. Michaud
|
||||
pmichaud@pobox.com
|
||||
http://www.pmichaud.com/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
The GNU General Public License is distributed with this program
|
||||
(see docs/COPYING.txt) and it is also available online at
|
||||
http://www.fsf.org/licensing/licenses/gpl.txt .
|
12
en/wiki/cookbook/.htaccess
Normal file
@ -0,0 +1,12 @@
|
||||
# This file is cookbook/.htaccess -- the default distribution contains this
|
||||
# file to prevent cookbook/ scripts from being accessed directly by browsers
|
||||
# (this is a potential, albeit very unlikely, security hole).
|
||||
#
|
||||
# If you alter or replace this file, it will likely be overwritten when
|
||||
# you upgrade from one version of PmWiki to another. Be sure to save
|
||||
# a copy of your alterations in another location so you can restore them,
|
||||
# and you might try changing this file to be read-only to prevent a PmWiki
|
||||
# upgrade from overwriting your altered version.
|
||||
|
||||
Order Deny,Allow
|
||||
Deny from all
|
1
en/wiki/docs/.htaccess
Normal file
@ -0,0 +1 @@
|
||||
AddType text/plain .php
|
340
en/wiki/docs/COPYING.txt
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
10
en/wiki/docs/DOCUMENTATION.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Where is the documentation?
|
||||
|
||||
PmWiki maintains its documentation as wiki pages.
|
||||
If you already have PmWiki installed, then a local copy of
|
||||
the documentation is available through PmWiki itself --
|
||||
see the "PmWiki.DocumentationIndex" page on your site.
|
||||
|
||||
The documentation is also available online at
|
||||
http://www.pmwiki.org/wiki/PmWiki/DocumentationIndex .
|
||||
|
39
en/wiki/docs/INSTALL.txt
Normal file
@ -0,0 +1,39 @@
|
||||
This is the INSTALL.txt file for PmWiki. This document provides
|
||||
convenient steps so an administrator can have a PmWiki site up and
|
||||
running quickly. More extensive information about installing PmWiki
|
||||
is available at http://www.pmwiki.org/wiki/PmWiki/Installation .
|
||||
|
||||
Once your site is up and running you will be able to read the bundled
|
||||
documentation pages.
|
||||
|
||||
Here are some quick steps to start you on your path toward a complete,
|
||||
customized installation:
|
||||
|
||||
1a) Put the software in a location accessible by your webserver.
|
||||
|
||||
1b) PmWiki can also be run if no webserver is installed. See
|
||||
http://pmwiki.org/wiki/Cookbook/Standalone
|
||||
|
||||
2) Point your browser to pmwiki.php.
|
||||
|
||||
3) You may see an error message saying that PmWiki needs to have
|
||||
a writable wiki.d/ directory. If so, follow the directions to
|
||||
establish one. This directory will hold your wiki page files.
|
||||
|
||||
4) If you want a directory index file, create a file called index.php
|
||||
in the main directory that contains the following single line of
|
||||
text, purposefully without a closing "?>":
|
||||
|
||||
<?php include('pmwiki.php');
|
||||
|
||||
5) Sitewide configuration settings will go in a "local configuration
|
||||
file" named local/config.php. Copy the well-commented sample
|
||||
configuration file from docs/sample-config.php to the local/
|
||||
subdirectory, then rename the copy to config.php. Edit your
|
||||
new local/config.php file to suit your preferences.
|
||||
|
||||
That's it. Next you'll probably want to browse your new site and
|
||||
read the bundled documentation. A good place to start is the
|
||||
PmWiki.InitialSetupTasks page.
|
||||
|
||||
Enjoy!
|
50
en/wiki/docs/UPGRADE.txt
Normal file
@ -0,0 +1,50 @@
|
||||
This UPGRADE.txt file is a command-line syntax reminder for
|
||||
experienced PmWiki administrators. For full documentation on
|
||||
upgrading Pmwiki, see the bundled PmWiki.Upgrades page or visit
|
||||
|
||||
http://www.pmwiki.org/wiki/PmWiki/Upgrades
|
||||
|
||||
See also these related pages:
|
||||
|
||||
http://www.pmwiki.org/wiki/PmWiki/BackupAndRestore
|
||||
http://www.pmwiki.org/wiki/PmWiki/Subversion
|
||||
|
||||
The examples assume your PmWiki site is in a ./pmwiki/
|
||||
directory (a directory named "pmwiki" immediately below the
|
||||
working directory).
|
||||
|
||||
Backing up (always a good idea!):
|
||||
|
||||
tar -zcvf ~/pmwiki-backup.tar.gz pmwiki
|
||||
zip -9r ~/pmwiki-backup.zip pmwiki
|
||||
|
||||
Or, to keep backups organized by date:
|
||||
|
||||
tar -zcvf ~/pmwiki-site-`date +%Y%m%d%M`.tar.gz pmwiki
|
||||
zip -9r ~/pmwiki-site-`date +%Y%m%d%M`.zip pmwiki
|
||||
|
||||
The latest release is available here:
|
||||
|
||||
http://www.pmichaud.com/pub/pmwiki/pmwiki-latest.tgz
|
||||
http://www.pmichaud.com/pub/pmwiki/pmwiki-latest.zip
|
||||
|
||||
Example download commands:
|
||||
|
||||
wget http://www.pmichaud.com/pub/pmwiki/pmwiki-latest.tgz
|
||||
lftpget http://www.pmichaud.com/pub/pmwiki/pmwiki-latest.tgz
|
||||
links http://www.pmichaud.com/pub/pmwiki/pmwiki-latest.tgz
|
||||
lynx http://www.pmichaud.com/pub/pmwiki/pmwiki-latest.tgz
|
||||
|
||||
Expanding the archive:
|
||||
|
||||
tar -zxvf pmwiki-latest.tgz # for the gzipped tarball
|
||||
unzip pmwiki-latest.zip # for the .zip archive
|
||||
|
||||
Copying the files (two ways to do it):
|
||||
|
||||
cp -av pmwiki-2.1.x/. pmwiki
|
||||
cp -Rpv pmwiki-2.1.x/. pmwiki
|
||||
|
||||
Subversion upgrade:
|
||||
|
||||
svn export svn://pmwiki.org/pmwiki/tags/latest pmwiki --force
|
161
en/wiki/docs/sample-config.php
Normal file
@ -0,0 +1,161 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
## This is a sample config.php file. To use this file, copy it to
|
||||
## local/config.php, then edit it for whatever customizations you want.
|
||||
## Also, be sure to take a look at http://www.pmwiki.org/wiki/Cookbook
|
||||
## for more details on the types of customizations that can be added
|
||||
## to PmWiki.
|
||||
|
||||
## $WikiTitle is the name that appears in the browser's title bar.
|
||||
$WikiTitle = 'PmWiki';
|
||||
|
||||
## $ScriptUrl is your preferred URL for accessing wiki pages
|
||||
## $PubDirUrl is the URL for the pub directory.
|
||||
# $ScriptUrl = 'http://www.mydomain.com/path/to/pmwiki.php';
|
||||
# $PubDirUrl = 'http://www.mydomain.com/path/to/pub';
|
||||
|
||||
## If you want to use URLs of the form .../pmwiki.php/Group/PageName
|
||||
## instead of .../pmwiki.php?p=Group.PageName, try setting
|
||||
## $EnablePathInfo below. Note that this doesn't work in all environments,
|
||||
## it depends on your webserver and PHP configuration. You might also
|
||||
## want to check http://www.pmwiki.org/wiki/Cookbook/CleanUrls more
|
||||
## details about this setting and other ways to create nicer-looking urls.
|
||||
# $EnablePathInfo = 1;
|
||||
|
||||
## $PageLogoUrl is the URL for a logo image -- you can change this
|
||||
## to your own logo if you wish.
|
||||
# $PageLogoUrl = "$PubDirUrl/skins/pmwiki/pmwiki-32.gif";
|
||||
|
||||
## If you want to have a custom skin, then set $Skin to the name
|
||||
## of the directory (in pub/skins/) that contains your skin files.
|
||||
## See PmWiki.Skins and Cookbook.Skins.
|
||||
# $Skin = 'pmwiki';
|
||||
|
||||
## You'll probably want to set an administrative password that you
|
||||
## can use to get into password-protected pages. Also, by default
|
||||
## the "attr" passwords for the PmWiki and Main groups are locked, so
|
||||
## an admin password is a good way to unlock those. See PmWiki.Passwords
|
||||
## and PmWiki.PasswordsAdmin.
|
||||
# $DefaultPasswords['admin'] = pmcrypt('secret');
|
||||
|
||||
## Unicode (UTF-8) allows the display of all languages and all alphabets.
|
||||
## Highly recommended for new wikis.
|
||||
include_once("scripts/xlpage-utf-8.php");
|
||||
|
||||
## If you're running a publicly available site and allow anyone to
|
||||
## edit without requiring a password, you probably want to put some
|
||||
## blocklists in place to avoid wikispam. See PmWiki.Blocklist.
|
||||
# $EnableBlocklist = 1; # enable manual blocklists
|
||||
# $EnableBlocklist = 10; # enable automatic blocklists
|
||||
|
||||
## PmWiki comes with graphical user interface buttons for editing;
|
||||
## to enable these buttons, set $EnableGUIButtons to 1.
|
||||
# $EnableGUIButtons = 1;
|
||||
|
||||
## To enable markup syntax from the Creole common wiki markup language
|
||||
## (http://www.wikicreole.org/), include it here:
|
||||
# include_once("scripts/creole.php");
|
||||
|
||||
## Some sites may want leading spaces on markup lines to indicate
|
||||
## "preformatted text blocks", set $EnableWSPre=1 if you want to do
|
||||
## this. Setting it to a higher number increases the number of
|
||||
## space characters required on a line to count as "preformatted text".
|
||||
# $EnableWSPre = 1; # lines beginning with space are preformatted (default)
|
||||
# $EnableWSPre = 4; # lines with 4 or more spaces are preformatted
|
||||
# $EnableWSPre = 0; # disabled
|
||||
|
||||
## If you want uploads enabled on your system, set $EnableUpload=1.
|
||||
## You'll also need to set a default upload password, or else set
|
||||
## passwords on individual groups and pages. For more information
|
||||
## see PmWiki.UploadsAdmin.
|
||||
# $EnableUpload = 1;
|
||||
# $UploadPermAdd = 0;
|
||||
# $DefaultPasswords['upload'] = pmcrypt('secret');
|
||||
|
||||
## Setting $EnableDiag turns on the ?action=diag and ?action=phpinfo
|
||||
## actions, which often helps others to remotely troubleshoot
|
||||
## various configuration and execution problems.
|
||||
# $EnableDiag = 1; # enable remote diagnostics
|
||||
|
||||
## By default, PmWiki doesn't allow browsers to cache pages. Setting
|
||||
## $EnableIMSCaching=1; will re-enable browser caches in a somewhat
|
||||
## smart manner. Note that you may want to have caching disabled while
|
||||
## adjusting configuration files or layout templates.
|
||||
# $EnableIMSCaching = 1; # allow browser caching
|
||||
|
||||
## Set $SpaceWikiWords if you want WikiWords to automatically
|
||||
## have spaces before each sequence of capital letters.
|
||||
# $SpaceWikiWords = 1; # turn on WikiWord spacing
|
||||
|
||||
## Set $EnableWikiWords if you want to allow WikiWord links.
|
||||
## For more options with WikiWords, see scripts/wikiwords.php .
|
||||
# $EnableWikiWords = 1; # enable WikiWord links
|
||||
|
||||
## $DiffKeepDays specifies the minimum number of days to keep a page's
|
||||
## revision history. The default is 3650 (approximately 10 years).
|
||||
# $DiffKeepDays=30; # keep page history at least 30 days
|
||||
|
||||
## By default, viewers are prevented from seeing the existence
|
||||
## of read-protected pages in search results and page listings,
|
||||
## but this can be slow as PmWiki has to check the permissions
|
||||
## of each page. Setting $EnablePageListProtect to zero will
|
||||
## speed things up considerably, but it will also mean that
|
||||
## viewers may learn of the existence of read-protected pages.
|
||||
## (It does not enable them to access the contents of the pages.)
|
||||
# $EnablePageListProtect = 0;
|
||||
|
||||
## The refcount.php script enables ?action=refcount, which helps to
|
||||
## find missing and orphaned pages. See PmWiki.RefCount.
|
||||
# if ($action == 'refcount') include_once("scripts/refcount.php");
|
||||
|
||||
## The feeds.php script enables ?action=rss, ?action=atom, ?action=rdf,
|
||||
## and ?action=dc, for generation of syndication feeds in various formats.
|
||||
# if ($action == 'rss') include_once("scripts/feeds.php"); # RSS 2.0
|
||||
# if ($action == 'atom') include_once("scripts/feeds.php"); # Atom 1.0
|
||||
# if ($action == 'dc') include_once("scripts/feeds.php"); # Dublin Core
|
||||
# if ($action == 'rdf') include_once("scripts/feeds.php"); # RSS 1.0
|
||||
|
||||
## In the 2.2.0-beta series, {$var} page variables were absolute, but now
|
||||
## relative page variables provide greater flexibility and are recommended.
|
||||
## (If you're starting a new site, it's best to leave this setting alone.)
|
||||
# $EnableRelativePageVars = 1; # 1=relative; 0=absolute
|
||||
|
||||
## By default, pages in the Category group are manually created.
|
||||
## Uncomment the following line to have blank category pages
|
||||
## automatically created whenever a link to a non-existent
|
||||
## category page is saved. (The page is created only if
|
||||
## the author has edit permissions to the Category group.)
|
||||
# $AutoCreate['/^Category\\./'] = array('ctime' => $Now);
|
||||
|
||||
## PmWiki allows a great deal of flexibility for creating custom markup.
|
||||
## To add support for '*bold*' and '~italic~' markup (the single quotes
|
||||
## are part of the markup), uncomment the following lines.
|
||||
## (See PmWiki.CustomMarkup and the Cookbook for details and examples.)
|
||||
# Markup("'~", "inline", "/'~(.*?)~'/", "<i>$1</i>"); # '~italic~'
|
||||
# Markup("'*", "inline", "/'\\*(.*?)\\*'/", "<b>$1</b>"); # '*bold*'
|
||||
|
||||
## If you want to have to approve links to external sites before they
|
||||
## are turned into links, uncomment the line below. See PmWiki.UrlApprovals.
|
||||
## Also, setting $UnapprovedLinkCountMax limits the number of unapproved
|
||||
## links that are allowed in a page (useful to control wikispam).
|
||||
# $UnapprovedLinkCountMax = 10;
|
||||
# include_once("scripts/urlapprove.php");
|
||||
|
||||
## The following lines make additional editing buttons appear in the
|
||||
## edit page for subheadings, lists, tables, etc.
|
||||
# $GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
|
||||
# '$GUIButtonDirUrlFmt/h2.gif"$[Heading]"');
|
||||
# $GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
|
||||
# '$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"');
|
||||
# $GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]',
|
||||
# '$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"');
|
||||
# $GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]',
|
||||
# '$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"');
|
||||
# $GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]',
|
||||
# '$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"');
|
||||
# $GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
|
||||
# '$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"');
|
||||
# $GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
|
||||
# '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
|
||||
# $GUIButtons['table'] = array(600,
|
||||
# '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '',
|
||||
# '$GUIButtonDirUrlFmt/table.gif"$[Table]"');
|
12
en/wiki/local/.htaccess
Normal file
@ -0,0 +1,12 @@
|
||||
# This file is local/.htaccess -- the default distribution contains this
|
||||
# file to prevent local/ scripts from being accessed directly by browsers
|
||||
# (this is a potential, albeit very unlikely, security hole).
|
||||
#
|
||||
# If you alter or replace this file, it will likely be overwritten when
|
||||
# you upgrade from one version of PmWiki to another. Be sure to save
|
||||
# a copy of your alterations in another location so you can restore them,
|
||||
# and you might try changing this file to be read-only to prevent a PmWiki
|
||||
# upgrade from overwriting your altered version.
|
||||
|
||||
Order Deny,Allow
|
||||
Deny from all
|
177
en/wiki/local/config.php
Normal file
@ -0,0 +1,177 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
## This is a sample config.php file. To use this file, copy it to
|
||||
## local/config.php, then edit it for whatever customizations you want.
|
||||
## Also, be sure to take a look at http://www.pmwiki.org/wiki/Cookbook
|
||||
## for more details on the types of customizations that can be added
|
||||
## to PmWiki.
|
||||
|
||||
## $WikiTitle is the name that appears in the browser's title bar.
|
||||
$WikiTitle = 'Graph Online Wiki';
|
||||
|
||||
## $ScriptUrl is your preferred URL for accessing wiki pages
|
||||
## $PubDirUrl is the URL for the pub directory.
|
||||
$ScriptUrl = '/en/wiki';
|
||||
# $PubDirUrl = 'http://www.mydomain.com/path/to/pub';
|
||||
|
||||
## If you want to use URLs of the form .../pmwiki.php/Group/PageName
|
||||
## instead of .../pmwiki.php?p=Group.PageName, try setting
|
||||
## $EnablePathInfo below. Note that this doesn't work in all environments,
|
||||
## it depends on your webserver and PHP configuration. You might also
|
||||
## want to check http://www.pmwiki.org/wiki/Cookbook/CleanUrls more
|
||||
## details about this setting and other ways to create nicer-looking urls.
|
||||
$EnablePathInfo = 1;
|
||||
|
||||
## $PageLogoUrl is the URL for a logo image -- you can change this
|
||||
## to your own logo if you wish.
|
||||
$PageLogoUrl = "$PubDirUrl/graphonline.png";
|
||||
|
||||
## If you want to have a custom skin, then set $Skin to the name
|
||||
## of the directory (in pub/skins/) that contains your skin files.
|
||||
## See PmWiki.Skins and Cookbook.Skins.
|
||||
$Skin = 'graph';
|
||||
|
||||
## You'll probably want to set an administrative password that you
|
||||
## can use to get into password-protected pages. Also, by default
|
||||
## the "attr" passwords for the PmWiki and Main groups are locked, so
|
||||
## an admin password is a good way to unlock those. See PmWiki.Passwords
|
||||
## and PmWiki.PasswordsAdmin.
|
||||
$DefaultPasswords['admin'] = pmcrypt('password');
|
||||
|
||||
## Unicode (UTF-8) allows the display of all languages and all alphabets.
|
||||
## Highly recommended for new wikis.
|
||||
include_once("scripts/xlpage-utf-8.php");
|
||||
|
||||
## If you're running a publicly available site and allow anyone to
|
||||
## edit without requiring a password, you probably want to put some
|
||||
## blocklists in place to avoid wikispam. See PmWiki.Blocklist.
|
||||
# $EnableBlocklist = 1; # enable manual blocklists
|
||||
$EnableBlocklist = 10; # enable automatic blocklists
|
||||
|
||||
## PmWiki comes with graphical user interface buttons for editing;
|
||||
## to enable these buttons, set $EnableGUIButtons to 1.
|
||||
$EnableGUIButtons = 1;
|
||||
|
||||
## To enable markup syntax from the Creole common wiki markup language
|
||||
## (http://www.wikicreole.org/), include it here:
|
||||
# include_once("scripts/creole.php");
|
||||
|
||||
## Some sites may want leading spaces on markup lines to indicate
|
||||
## "preformatted text blocks", set $EnableWSPre=1 if you want to do
|
||||
## this. Setting it to a higher number increases the number of
|
||||
## space characters required on a line to count as "preformatted text".
|
||||
# $EnableWSPre = 1; # lines beginning with space are preformatted (default)
|
||||
# $EnableWSPre = 4; # lines with 4 or more spaces are preformatted
|
||||
# $EnableWSPre = 0; # disabled
|
||||
|
||||
## If you want uploads enabled on your system, set $EnableUpload=1.
|
||||
## You'll also need to set a default upload password, or else set
|
||||
## passwords on individual groups and pages. For more information
|
||||
## see PmWiki.UploadsAdmin.
|
||||
$EnableUpload = 1;
|
||||
$UploadExts = array(
|
||||
'gif' => 'image/gif',
|
||||
'jpeg' => 'image/jpeg',
|
||||
'jpg' => 'image/jpeg',
|
||||
'png' => 'image/png',
|
||||
'xxx' => 'yyyy/zzz'
|
||||
);
|
||||
|
||||
# $UploadPermAdd = 0;
|
||||
# $DefaultPasswords['upload'] = pmcrypt('uploADme');
|
||||
|
||||
## Setting $EnableDiag turns on the ?action=diag and ?action=phpinfo
|
||||
## actions, which often helps others to remotely troubleshoot
|
||||
## various configuration and execution problems.
|
||||
# $EnableDiag = 1; # enable remote diagnostics
|
||||
|
||||
## By default, PmWiki doesn't allow browsers to cache pages. Setting
|
||||
## $EnableIMSCaching=1; will re-enable browser caches in a somewhat
|
||||
## smart manner. Note that you may want to have caching disabled while
|
||||
## adjusting configuration files or layout templates.
|
||||
# $EnableIMSCaching = 1; # allow browser caching
|
||||
|
||||
## Set $SpaceWikiWords if you want WikiWords to automatically
|
||||
## have spaces before each sequence of capital letters.
|
||||
# $SpaceWikiWords = 1; # turn on WikiWord spacing
|
||||
|
||||
## Set $EnableWikiWords if you want to allow WikiWord links.
|
||||
## For more options with WikiWords, see scripts/wikiwords.php .
|
||||
# $EnableWikiWords = 1; # enable WikiWord links
|
||||
|
||||
## $DiffKeepDays specifies the minimum number of days to keep a page's
|
||||
## revision history. The default is 3650 (approximately 10 years).
|
||||
$DiffKeepDays=30; # keep page history at least 30 days
|
||||
|
||||
## By default, viewers are prevented from seeing the existence
|
||||
## of read-protected pages in search results and page listings,
|
||||
## but this can be slow as PmWiki has to check the permissions
|
||||
## of each page. Setting $EnablePageListProtect to zero will
|
||||
## speed things up considerably, but it will also mean that
|
||||
## viewers may learn of the existence of read-protected pages.
|
||||
## (It does not enable them to access the contents of the pages.)
|
||||
# $EnablePageListProtect = 0;
|
||||
|
||||
## The refcount.php script enables ?action=refcount, which helps to
|
||||
## find missing and orphaned pages. See PmWiki.RefCount.
|
||||
# if ($action == 'refcount') include_once("scripts/refcount.php");
|
||||
|
||||
## The feeds.php script enables ?action=rss, ?action=atom, ?action=rdf,
|
||||
## and ?action=dc, for generation of syndication feeds in various formats.
|
||||
# if ($action == 'rss') include_once("scripts/feeds.php"); # RSS 2.0
|
||||
# if ($action == 'atom') include_once("scripts/feeds.php"); # Atom 1.0
|
||||
# if ($action == 'dc') include_once("scripts/feeds.php"); # Dublin Core
|
||||
# if ($action == 'rdf') include_once("scripts/feeds.php"); # RSS 1.0
|
||||
|
||||
## In the 2.2.0-beta series, {$var} page variables were absolute, but now
|
||||
## relative page variables provide greater flexibility and are recommended.
|
||||
## (If you're starting a new site, it's best to leave this setting alone.)
|
||||
# $EnableRelativePageVars = 1; # 1=relative; 0=absolute
|
||||
|
||||
## By default, pages in the Category group are manually created.
|
||||
## Uncomment the following line to have blank category pages
|
||||
## automatically created whenever a link to a non-existent
|
||||
## category page is saved. (The page is created only if
|
||||
## the author has edit permissions to the Category group.)
|
||||
# $AutoCreate['/^Category\\./'] = array('ctime' => $Now);
|
||||
|
||||
## PmWiki allows a great deal of flexibility for creating custom markup.
|
||||
## To add support for '*bold*' and '~italic~' markup (the single quotes
|
||||
## are part of the markup), uncomment the following lines.
|
||||
## (See PmWiki.CustomMarkup and the Cookbook for details and examples.)
|
||||
# Markup("'~", "inline", "/'~(.*?)~'/", "<i>$1</i>"); # '~italic~'
|
||||
# Markup("'*", "inline", "/'\\*(.*?)\\*'/", "<b>$1</b>"); # '*bold*'
|
||||
|
||||
## If you want to have to approve links to external sites before they
|
||||
## are turned into links, uncomment the line below. See PmWiki.UrlApprovals.
|
||||
## Also, setting $UnapprovedLinkCountMax limits the number of unapproved
|
||||
## links that are allowed in a page (useful to control wikispam).
|
||||
$UnapprovedLinkCountMax = 1;
|
||||
include_once("scripts/urlapprove.php");
|
||||
|
||||
## The following lines make additional editing buttons appear in the
|
||||
## edit page for subheadings, lists, tables, etc.
|
||||
$GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
|
||||
'$GUIButtonDirUrlFmt/h2.gif"$[Heading]"');
|
||||
$GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
|
||||
'$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"');
|
||||
$GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]',
|
||||
'$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"');
|
||||
$GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]',
|
||||
'$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"');
|
||||
$GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]',
|
||||
'$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"');
|
||||
$GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
|
||||
'$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"');
|
||||
$GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
|
||||
'$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
|
||||
$GUIButtons['table'] = array(600,
|
||||
'||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '',
|
||||
'$GUIButtonDirUrlFmt/table.gif"$[Table]"');
|
||||
|
||||
|
||||
$DefaultGroup = "Help";
|
||||
$DefaultPage = "Help.Help";
|
||||
|
||||
|
||||
$UploadMaxSize = 2000000;
|
||||
|
2261
en/wiki/pmwiki.php
Executable file
BIN
en/wiki/pub/graphonline.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
6
en/wiki/pub/guiedit/README
Normal file
@ -0,0 +1,6 @@
|
||||
The images in this directory are part of the GUIEdit module
|
||||
for PmWiki, Copyright 2005-2006 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
These images are part of PmWiki; you can redistribute it and/or modify
|
||||
them under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
BIN
en/wiki/pub/guiedit/attach.gif
Normal file
After Width: | Height: | Size: 772 B |
BIN
en/wiki/pub/guiedit/big.gif
Normal file
After Width: | Height: | Size: 724 B |
BIN
en/wiki/pub/guiedit/blank.gif
Normal file
After Width: | Height: | Size: 663 B |
BIN
en/wiki/pub/guiedit/center.gif
Normal file
After Width: | Height: | Size: 651 B |
BIN
en/wiki/pub/guiedit/em.gif
Normal file
After Width: | Height: | Size: 710 B |
BIN
en/wiki/pub/guiedit/extlink.gif
Normal file
After Width: | Height: | Size: 716 B |
62
en/wiki/pub/guiedit/guiedit.js
Normal file
@ -0,0 +1,62 @@
|
||||
/* Copyright 2004 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
This file is part of PmWiki; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
||||
|
||||
This file provides Javascript functions to support WYSIWYG-style
|
||||
editing. The concepts are borrowed from the editor used in Wikipedia,
|
||||
but the code has been rewritten from scratch to integrate better with
|
||||
PHP and PmWiki's codebase.
|
||||
*/
|
||||
|
||||
function insButton(mopen, mclose, mtext, mlabel, mkey) {
|
||||
if (mkey > '') { mkey = 'accesskey="' + mkey + '" ' }
|
||||
document.write("<a tabindex='-1' " + mkey + "onclick=\"insMarkup('"
|
||||
+ mopen + "','"
|
||||
+ mclose + "','"
|
||||
+ mtext + "');\">"
|
||||
+ mlabel + "</a>");
|
||||
}
|
||||
|
||||
function insMarkup(mopen, mclose, mtext) {
|
||||
var tarea = document.getElementById('text');
|
||||
if (tarea.setSelectionRange > '') {
|
||||
var p0 = tarea.selectionStart;
|
||||
var p1 = tarea.selectionEnd;
|
||||
var top = tarea.scrollTop;
|
||||
var str = mtext;
|
||||
var cur0 = p0 + mopen.length;
|
||||
var cur1 = p0 + mopen.length + str.length;
|
||||
while (p1 > p0 && tarea.value.substring(p1-1, p1) == ' ') p1--;
|
||||
if (p1 > p0) {
|
||||
str = tarea.value.substring(p0, p1);
|
||||
cur0 = p0 + mopen.length + str.length + mclose.length;
|
||||
cur1 = cur0;
|
||||
}
|
||||
tarea.value = tarea.value.substring(0,p0)
|
||||
+ mopen + str + mclose
|
||||
+ tarea.value.substring(p1);
|
||||
tarea.focus();
|
||||
tarea.selectionStart = cur0;
|
||||
tarea.selectionEnd = cur1;
|
||||
tarea.scrollTop = top;
|
||||
} else if (document.selection) {
|
||||
var str = document.selection.createRange().text;
|
||||
tarea.focus();
|
||||
range = document.selection.createRange()
|
||||
if (str == '') {
|
||||
range.text = mopen + mtext + mclose;
|
||||
range.moveStart('character', -mclose.length - mtext.length );
|
||||
range.moveEnd('character', -mclose.length );
|
||||
} else {
|
||||
if (str.charAt(str.length - 1) == " ") {
|
||||
mclose = mclose + " ";
|
||||
str = str.substr(0, str.length - 1);
|
||||
}
|
||||
range.text = mopen + str + mclose;
|
||||
}
|
||||
range.select();
|
||||
} else { tarea.value += mopen + mtext + mclose; }
|
||||
return;
|
||||
}
|
BIN
en/wiki/pub/guiedit/h.gif
Normal file
After Width: | Height: | Size: 691 B |
BIN
en/wiki/pub/guiedit/h1.gif
Normal file
After Width: | Height: | Size: 696 B |
BIN
en/wiki/pub/guiedit/h2.gif
Normal file
After Width: | Height: | Size: 699 B |
BIN
en/wiki/pub/guiedit/h3.gif
Normal file
After Width: | Height: | Size: 700 B |
BIN
en/wiki/pub/guiedit/hr.gif
Normal file
After Width: | Height: | Size: 664 B |
BIN
en/wiki/pub/guiedit/indent.gif
Normal file
After Width: | Height: | Size: 662 B |
BIN
en/wiki/pub/guiedit/left.gif
Normal file
After Width: | Height: | Size: 649 B |
BIN
en/wiki/pub/guiedit/math.gif
Normal file
After Width: | Height: | Size: 741 B |
BIN
en/wiki/pub/guiedit/ol.gif
Normal file
After Width: | Height: | Size: 677 B |
BIN
en/wiki/pub/guiedit/outdent.gif
Normal file
After Width: | Height: | Size: 657 B |
BIN
en/wiki/pub/guiedit/pagelink.gif
Normal file
After Width: | Height: | Size: 707 B |
BIN
en/wiki/pub/guiedit/preview.gif
Normal file
After Width: | Height: | Size: 722 B |
BIN
en/wiki/pub/guiedit/right.gif
Normal file
After Width: | Height: | Size: 648 B |
BIN
en/wiki/pub/guiedit/save.gif
Normal file
After Width: | Height: | Size: 643 B |
BIN
en/wiki/pub/guiedit/small.gif
Normal file
After Width: | Height: | Size: 703 B |
BIN
en/wiki/pub/guiedit/spellcheck.gif
Normal file
After Width: | Height: | Size: 752 B |
BIN
en/wiki/pub/guiedit/strong.gif
Normal file
After Width: | Height: | Size: 712 B |
BIN
en/wiki/pub/guiedit/sub.gif
Normal file
After Width: | Height: | Size: 716 B |
BIN
en/wiki/pub/guiedit/sup.gif
Normal file
After Width: | Height: | Size: 719 B |
BIN
en/wiki/pub/guiedit/table.gif
Normal file
After Width: | Height: | Size: 654 B |
BIN
en/wiki/pub/guiedit/ul.gif
Normal file
After Width: | Height: | Size: 668 B |
BIN
en/wiki/pub/guiedit/underline.gif
Normal file
After Width: | Height: | Size: 712 B |
BIN
en/wiki/pub/skins/adapt/Adapt-32.gif
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
en/wiki/pub/skins/adapt/Adapt-38.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
16
en/wiki/pub/skins/adapt/README.txt
Normal file
@ -0,0 +1,16 @@
|
||||
Built May 2014, starting with source from:
|
||||
http://purecss.io/layouts/side-menu/
|
||||
The hard part was done by the YUI and Normalise.js developers.
|
||||
|
||||
This skin's page on PmWiki.org:
|
||||
http://www.pmwiki.org/wiki/PmWiki/Skins/Adapt
|
||||
The CMS Mode recipe works well with this skin:
|
||||
http://www.pmwiki.org/wiki/Cookbook/CMSMode
|
||||
|
||||
Install by copying the directory to pub/skins/ and putting
|
||||
this in your config.php configuration file:
|
||||
|
||||
## Use the Adapt Skin
|
||||
$Skin = 'adapt';
|
||||
|
||||
Enjoy.
|
203
en/wiki/pub/skins/adapt/adapt-old-ie.css
Normal file
@ -0,0 +1,203 @@
|
||||
body { color: #333; }
|
||||
|
||||
.pure-img-responsive { max-width: 100%; height: auto; }
|
||||
|
||||
/*
|
||||
Add transition to containers so they can push in and out.
|
||||
*/
|
||||
#layout, #menu, .menu-link {
|
||||
-webkit-transition: all 0.2s ease-out;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-ms-transition: all 0.2s ease-out;
|
||||
-o-transition: all 0.2s ease-out;
|
||||
transition: all 0.2s ease-out;
|
||||
}
|
||||
|
||||
/*
|
||||
This is the parent `<div>` that contains the menu and the content area.
|
||||
Hamburger Menu styles are first, wider @media styles are below.
|
||||
*/
|
||||
#layout { position: relative; padding-left: 0; }
|
||||
#layout.active { position: relative; left: 180px; }
|
||||
#layout.active #menu { left: 180px; width: 180px; }
|
||||
#layout.active .menu-link { left: 180px; }
|
||||
|
||||
/*
|
||||
The content `<div>` is where all your content goes.
|
||||
*/
|
||||
.content { margin: 0 auto; padding: 0 2em; max-width: 800px;
|
||||
margin-bottom: 50px; line-height: 1.6em; }
|
||||
.content a { max-width:100%; height:auto; } /*TODO wiki needs to style it*/
|
||||
|
||||
/* Wiki page actions */
|
||||
#wikicmds { float:right; white-space:nowrap; font-size:90%; }
|
||||
#wikicmds ul { list-style:none; margin:0px; padding:0px; }
|
||||
#wikicmds li { display:inline; margin:0px 5px; }
|
||||
#wikicmds li a { text-decoration:none; color:#333; border:none; }
|
||||
#wikicmds li a.createlink { display:none; }
|
||||
#wikicmds li a:hover { text-decoration:underline; color:blue; }
|
||||
|
||||
/* The headerlogo element is (Site|Group).HeaderLogo TODO */
|
||||
.headerlogo { border-bottom:1px #ccc solid; }
|
||||
|
||||
/* Wiki Header - Logo and Search box */
|
||||
#wikihead { position:absolute; right:10px; top:10px; font-size:85%; }
|
||||
#wikihead form { display:none; }
|
||||
#wikihead input { font-size:85%; }
|
||||
/* The #wikilogo element is the logo from $PageLogoFmt */
|
||||
#wikilogo { padding:10px 2em 6px 75px; text-align:right;
|
||||
background: #eee; border-bottom:1px #ccc solid; }
|
||||
|
||||
/* Wiki page title */
|
||||
.title { margin: 0 auto; color: #000; padding: 1em 2em 0.5em;
|
||||
max-width: 800px; border-bottom: 1px solid #eee; }
|
||||
.title h1 { margin: 0em 0; font-size: 2em; font-weight: 300; }
|
||||
|
||||
/*TODO Wikify this*/
|
||||
.content-subhead { margin: 50px 0 20px 0; font-weight: 300; color: #888;}
|
||||
|
||||
/* Edit Form */
|
||||
#wikiedit form { margin:0px; width:100%; line-height:1.1em; }
|
||||
#wikiedit textarea { margin:0px; width:99.5%; height:18em; }
|
||||
#wikiedit input[type=text] { margin:0px; width:99.5%; }
|
||||
h2.wikiaction { margin:0px }
|
||||
.wikimessage { margin-top:3px; margin-bottom:3px; font-style:italic;
|
||||
color:black; background-color:#ffffcc; padding:2px; }
|
||||
|
||||
/* For the (Site.)Search page */
|
||||
.searchbox { margin-right:2px; max-width:100%; }
|
||||
|
||||
#wikifoot { font-size:80%; padding-top:2em; text-align:center; }
|
||||
.footnav a { text-decoration:none; color:black; }
|
||||
.footnav a:hover { text-decoration:underline; color:blue; }
|
||||
.lastmod { color:#999; }
|
||||
|
||||
/*
|
||||
The `#menu` `<div>` is the parent `<div>` that contains the `.pure-menu` that
|
||||
appears on the left side of the page.
|
||||
*/
|
||||
|
||||
#menu {
|
||||
margin-left: -180px; /* "#menu" width */
|
||||
width: 180px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 1000; /* so the menu or its navicon stays above all content */
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
background: #eee;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
/* All anchors inside the menu should be styled like this. */
|
||||
#menu a { color: #000; border: none; padding: 0.6em 0 0.3em 0.6em; }
|
||||
/* Sidebar Headings too TODO */
|
||||
#menu .sidehead { color: #000; border: none; padding: 0.6em 0 0.3em 0.6em; }
|
||||
/* Remove all background/borders, since we are applying them to #menu.*/
|
||||
#menu .pure-menu,
|
||||
#menu .pure-menu ul {
|
||||
border: none; background: transparent; }
|
||||
/* Add that light border to separate items into groups. */
|
||||
#menu .pure-menu ul,
|
||||
#menu .pure-menu .menu-item-divided {
|
||||
padding-top: 0.5em; }
|
||||
/* Change color of the anchor links on hover/focus. */
|
||||
#menu .pure-menu li a:hover,
|
||||
#menu .pure-menu li a:focus {
|
||||
background: #ccc; }
|
||||
/* This styles the selected menu item `<li>`. */
|
||||
#menu .pure-menu-selected,
|
||||
#menu .pure-menu-heading {
|
||||
background: #1f8dd6; }
|
||||
/* This styles a link within a selected menu item `<li>`. */
|
||||
#menu .pure-menu-selected a { color: #444; }
|
||||
/* This styles the menu heading. */
|
||||
#menu .pure-menu-heading {
|
||||
font-size: 110%; color: #444; margin: 0; }
|
||||
|
||||
/* Sidebar headings */
|
||||
#menu .sidehead {
|
||||
color: #000; border: none; padding: 0.6em 0 0 0.6em; background: #eee; }
|
||||
#menu .sidehead a { color:#000; }
|
||||
#menu .sidehead a:hover { text-decoration:underline; }
|
||||
/* Side menu search form TODO */
|
||||
#menu .sidesearch {
|
||||
background: #eee; color: #000; padding-bottom: 0.2em; padding-top: 0.5em; }
|
||||
#menu .sidesearch a:hover {
|
||||
text-decoration:underline; }
|
||||
|
||||
|
||||
/* -- Dynamic Button For Responsive Menu -------------------------------------*/
|
||||
|
||||
/*
|
||||
The button to open/close the Menu is custom-made and not part of Pure. Here's
|
||||
how it works:
|
||||
*/
|
||||
|
||||
/*
|
||||
`.menu-link` represents the responsive menu toggle that shows/hides on
|
||||
small screens.
|
||||
*/
|
||||
.menu-link {
|
||||
position: fixed;
|
||||
display: block; /* show this only on small screens */
|
||||
top: 0;
|
||||
left: 0; /* "#menu width" */
|
||||
background: #000;
|
||||
background: rgba(0,0,0,0.7);
|
||||
font-size: 10px; /* change this value to increase/decrease button size */
|
||||
z-index: 10;
|
||||
width: 2em;
|
||||
height: auto;
|
||||
padding: 2.1em 1.6em;
|
||||
}
|
||||
|
||||
.menu-link:hover,
|
||||
.menu-link:focus {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.menu-link span {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.menu-link span,
|
||||
.menu-link span:before,
|
||||
.menu-link span:after {
|
||||
background-color: #fff;
|
||||
width: 100%;
|
||||
height: 0.2em;
|
||||
}
|
||||
|
||||
.menu-link span:before,
|
||||
.menu-link span:after {
|
||||
position: absolute;
|
||||
margin-top: -0.6em;
|
||||
content: " ";
|
||||
}
|
||||
|
||||
.menu-link span:after {
|
||||
margin-top: 0.6em;
|
||||
}
|
||||
|
||||
/*
|
||||
Responsive Styles (Media Queries)
|
||||
These styles are activated when the display is wider; the Hamburger
|
||||
will disappear and the Side Menu for larger displays will be visible.
|
||||
|
||||
/* Hide the menu at `48em`, but modify this based on your app's needs. */
|
||||
#menu .sidesearch { display: none; }
|
||||
#wikilogo { padding-left: 1em; text-align:left; }
|
||||
#wikihead form { margin-top: 0.3em; display:block; }
|
||||
.title,
|
||||
.content { padding-left: 2em; padding-right: 2em; }
|
||||
/* width of the left (menu) column */
|
||||
#layout { padding-left: 180px; left: 0; }
|
||||
#menu { left: 180px; }
|
||||
|
||||
.menu-link {
|
||||
position: fixed; left: 180px; display: none; }
|
||||
|
||||
#layout.active .menu-link { left: 180px; }
|
219
en/wiki/pub/skins/adapt/adapt.css
Normal file
@ -0,0 +1,219 @@
|
||||
body { color: #333; }
|
||||
|
||||
.pure-img-responsive { max-width: 100%; height: auto; }
|
||||
|
||||
/*
|
||||
Add transition to containers so they can push in and out.
|
||||
*/
|
||||
#layout, #menu, .menu-link {
|
||||
-webkit-transition: all 0.2s ease-out;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-ms-transition: all 0.2s ease-out;
|
||||
-o-transition: all 0.2s ease-out;
|
||||
transition: all 0.2s ease-out;
|
||||
}
|
||||
|
||||
/*
|
||||
This is the parent `<div>` that contains the menu and the content area.
|
||||
Hamburger Menu styles are first, wider @media styles are below.
|
||||
*/
|
||||
#layout { position: relative; padding-left: 0; }
|
||||
#layout.active { position: relative; left: 175px; }
|
||||
#layout.active #menu { left: 175px; width: 175px; }
|
||||
#layout.active .menu-link { left: 175px; }
|
||||
|
||||
/*
|
||||
The content `<div>` is where all your content goes.
|
||||
*/
|
||||
.content { margin: 0 auto; padding: 0 2em; max-width: 800px;
|
||||
margin-bottom: 50px; line-height: 1.6em; }
|
||||
.content img { max-width:100%; height:auto; } /*TODO wiki needs to style it*/
|
||||
/* links in the content area */
|
||||
.content a { font-weight:bold; color:#0055bb; text-decoration:none; }
|
||||
.content a:visited { font-weight:bold; color:#003399; text-decoration:none; }
|
||||
.content a:hover {color:#0066cc; text-decoration:underline; }
|
||||
.content a:active { color#9c0606; }
|
||||
/* Wiki page actions */
|
||||
#wikicmds { float:right; white-space:nowrap; font-size:90%; }
|
||||
#wikicmds ul { list-style:none; margin:0px; padding:0px; }
|
||||
#wikicmds li { display:inline; margin:0px 5px; }
|
||||
#wikicmds li a { text-decoration:none; color:#333; border:none; }
|
||||
#wikicmds li a.createlink { display:none; }
|
||||
#wikicmds li a:hover { text-decoration:underline; color:blue; }
|
||||
|
||||
/* The headerlogo element is (Site|Group).HeaderLogo TODO */
|
||||
.headerlogo { border-bottom:1px #ccc solid; }
|
||||
|
||||
/* Wiki Header - Logo and Search box */
|
||||
#wikihead { position:absolute; right:10px; top:10px; font-size:85%; }
|
||||
#wikihead form { display:none; }
|
||||
#wikihead input { font-size:85%; }
|
||||
/* The #wikilogo element is the logo from $PageLogoFmt */
|
||||
#wikilogo { padding:10px 2em 6px 75px; text-align:right;
|
||||
background: #eee; border-bottom:1px #ccc solid; }
|
||||
|
||||
/* Wiki page title */
|
||||
.title { margin: 0 auto; color: #000; padding: 1em 2em 0.5em;
|
||||
max-width: 800px; border-bottom: 1px solid #eee; }
|
||||
.title h1 { margin: 0em 0; font-size: 2em; font-weight: 300; }
|
||||
|
||||
/*TODO Wikify this*/
|
||||
.content-subhead { margin: 50px 0 20px 0; font-weight: 300; color: #888;}
|
||||
|
||||
/* Edit Form */
|
||||
#wikiedit form { margin:0px; width:100%; line-height:1.1em; }
|
||||
#wikiedit textarea { margin:0px; width:99.5%; height:18em; }
|
||||
#wikiedit input[type=text] { margin:0px; width:99.5%; }
|
||||
h2.wikiaction { margin:0px }
|
||||
.wikimessage { margin-top:3px; margin-bottom:3px; font-style:italic;
|
||||
color:black; background-color:#ffffcc; padding:2px; }
|
||||
|
||||
/* For the (Site.)Search page */
|
||||
.searchbox { margin-right:2px; max-width:100%; }
|
||||
|
||||
#wikifoot { font-size:80%; padding-top:2em; text-align:center; }
|
||||
.footnav a,
|
||||
.footnav a:visited {
|
||||
font-weight:normal; text-decoration:none; color:black; }
|
||||
.footnav a:hover { text-decoration:underline; color:blue; }
|
||||
.lastmod { color:#999; }
|
||||
|
||||
/*
|
||||
The `#menu` `<div>` is the parent `<div>` that contains the `.pure-menu` that
|
||||
appears on the left side of the page.
|
||||
*/
|
||||
|
||||
#menu {
|
||||
margin-left: -175px; /* "#menu" width */
|
||||
width: 175px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 1000; /* so the menu or its navicon stays above all content */
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
background: #eee;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
/* All anchors inside the menu should be styled like this. */
|
||||
#menu a { color: #000; border: none; padding: 0.6em 0 0.3em 0.6em; font-size:85%; }
|
||||
/* Sidebar Headings too TODO */
|
||||
#menu .sidehead { color: #000; border: none; padding: 0.6em 0 0.3em 0.6em; }
|
||||
/* Remove all background/borders, since we are applying them to #menu.*/
|
||||
#menu .pure-menu,
|
||||
#menu .pure-menu ul {
|
||||
border: none; background: transparent; }
|
||||
/* Add that light border to separate items into groups. */
|
||||
#menu .pure-menu ul,
|
||||
#menu .pure-menu .menu-item-divided {
|
||||
padding-top: 0.5em; }
|
||||
/* Change color of the anchor links on hover/focus. */
|
||||
#menu .pure-menu li a:hover,
|
||||
#menu .pure-menu li a:focus {
|
||||
background: #ccc; }
|
||||
/* This styles the selected menu item `<li>`. */
|
||||
#menu .pure-menu-selected,
|
||||
#menu .pure-menu-heading {
|
||||
background: #1f8dd6; }
|
||||
/* This styles a link within a selected menu item `<li>`. */
|
||||
#menu .pure-menu-selected a { color: #444; }
|
||||
/* This styles the menu heading. */
|
||||
#menu .pure-menu-heading {
|
||||
font-size: 110%; color: #444; margin: 0; }
|
||||
|
||||
/* Sidebar headings */
|
||||
#menu .sidehead {
|
||||
color: #000; border: none; padding: 0.6em 0 0 0.6em; background: #eee; }
|
||||
#menu .sidehead a { color:#000; }
|
||||
#menu .sidehead a:hover { text-decoration:underline; }
|
||||
/* Side menu search form TODO */
|
||||
#menu .sidesearch {
|
||||
background: #eee; color: #000; padding-bottom: 0.2em; padding-top: 0.5em; }
|
||||
#menu .sidesearch a:hover {
|
||||
text-decoration:underline; }
|
||||
|
||||
|
||||
/* -- Dynamic Button For Responsive Menu -------------------------------------*/
|
||||
|
||||
/*
|
||||
The button to open/close the Menu is custom-made and not part of Pure. Here's
|
||||
how it works:
|
||||
*/
|
||||
|
||||
/*
|
||||
`.menu-link` represents the responsive menu toggle that shows/hides on
|
||||
small screens.
|
||||
*/
|
||||
.menu-link {
|
||||
position: fixed;
|
||||
display: block; /* show this only on small screens */
|
||||
top: 0;
|
||||
left: 0; /* "#menu width" */
|
||||
background: #000;
|
||||
background: rgba(0,0,0,0.7);
|
||||
font-size: 10px; /* change this value to increase/decrease button size */
|
||||
z-index: 10;
|
||||
width: 2em;
|
||||
height: auto;
|
||||
padding: 2.1em 1.6em;
|
||||
}
|
||||
|
||||
.menu-link:hover,
|
||||
.menu-link:focus {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.menu-link span {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.menu-link span,
|
||||
.menu-link span:before,
|
||||
.menu-link span:after {
|
||||
background-color: #fff;
|
||||
width: 100%;
|
||||
height: 0.2em;
|
||||
}
|
||||
|
||||
.menu-link span:before,
|
||||
.menu-link span:after {
|
||||
position: absolute;
|
||||
margin-top: -0.6em;
|
||||
content: " ";
|
||||
}
|
||||
|
||||
.menu-link span:after {
|
||||
margin-top: 0.6em;
|
||||
}
|
||||
|
||||
/*
|
||||
Responsive Styles (Media Queries)
|
||||
These styles are activated when the display is wider; the Hamburger
|
||||
will disappear and the Side Menu for larger displays will be visible.
|
||||
|
||||
/* Hide the menu at `48em`, but modify this based on your app's needs. */
|
||||
@media (min-width: 48em) {
|
||||
#menu .sidesearch { display: none; }
|
||||
#wikilogo { padding-left: 1em; text-align:left; }
|
||||
#wikihead form { margin-top: 0.3em; display:block; }
|
||||
.title,
|
||||
.content { padding-left: 2em; padding-right: 2em; }
|
||||
/* width of the left (menu) column */
|
||||
#layout { padding-left: 175px; left: 0; }
|
||||
#menu { left: 175px; }
|
||||
|
||||
.menu-link {
|
||||
position: fixed; left: 175px; display: none; }
|
||||
|
||||
#layout.active .menu-link { left: 175px; }
|
||||
}
|
||||
|
||||
@media print {
|
||||
#menu, #wikihead, #wikilogo { display:none; }
|
||||
.headerlogo, .content, .title {
|
||||
margin-left: -175px; }
|
||||
}
|
||||
|
||||
|
101
en/wiki/pub/skins/adapt/adapt.tmpl
Normal file
@ -0,0 +1,101 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{$Title} | $WikiTitle $ActionTitle </title></title>
|
||||
<link rel="stylesheet" href="$SkinDirUrl/pure-min.css">
|
||||
<!--[if lte IE 8]>
|
||||
<link rel="stylesheet" href="$SkinDirUrl/adapt-old-ie.css">
|
||||
<![endif]-->
|
||||
<!--[if gt IE 8]><!-->
|
||||
<link rel="stylesheet" href="$SkinDirUrl/adapt.css">
|
||||
<!--<![endif]-->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="$SkinDirUrl/html5shiv.js"></script>
|
||||
<![endif]-->
|
||||
<!--HTMLHeader-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="layout">
|
||||
<!--PageLeftFmt-->
|
||||
<!-- HeaderLogo Menu toggle -->
|
||||
<a href="#menu" id="menuLink" class="menu-link">
|
||||
<!-- Hamburger icon -->
|
||||
<span></span>
|
||||
</a>
|
||||
<div id="menu">
|
||||
<div class="pure-menu pure-menu-open">
|
||||
<div class='sidesearch'><a href='http://www.haganfox.net/Site/Search'>Search</a></div>
|
||||
<!--wiki:{$Group}.AdaptSideBar {$SiteGroup}.AdaptSideBar-->
|
||||
<!--wiki:{$Group}.SideBar {$SiteGroup}.SideBar-->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="main">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id='wikilogo'><a href='{$ScriptUrl}'><img src='$PageLogoUrl'
|
||||
alt='$WikiTitle' border='0' /></a></div>
|
||||
<div id='wikihead'>
|
||||
<form action='{$ScriptUrl}'>
|
||||
<span class='headnav'><a href='{$ScriptUrl}/$[{$Group}/RecentChanges]'
|
||||
accesskey='$[ak_recentchanges]'>$[Recent Changes]</a> -</span>
|
||||
<input type='hidden' name='n' value='{$FullName}' />
|
||||
<input type='hidden' name='action' value='search' />
|
||||
<a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a>:
|
||||
<input type='text' name='q' value='' class='inputbox searchbox' />
|
||||
<input type='submit' class='inputbutton searchbutton'
|
||||
value='$[Go]' /></form></div>
|
||||
<!--PageActionFmt-->
|
||||
<div id='wikicmds'><!--wiki:{$Group}.PageActions {$SiteGroup}.PageActions--></div>
|
||||
<!--PageTitleFmt-->
|
||||
<div class="title">
|
||||
<div class='pagegroup'><a href='{$ScriptUrl}/{$Group}'>{$Group}</a> /</div>
|
||||
<h1 class='pagetitle'>{$Title}</h1>
|
||||
</div>
|
||||
<!--/PageTitleFmt-->
|
||||
<div class="content">
|
||||
<!--PageText-->
|
||||
<!--PageFooterFmt-->
|
||||
<div id='wikifoot'><div class='footnav'>
|
||||
<a rel="nofollow" href='{$PageUrl}?action=edit'>$[Edit]</a> -
|
||||
<a rel="nofollow" href='{$PageUrl}?action=diff'>$[History]</a> -
|
||||
<a rel="nofollow" href='{$PageUrl}?action=print' target='_blank'>$[Print]</a> -
|
||||
<a href='{$ScriptUrl}/$[{$Group}/RecentChanges]'>$[Recent Changes]</a> -
|
||||
<a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a></div>
|
||||
<div class='lastmod'>$[Page last modified on {$LastModified}]</div>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="$SkinDirUrl/ui.js"></script>
|
||||
<!--HTMLFooter-->
|
||||
<!-- Yandex.Metrika counter -->
|
||||
<script type="text/javascript">
|
||||
(function (d, w, c) {
|
||||
(w[c] = w[c] || []).push(function() {
|
||||
try {
|
||||
w.yaCounter25827098 = new Ya.Metrika({id:25827098,
|
||||
clickmap:true,
|
||||
accurateTrackBounce:true});
|
||||
} catch(e) { }
|
||||
});
|
||||
|
||||
var n = d.getElementsByTagName("script")[0],
|
||||
s = d.createElement("script"),
|
||||
f = function () { n.parentNode.insertBefore(s, n); };
|
||||
s.type = "text/javascript";
|
||||
s.async = true;
|
||||
s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
|
||||
|
||||
if (w.opera == "[object Opera]") {
|
||||
d.addEventListener("DOMContentLoaded", f, false);
|
||||
} else { f(); }
|
||||
})(document, window, "yandex_metrika_callbacks");
|
||||
</script>
|
||||
<noscript><div><img src="//mc.yandex.ru/watch/25827098" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||
<!-- /Yandex.Metrika counter -->
|
||||
</body>
|
||||
</html>
|
301
en/wiki/pub/skins/adapt/html5shiv.js
vendored
Normal file
@ -0,0 +1,301 @@
|
||||
/**
|
||||
* @preserve HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
;(function(window, document) {
|
||||
/*jshint evil:true */
|
||||
/** version */
|
||||
var version = '3.7.0';
|
||||
|
||||
/** Preset options */
|
||||
var options = window.html5 || {};
|
||||
|
||||
/** Used to skip problem elements */
|
||||
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
||||
|
||||
/** Not all elements can be cloned in IE **/
|
||||
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
||||
|
||||
/** Detect whether the browser supports default html5 styles */
|
||||
var supportsHtml5Styles;
|
||||
|
||||
/** Name of the expando, to work with multiple documents or to re-shiv one document */
|
||||
var expando = '_html5shiv';
|
||||
|
||||
/** The id for the the documents expando */
|
||||
var expanID = 0;
|
||||
|
||||
/** Cached data for each document */
|
||||
var expandoData = {};
|
||||
|
||||
/** Detect whether the browser supports unknown elements */
|
||||
var supportsUnknownElements;
|
||||
|
||||
(function() {
|
||||
try {
|
||||
var a = document.createElement('a');
|
||||
a.innerHTML = '<xyz></xyz>';
|
||||
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
|
||||
supportsHtml5Styles = ('hidden' in a);
|
||||
|
||||
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
||||
// assign a false positive if unable to shiv
|
||||
(document.createElement)('a');
|
||||
var frag = document.createDocumentFragment();
|
||||
return (
|
||||
typeof frag.cloneNode == 'undefined' ||
|
||||
typeof frag.createDocumentFragment == 'undefined' ||
|
||||
typeof frag.createElement == 'undefined'
|
||||
);
|
||||
}());
|
||||
} catch(e) {
|
||||
// assign a false positive if detection fails => unable to shiv
|
||||
supportsHtml5Styles = true;
|
||||
supportsUnknownElements = true;
|
||||
}
|
||||
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a style sheet with the given CSS text and adds it to the document.
|
||||
* @private
|
||||
* @param {Document} ownerDocument The document.
|
||||
* @param {String} cssText The CSS text.
|
||||
* @returns {StyleSheet} The style element.
|
||||
*/
|
||||
function addStyleSheet(ownerDocument, cssText) {
|
||||
var p = ownerDocument.createElement('p'),
|
||||
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
||||
|
||||
p.innerHTML = 'x<style>' + cssText + '</style>';
|
||||
return parent.insertBefore(p.lastChild, parent.firstChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of `html5.elements` as an array.
|
||||
* @private
|
||||
* @returns {Array} An array of shived element node names.
|
||||
*/
|
||||
function getElements() {
|
||||
var elements = html5.elements;
|
||||
return typeof elements == 'string' ? elements.split(' ') : elements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data associated to the given document
|
||||
* @private
|
||||
* @param {Document} ownerDocument The document.
|
||||
* @returns {Object} An object of data.
|
||||
*/
|
||||
function getExpandoData(ownerDocument) {
|
||||
var data = expandoData[ownerDocument[expando]];
|
||||
if (!data) {
|
||||
data = {};
|
||||
expanID++;
|
||||
ownerDocument[expando] = expanID;
|
||||
expandoData[expanID] = data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a shived element for the given nodeName and document
|
||||
* @memberOf html5
|
||||
* @param {String} nodeName name of the element
|
||||
* @param {Document} ownerDocument The context document.
|
||||
* @returns {Object} The shived element.
|
||||
*/
|
||||
function createElement(nodeName, ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createElement(nodeName);
|
||||
}
|
||||
if (!data) {
|
||||
data = getExpandoData(ownerDocument);
|
||||
}
|
||||
var node;
|
||||
|
||||
if (data.cache[nodeName]) {
|
||||
node = data.cache[nodeName].cloneNode();
|
||||
} else if (saveClones.test(nodeName)) {
|
||||
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
||||
} else {
|
||||
node = data.createElem(nodeName);
|
||||
}
|
||||
|
||||
// Avoid adding some elements to fragments in IE < 9 because
|
||||
// * Attributes like `name` or `type` cannot be set/changed once an element
|
||||
// is inserted into a document/fragment
|
||||
// * Link elements with `src` attributes that are inaccessible, as with
|
||||
// a 403 response, will cause the tab/window to crash
|
||||
// * Script elements appended to fragments will execute when their `src`
|
||||
// or `text` property is set
|
||||
return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a shived DocumentFragment for the given document
|
||||
* @memberOf html5
|
||||
* @param {Document} ownerDocument The context document.
|
||||
* @returns {Object} The shived DocumentFragment.
|
||||
*/
|
||||
function createDocumentFragment(ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createDocumentFragment();
|
||||
}
|
||||
data = data || getExpandoData(ownerDocument);
|
||||
var clone = data.frag.cloneNode(),
|
||||
i = 0,
|
||||
elems = getElements(),
|
||||
l = elems.length;
|
||||
for(;i<l;i++){
|
||||
clone.createElement(elems[i]);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
|
||||
* @private
|
||||
* @param {Document|DocumentFragment} ownerDocument The document.
|
||||
* @param {Object} data of the document.
|
||||
*/
|
||||
function shivMethods(ownerDocument, data) {
|
||||
if (!data.cache) {
|
||||
data.cache = {};
|
||||
data.createElem = ownerDocument.createElement;
|
||||
data.createFrag = ownerDocument.createDocumentFragment;
|
||||
data.frag = data.createFrag();
|
||||
}
|
||||
|
||||
|
||||
ownerDocument.createElement = function(nodeName) {
|
||||
//abort shiv
|
||||
if (!html5.shivMethods) {
|
||||
return data.createElem(nodeName);
|
||||
}
|
||||
return createElement(nodeName, ownerDocument, data);
|
||||
};
|
||||
|
||||
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
||||
'var n=f.cloneNode(),c=n.createElement;' +
|
||||
'h.shivMethods&&(' +
|
||||
// unroll the `createElement` calls
|
||||
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
|
||||
data.createElem(nodeName);
|
||||
data.frag.createElement(nodeName);
|
||||
return 'c("' + nodeName + '")';
|
||||
}) +
|
||||
');return n}'
|
||||
)(html5, data.frag);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Shivs the given document.
|
||||
* @memberOf html5
|
||||
* @param {Document} ownerDocument The document to shiv.
|
||||
* @returns {Document} The shived document.
|
||||
*/
|
||||
function shivDocument(ownerDocument) {
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
var data = getExpandoData(ownerDocument);
|
||||
|
||||
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
||||
data.hasCSS = !!addStyleSheet(ownerDocument,
|
||||
// corrects block display not defined in IE6/7/8/9
|
||||
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
|
||||
// adds styling not present in IE6/7/8/9
|
||||
'mark{background:#FF0;color:#000}' +
|
||||
// hides non-rendered elements
|
||||
'template{display:none}'
|
||||
);
|
||||
}
|
||||
if (!supportsUnknownElements) {
|
||||
shivMethods(ownerDocument, data);
|
||||
}
|
||||
return ownerDocument;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The `html5` object is exposed so that more elements can be shived and
|
||||
* existing shiving can be detected on iframes.
|
||||
* @type Object
|
||||
* @example
|
||||
*
|
||||
* // options can be changed before the script is included
|
||||
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
|
||||
*/
|
||||
var html5 = {
|
||||
|
||||
/**
|
||||
* An array or space separated string of node names of the elements to shiv.
|
||||
* @memberOf html5
|
||||
* @type Array|String
|
||||
*/
|
||||
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
|
||||
|
||||
/**
|
||||
* current version of html5shiv
|
||||
*/
|
||||
'version': version,
|
||||
|
||||
/**
|
||||
* A flag to indicate that the HTML5 style sheet should be inserted.
|
||||
* @memberOf html5
|
||||
* @type Boolean
|
||||
*/
|
||||
'shivCSS': (options.shivCSS !== false),
|
||||
|
||||
/**
|
||||
* Is equal to true if a browser supports creating unknown/HTML5 elements
|
||||
* @memberOf html5
|
||||
* @type boolean
|
||||
*/
|
||||
'supportsUnknownElements': supportsUnknownElements,
|
||||
|
||||
/**
|
||||
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
|
||||
* methods should be overwritten.
|
||||
* @memberOf html5
|
||||
* @type Boolean
|
||||
*/
|
||||
'shivMethods': (options.shivMethods !== false),
|
||||
|
||||
/**
|
||||
* A string to describe the type of `html5` object ("default" or "default print").
|
||||
* @memberOf html5
|
||||
* @type String
|
||||
*/
|
||||
'type': 'default',
|
||||
|
||||
// shivs the document according to the specified `html5` object options
|
||||
'shivDocument': shivDocument,
|
||||
|
||||
//creates a shived element
|
||||
createElement: createElement,
|
||||
|
||||
//creates a shived documentFragment
|
||||
createDocumentFragment: createDocumentFragment
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose html5
|
||||
window.html5 = html5;
|
||||
|
||||
// shiv the document
|
||||
shivDocument(document);
|
||||
|
||||
}(this, document));
|
52
en/wiki/pub/skins/adapt/pure-min-LICENSE.md
Normal file
@ -0,0 +1,52 @@
|
||||
Software License Agreement (BSD License)
|
||||
========================================
|
||||
|
||||
Copyright 2014 Yahoo! Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the Yahoo! Inc. nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Normalize.css License
|
||||
=====================
|
||||
|
||||
Copyright (c) Nicolas Gallagher and Jonathan Neal
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
11
en/wiki/pub/skins/adapt/pure-min.css
vendored
Normal file
35
en/wiki/pub/skins/adapt/ui.js
Normal file
@ -0,0 +1,35 @@
|
||||
(function (window, document) {
|
||||
|
||||
var layout = document.getElementById('layout'),
|
||||
menu = document.getElementById('menu'),
|
||||
menuLink = document.getElementById('menuLink');
|
||||
|
||||
function toggleClass(element, className) {
|
||||
var classes = element.className.split(/\s+/),
|
||||
length = classes.length,
|
||||
i = 0;
|
||||
|
||||
for(; i < length; i++) {
|
||||
if (classes[i] === className) {
|
||||
classes.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// The className is not found
|
||||
if (length === classes.length) {
|
||||
classes.push(className);
|
||||
}
|
||||
|
||||
element.className = classes.join(' ');
|
||||
}
|
||||
|
||||
menuLink.onclick = function (e) {
|
||||
var active = 'active';
|
||||
|
||||
e.preventDefault();
|
||||
toggleClass(layout, active);
|
||||
toggleClass(menu, active);
|
||||
toggleClass(menuLink, active);
|
||||
};
|
||||
|
||||
}(this, this.document));
|
150
en/wiki/pub/skins/graph.tmpl
Normal file
@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{$Title} | $WikiTitle $ActionTitle </title>
|
||||
<meta name="description" content="$WikiTitle $ActionTitle" />
|
||||
<meta name="keywords" content="$Title, $WikiTitle $ActionTitle. graph wikipedia" />
|
||||
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/i/image/touch_icon/favicon_144x144.png" />
|
||||
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/i/image/touch_icon/favicon_114x114.png" />
|
||||
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/i/image/touch_icon/favicon_72x72.png" />
|
||||
<link rel="apple-touch-icon-precomposed" href="/i/image/touch_icon/favicon_57x57.png" />
|
||||
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<meta http-equiv="cleartype" content="on">
|
||||
|
||||
|
||||
|
||||
<!-- Следущая строчка нужна для обозначения места вставки объеденённых css/js файлов. Её не следует удалять.-->
|
||||
<!-- extraPacker --><link rel="stylesheet" charset="UTF-8" type="text/css" href="/tmp/auto_merge_css_js/css/css1467316905.css" /><script type="text/javascript" charset="UTF-8" src="/tmp/auto_merge_css_js/js/js1470086177.js"></script>
|
||||
|
||||
|
||||
<link media="screen" rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic&subset=latin,cyrillic" />
|
||||
|
||||
<link rel="stylesheet" href="$SkinDirUrl/style.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="container page-wrap">
|
||||
<!-- <div class="header"> -->
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/en/"><span class="fa fa-sitemap fa-fw"></span> Graph Online</a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class=""><a href="/en/">Home</a></li>
|
||||
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false"> Create Graph <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/en/create_graph_by_matrix">Using adjacency matrix</a></li>
|
||||
<li><a href="/en/create_graph_by_incidence_matrix">Using incidence matrix</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false"> Help <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/en/help">Quick Start</a></li>
|
||||
<li><a href="/en/wiki">Wiki</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="active"><a href="/en/news">News</a></li>
|
||||
<li class=""><a href="/en/contacts">Contacts</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Language <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/en/wiki" title="English" class="selected"><img src="/i/image/flags/en.png" alt="English"> English</a></li>
|
||||
<li><a href="/wiki" title="Русский" class=""><img src="/i/image/flags/ru.png" alt="Русский"> Русский</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="content">
|
||||
<a href='{$ScriptUrl}/{$Group}' class="navbar-brand" style="padding-right: 0px;">{$Group}<span class="fa fa-chevron-right fa-fw"></span></a><h1 style="display: inline-block;">{$Title}</h1>
|
||||
|
||||
<form action='{$ScriptUrl}' style="float:right">
|
||||
<input type='hidden' name='n' value='{$FullName}' />
|
||||
<input type='hidden' name='action' value='search' />
|
||||
<a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'><span class="fa fa-search" ></span></a>
|
||||
<input type='text' name='q' value='' class='inputbox searchbox' />
|
||||
<input type='submit' class="btn btn-primary"
|
||||
value='find' /></form>
|
||||
|
||||
<!--PageText-->
|
||||
|
||||
<div class="page-btns">
|
||||
<a class="btn btn-default" onclick="window.history.back(); return false;" href="#"><i class="fa fa-lg fa-angle-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Футер приходится обрамить в .container, потому что у него position:absolute и он занимает всю ширину игнорируя паддинги родителя -->
|
||||
<footer class="footer" id="footer">
|
||||
<div class="container">
|
||||
<p>© <a href="/en">Graph Online</a> is online project aimed at creation and easy visualization of graph and <a href="/en">shortest path searching</a>. Also you can create <a href="http://graph.unick-soft.ru/en/create_graph_by_matrix">graph from adjacency matrix</a>. A<a href="/en/about">bout project</a> and <a href="http://graph.unick-soft.ru/en/help">look help page</a>.
|
||||
2016 (<a rel="nofollow" href='{$PageUrl}?action=edit'>$[Edit]</a> -
|
||||
<a rel="nofollow" href='{$PageUrl}?action=diff'>$[History]</a> -
|
||||
<a rel="nofollow" href='{$PageUrl}?action=print' target='_blank'>$[Print]</a> -
|
||||
<a href='{$ScriptUrl}/$[{$Group}/RecentChanges]'>$[Recent Changes]</a> -
|
||||
<a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a>)
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<!-- Yandex.Metrika counter -->
|
||||
<script type="text/javascript">
|
||||
(function (d, w, c) {
|
||||
(w[c] = w[c] || []).push(function() {
|
||||
try {
|
||||
w.yaCounter25827098 = new Ya.Metrika({id:25827098,
|
||||
clickmap:true,
|
||||
accurateTrackBounce:true});
|
||||
} catch(e) { }
|
||||
});
|
||||
|
||||
var n = d.getElementsByTagName("script")[0],
|
||||
s = d.createElement("script"),
|
||||
f = function () { n.parentNode.insertBefore(s, n); };
|
||||
s.type = "text/javascript";
|
||||
s.async = true;
|
||||
s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
|
||||
|
||||
if (w.opera == "[object Opera]") {
|
||||
d.addEventListener("DOMContentLoaded", f, false);
|
||||
} else { f(); }
|
||||
})(document, window, "yandex_metrika_callbacks");
|
||||
</script>
|
||||
<noscript><div><img src="//mc.yandex.ru/watch/25827098" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||
<!-- /Yandex.Metrika counter -->
|
||||
|
||||
<script>
|
||||
if (typeof preLoadPage == 'function')
|
||||
{
|
||||
preLoadPage();
|
||||
}
|
||||
</script>
|
||||
<script src="/i/js/dev/bootstrap3/bootstrap.min.js" >
|
||||
$('.dropdown-toggle').dropdown();
|
||||
</script>
|
||||
<script>
|
||||
if (typeof postLoadPage == 'function')
|
||||
{
|
||||
postLoadPage();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
150
en/wiki/pub/skins/graph/graph.tmpl
Normal file
@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru" dir="ltr">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{$Title} | $WikiTitle $ActionTitle </title>
|
||||
<meta name="description" content="$WikiTitle $ActionTitle" />
|
||||
<meta name="keywords" content="$Title, $WikiTitle $ActionTitle. graph wikipedia" />
|
||||
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/i/image/touch_icon/favicon_144x144.png" />
|
||||
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/i/image/touch_icon/favicon_114x114.png" />
|
||||
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/i/image/touch_icon/favicon_72x72.png" />
|
||||
<link rel="apple-touch-icon-precomposed" href="/i/image/touch_icon/favicon_57x57.png" />
|
||||
|
||||
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||||
|
||||
<meta http-equiv="cleartype" content="on">
|
||||
|
||||
|
||||
|
||||
<!-- Следущая строчка нужна для обозначения места вставки объеденённых css/js файлов. Её не следует удалять.-->
|
||||
<!-- extraPacker --><link rel="stylesheet" charset="UTF-8" type="text/css" href="/tmp/wiki/css1486493398.css" /><script type="text/javascript" charset="UTF-8" src="/i/js/dev/jquery-2.0.3.js"></script>
|
||||
|
||||
|
||||
<link media="screen" rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic&subset=latin,cyrillic" />
|
||||
|
||||
<link rel="stylesheet" href="$SkinDirUrl/style.css">
|
||||
<!--HTMLHeader-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="container page-wrap">
|
||||
<!-- <div class="header"> -->
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/en/"><span class="fa fa-sitemap fa-fw"></span> Graph Online</a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class=""><a href="/en/">Home</a></li>
|
||||
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false"> Create Graph <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/en/create_graph_by_matrix">Using adjacency matrix</a></li>
|
||||
<li><a href="/en/create_graph_by_incidence_matrix">Using incidence matrix</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false"> Help <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/en/help">Quick Start</a></li>
|
||||
<li><a href="/en/wiki">Wiki</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="active"><a href="/en/news">News</a></li>
|
||||
<li class=""><a href="/en/contacts">Contacts</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <img src="/i/image/flags/enru.png" alt=""> Language <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/en/wiki" title="English" class="selected"><img src="/i/image/flags/en.png" alt="English"> English</a></li>
|
||||
<li><a href="/wiki" title="Русский" class=""><img src="/i/image/flags/ru.png" alt="Русский"> Русский</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="content">
|
||||
<a href='{$ScriptUrl}/{$Group}' class="navbar-brand" style="padding-right: 0px;">{$Group}<span class="fa fa-chevron-right fa-fw"></span></a><h1 style="display: inline-block;">{$Title}</h1>
|
||||
|
||||
<form action='{$ScriptUrl}' style="float:right">
|
||||
<input type='hidden' name='n' value='{$FullName}' />
|
||||
<input type='hidden' name='action' value='search' />
|
||||
<a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'><span class="fa fa-search" ></span></a>
|
||||
<input type='text' name='q' value='' class='inputbox searchbox' />
|
||||
<input type='submit' class="btn btn-primary"
|
||||
value='find' /></form>
|
||||
|
||||
<!--PageText-->
|
||||
|
||||
<div class="page-btns">
|
||||
<a class="btn btn-default" onclick="window.history.back(); return false;" href="#"><i class="fa fa-lg fa-angle-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Футер приходится обрамить в .container, потому что у него position:absolute и он занимает всю ширину игнорируя паддинги родителя -->
|
||||
<footer class="footer" id="footer">
|
||||
<div class="container">
|
||||
<p>© <a href="/en/">Graph Online</a> is online project aimed at creation and easy visualization of graph and <a href="/en">shortest path searching</a>. Also you can create <a href="http://graph.unick-soft.ru/en/create_graph_by_matrix">graph from adjacency matrix</a>. A<a href="/en/about">bout project</a> and <a href="http://graph.unick-soft.ru/en/help">look help page</a>.
|
||||
2016 (<a rel="nofollow" href='{$PageUrl}?action=edit'>$[Edit]</a> -
|
||||
<a rel="nofollow" href='{$PageUrl}?action=diff'>$[History]</a> -
|
||||
<a rel="nofollow" href='{$PageUrl}?action=print' target='_blank'>$[Print]</a> -
|
||||
<a rel="nofollow" href='{$ScriptUrl}/$[{$Group}/RecentChanges]'>$[Recent Changes]</a> -
|
||||
<a rel="nofollow" href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a>)
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<!-- Yandex.Metrika counter -->
|
||||
<script type="text/javascript">
|
||||
(function (d, w, c) {
|
||||
(w[c] = w[c] || []).push(function() {
|
||||
try {
|
||||
w.yaCounter25827098 = new Ya.Metrika({id:25827098,
|
||||
clickmap:true,
|
||||
accurateTrackBounce:true});
|
||||
} catch(e) { }
|
||||
});
|
||||
|
||||
var n = d.getElementsByTagName("script")[0],
|
||||
s = d.createElement("script"),
|
||||
f = function () { n.parentNode.insertBefore(s, n); };
|
||||
s.type = "text/javascript";
|
||||
s.async = true;
|
||||
s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
|
||||
|
||||
if (w.opera == "[object Opera]") {
|
||||
d.addEventListener("DOMContentLoaded", f, false);
|
||||
} else { f(); }
|
||||
})(document, window, "yandex_metrika_callbacks");
|
||||
</script>
|
||||
<noscript><div><img src="//mc.yandex.ru/watch/25827098" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||
<!-- /Yandex.Metrika counter -->
|
||||
|
||||
<script>
|
||||
if (typeof preLoadPage == 'function')
|
||||
{
|
||||
preLoadPage();
|
||||
}
|
||||
</script>
|
||||
<script src="/i/js/dev/bootstrap3/bootstrap.min.js" >
|
||||
$('.dropdown-toggle').dropdown();
|
||||
</script>
|
||||
<script>
|
||||
if (typeof postLoadPage == 'function')
|
||||
{
|
||||
postLoadPage();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
5
en/wiki/pub/skins/graph/style.css
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
pre{
|
||||
border-color: transparent;
|
||||
background-color: transparent;
|
||||
}
|
22
en/wiki/pub/skins/pmwiki/README
Normal file
@ -0,0 +1,22 @@
|
||||
This directory contains the files to display pages in PmWiki according
|
||||
to the default layout.
|
||||
|
||||
==>Don't edit these files directly, as you may lose your edits the
|
||||
next time you upgrade PmWiki!
|
||||
|
||||
Instead, copy the files to another directory in pub/skins/ and edit
|
||||
them there. You can then configure PmWiki to use your modified layout
|
||||
files by setting the $Skin variable in your local/config.php. For
|
||||
example, if you copy your custom skin to pub/skins/custom, then you
|
||||
would set
|
||||
$Skin = 'custom';
|
||||
in local/config.php.
|
||||
|
||||
The files in this directory:
|
||||
pmwiki.tmpl -- the default template for page layouts
|
||||
pmwiki.css -- PmWiki's default css
|
||||
pmwiki-32.gif -- the PmWiki logo
|
||||
|
||||
If you just want to change the logo, you can do it by setting $PageLogoUrl
|
||||
to the url location of your logo.
|
||||
|
BIN
en/wiki/pub/skins/pmwiki/pmwiki-32.gif
Normal file
After Width: | Height: | Size: 1.1 KiB |
102
en/wiki/pub/skins/pmwiki/pmwiki.css
Normal file
@ -0,0 +1,102 @@
|
||||
/***********************************************************************
|
||||
** pmwiki.css
|
||||
** Copyright 2004-2006 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
** Copyright 2006 Hagan Fox
|
||||
** This file is part of PmWiki; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published
|
||||
** by the Free Software Foundation; either version 2 of the License, or
|
||||
** (at your option) any later version. See pmwiki.php for full details.
|
||||
***********************************************************************/
|
||||
|
||||
/* This sets the overall frame for the site */
|
||||
body {
|
||||
margin:0px; background-color:#f7f7f7;
|
||||
font-family:Arial,Helvetica,sans-serif; font-size:11pt;
|
||||
}
|
||||
|
||||
/* These control the fixed-width text elements of the page */
|
||||
textarea, pre, code { font-size:0.9em; }
|
||||
pre, code { font-family:'Lucida Console','Andale Mono','Courier New',Courier,monospace; }
|
||||
pre { line-height:1.2em; }
|
||||
pre code, code code, pre pre { font-size:100%; }
|
||||
|
||||
/* These primarily adjust the size and spacing of heading elements,
|
||||
** most browsers have atrocious defaults for these. */
|
||||
h1, h2, h3, h4, h5, h6 { margin-top:1.0em; margin-bottom:0.6em; }
|
||||
h1, h2, h3, h6 { font-weight:normal; }
|
||||
h4, h5 { font-weight:bold; }
|
||||
h1 code, h2 code, h3 code, h4 code { font-size:1em; }
|
||||
h1 { font-size:1.8em; }
|
||||
h2 { font-size:1.44em; }
|
||||
h3 { font-size:1.22em; }
|
||||
h4 { font-size:1.07em; }
|
||||
h5 { font-size:1.0em; }
|
||||
h6 { font-size:1.0em; }
|
||||
|
||||
/* The #wikilogo element is the logo from $PageLogoFmt */
|
||||
#wikilogo { margin-top:4px; padding:6px; border-bottom:1px #cccccc solid; }
|
||||
|
||||
/* This controls the rest of the heading (primarily the search box) */
|
||||
#wikihead {
|
||||
position:absolute; right:10px; top:10px;
|
||||
font-family:Verdana,sans-serif; font-size:85%;
|
||||
}
|
||||
#wikihead input { font-size:85%; }
|
||||
|
||||
/* These are for the left-sidebar. */
|
||||
#wikileft {
|
||||
width:155px;
|
||||
padding:6px; border-right:1px #cccccc solid;
|
||||
line-height:1.33em;
|
||||
font-size:9.4pt; font-family:Verdana,sans-serif;
|
||||
}
|
||||
#wikileft .vspace { margin-top:1.125em; }
|
||||
#wikileft a { text-decoration:none; color:black; }
|
||||
#wikileft a:hover { text-decoration:underline; color:blue; }
|
||||
#wikileft ul { list-style:none; padding:0px; margin:0px; }
|
||||
#wikileft li { margin:0px; padding-left: 6px; }
|
||||
.sidehead {
|
||||
margin:0px; padding:4px 2px 2px 2px;
|
||||
font-size:11pt; font-weight:bold; font-style:normal;
|
||||
}
|
||||
.sidehead a
|
||||
{ color:#505050; font-weight:bold; font-style:normal; }
|
||||
|
||||
/* These affect the main content area. */
|
||||
#wikibody {
|
||||
padding:0px 10px 10px 10px; background-color:white;
|
||||
font-size:11pt;
|
||||
}
|
||||
#wikicmds {
|
||||
float:right; white-space:nowrap;
|
||||
font-family:Verdana,sans-serif; font-size:80%;
|
||||
}
|
||||
#wikicmds ul { list-style:none; margin:0px; padding:0px; }
|
||||
#wikicmds li { display:inline; margin:0px 5px; }
|
||||
#wikicmds li a { text-decoration:none; color:black; border:none; }
|
||||
#wikicmds li a.createlink { display:none; }
|
||||
#wikicmds li a:hover { text-decoration:underline; color:blue; }
|
||||
.pagegroup { margin-top:8px; margin-bottom:2px; }
|
||||
.pagetitle { line-height:1em; margin:0px; font-size:1.6em; font-weight:normal; }
|
||||
.wikiaction { margin-top:4px; margin-bottom:4px; }
|
||||
#wikitext { margin-top:12px; line-height:1.33em; }
|
||||
#wikitext table { font-size:100%; line-height:1.33em; } /* For MSIE 5.5 */
|
||||
|
||||
/* These are for the edit form. */
|
||||
#wikiedit form { margin:0px; width:100%; }
|
||||
#wikiedit textarea { width:100%; }
|
||||
.wikimessage { margin-top:4px; margin-bottom:4px; font-style:italic; }
|
||||
|
||||
/* These affect the lines at the very bottom. */
|
||||
#wikifoot {
|
||||
padding-left:178px; padding-bottom:4px; border-top:1px #cccccc solid;
|
||||
font-family:Verdana,sans-serif; font-size:80%;
|
||||
}
|
||||
|
||||
/* These affect the printed appearance of the web view (not the separate
|
||||
** print view) of pages. The sidebar and action links aren't printed. */
|
||||
@media print {
|
||||
body { width:auto; margin:0px; padding:0.5em; }
|
||||
#wikihead, #wikileft, #wikicmds, .footnav { display:none; }
|
||||
#wikifoot { padding:2px; }
|
||||
}
|
79
en/wiki/pub/skins/pmwiki/pmwiki.tmpl
Normal file
@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>$WikiTitle | {$Group} / {$Title} $ActionTitle</title>
|
||||
<meta http-equiv='Content-Style-Type' content='text/css' />
|
||||
<link rel='stylesheet' href='$SkinDirUrl/pmwiki.css' type='text/css' />
|
||||
<!--HTMLHeader-->
|
||||
</head>
|
||||
<body>
|
||||
<!--PageHeaderFmt-->
|
||||
<div id='wikilogo'><a href='{$ScriptUrl}'><img src='$PageLogoUrl'
|
||||
alt='$WikiTitle' border='0' /></a></div>
|
||||
<div id='wikihead'>
|
||||
<form action='{$ScriptUrl}'>
|
||||
<span class='headnav'><a href='{$ScriptUrl}/$[{$Group}/RecentChanges]'
|
||||
accesskey='$[ak_recentchanges]'>$[Recent Changes]</a> -</span>
|
||||
<input type='hidden' name='n' value='{$FullName}' />
|
||||
<input type='hidden' name='action' value='search' />
|
||||
<a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a>:
|
||||
<input type='text' name='q' value='' class='inputbox searchbox' />
|
||||
<input type='submit' class='inputbutton searchbutton'
|
||||
value='$[Go]' /></form></div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<table id='wikimid' width='100%' cellspacing='0' cellpadding='0'><tr>
|
||||
<!--PageLeftFmt-->
|
||||
<td id='wikileft' valign='top'>
|
||||
<!--wiki:{$Group}.SideBar {$SiteGroup}.SideBar--></td>
|
||||
<!--/PageLeftFmt-->
|
||||
<td id='wikibody' valign='top'>
|
||||
<!--PageActionFmt-->
|
||||
<div id='wikicmds'><!--wiki:{$Group}.PageActions {$SiteGroup}.PageActions--></div>
|
||||
<!--PageTitleFmt-->
|
||||
<div id='wikititle'>
|
||||
<div class='pagegroup'><a href='{$ScriptUrl}/{$Group}'>{$Group}</a> /</div>
|
||||
<h1 class='pagetitle'>{$Title}</h1></div>
|
||||
<!--PageText-->
|
||||
</td>
|
||||
</tr></table>
|
||||
<!--PageFooterFmt-->
|
||||
<div id='wikifoot'>
|
||||
<div class='footnav'>
|
||||
<a rel="nofollow" href='{$PageUrl}?action=edit'>$[Edit]</a> -
|
||||
<a rel="nofollow" href='{$PageUrl}?action=diff'>$[History]</a> -
|
||||
<a rel="nofollow" href='{$PageUrl}?action=print' target='_blank'>$[Print]</a> -
|
||||
<a href='{$ScriptUrl}/$[{$Group}/RecentChanges]'>$[Recent Changes]</a> -
|
||||
<a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a></div>
|
||||
<div class='lastmod'>$[Page last modified on {$LastModified}]</div></div>
|
||||
<!--HTMLFooter-->
|
||||
|
||||
<!-- Yandex.Metrika counter -->
|
||||
<script type="text/javascript">
|
||||
(function (d, w, c) {
|
||||
(w[c] = w[c] || []).push(function() {
|
||||
try {
|
||||
w.yaCounter25827098 = new Ya.Metrika({id:25827098,
|
||||
clickmap:true,
|
||||
accurateTrackBounce:true});
|
||||
} catch(e) { }
|
||||
});
|
||||
|
||||
var n = d.getElementsByTagName("script")[0],
|
||||
s = d.createElement("script"),
|
||||
f = function () { n.parentNode.insertBefore(s, n); };
|
||||
s.type = "text/javascript";
|
||||
s.async = true;
|
||||
s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
|
||||
|
||||
if (w.opera == "[object Opera]") {
|
||||
d.addEventListener("DOMContentLoaded", f, false);
|
||||
} else { f(); }
|
||||
})(document, window, "yandex_metrika_callbacks");
|
||||
</script>
|
||||
<noscript><div><img src="//mc.yandex.ru/watch/25827098" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||
<!-- /Yandex.Metrika counter -->
|
||||
|
||||
</body>
|
||||
</html>
|
20
en/wiki/pub/skins/print/README
Normal file
@ -0,0 +1,20 @@
|
||||
This directory contains the files to print pages in PmWiki for ?action=print.
|
||||
This is a template just like any other layout skin, except that for
|
||||
?action=print PmWiki looks for print.tmpl instead of screen.tmpl.
|
||||
|
||||
==>Don't edit these files directly, as you may lose your edits the
|
||||
next time you upgrade PmWiki!
|
||||
|
||||
Instead, copy the files to another directory in pub/skins/ and edit
|
||||
them there. You can then configure PmWiki to use your modified layout
|
||||
files by setting $ActionSkin['print'] to the name of your new skin.
|
||||
For example, if you copy your custom print skin to pub/skins/custom,
|
||||
then you would set
|
||||
$ActionSkin['print'] = 'custom';
|
||||
in local/config.php.
|
||||
|
||||
The files in this directory:
|
||||
print.tmpl -- the default template for ?action=print
|
||||
print.css -- the print template's css
|
||||
print.php -- loaded when the skin is loaded, it redefines the link
|
||||
formats to a form better suited for printing
|
50
en/wiki/pub/skins/print/print.css
Normal file
@ -0,0 +1,50 @@
|
||||
/***********************************************************************
|
||||
** print.css
|
||||
** Copyright 2004 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
** This file is part of PmWiki; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published
|
||||
** by the Free Software Foundation; either version 2 of the License, or
|
||||
** (at your option) any later version. See pmwiki.php for full details.
|
||||
***********************************************************************/
|
||||
|
||||
/***********************************************************************
|
||||
** These settings are part of the ?action=print skin. If you want
|
||||
** to change these settings, create a new print template and set
|
||||
** $PrintTemplateFmt in the config.php file to point to your new
|
||||
** printing skin.
|
||||
***********************************************************************/
|
||||
|
||||
body {
|
||||
width:auto;
|
||||
background-color:white;
|
||||
color:black;
|
||||
font-family:serif;
|
||||
}
|
||||
|
||||
#printhead {
|
||||
font-family:sans-serif;
|
||||
border-top:3px solid #a0a0a0;
|
||||
border-bottom:5px solid #a0a0a0;
|
||||
margin-bottom:1em;
|
||||
}
|
||||
#printhead h3 { margin-top:0px; }
|
||||
#printhead h1 { margin-bottom:0px; }
|
||||
|
||||
#printtitle {
|
||||
}
|
||||
|
||||
#printfoot {
|
||||
clear:both;
|
||||
margin-top:1em;
|
||||
border-top:5px solid #a0a0a0;
|
||||
font-size:smaller;
|
||||
}
|
||||
|
||||
|
||||
a:link { color:#444444; font-weight:bold; text-decoration:none; }
|
||||
a:visited { color:#444444; font-weight:bold; text-decoration:none; }
|
||||
a.wikilink:hover { color: #444444; text-decoration:underline; }
|
||||
a.createlink { color:#444444; }
|
||||
a.createlink:visited { color:#444444; }
|
||||
a.createlink:hover { color:#ff2222; }
|
||||
|
29
en/wiki/pub/skins/print/print.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
/* Copyright 2004 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
This file is part of PmWiki; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
||||
|
||||
This script defines additional settings needed when the 'print'
|
||||
skin is loaded (usually in response to ?action=print, as controlled
|
||||
by the $ActionSkin['print'] setting. See scripts/skins.php for
|
||||
more details.
|
||||
|
||||
The changes made are:
|
||||
- Redefines the standard layout to a format suitable for printing
|
||||
- Redefines internal links to keep ?action=print
|
||||
- Changes the display of URL and mailto: links
|
||||
- Uses GroupPrintHeader and GroupPrintFooter pages instead
|
||||
of GroupHeader and GroupFooter
|
||||
*/
|
||||
|
||||
global $LinkPageExistsFmt, $GroupPrintHeaderFmt,
|
||||
$GroupPrintFooterFmt, $GroupHeaderFmt, $GroupFooterFmt;
|
||||
|
||||
$LinkPageExistsFmt = "<a class='wikilink' href='\$PageUrl?action=print'>\$LinkText</a>";
|
||||
SDV($GroupPrintHeaderFmt,'(:include $Group.GroupPrintHeader basepage={*$FullName}:)(:nl:)');
|
||||
SDV($GroupPrintFooterFmt,'(:nl:)(:include $Group.GroupPrintFooter basepage={*$FullName}:)');
|
||||
$GroupHeaderFmt = $GroupPrintHeaderFmt;
|
||||
$GroupFooterFmt = $GroupPrintFooterFmt;
|
||||
|
20
en/wiki/pub/skins/print/print.tmpl
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<title>$WikiTitle | {$Group} / {$Title}</title>
|
||||
<link rel='stylesheet' href='$SkinDirUrl/print.css' type='text/css' />
|
||||
<!--HTMLHeader-->
|
||||
</head>
|
||||
<body>
|
||||
<div id='printhead'>
|
||||
<h3>$[From $WikiTitle]</h3>
|
||||
<h1 class='pagename'><a href='$ScriptUrl/{$Group}'>{$Group}: {$Title}</a></h1>
|
||||
</div>
|
||||
<!--PageText-->
|
||||
<div id='printfoot'>
|
||||
<div class='from'>$[Retrieved from {$PageUrl}]</div>
|
||||
<div class='lastmod'>$[Page last modified on {$LastModified}]</div></div>
|
||||
<!--HTMLFooter-->
|
||||
</body>
|
||||
</html>
|
12
en/wiki/scripts/.htaccess
Normal file
@ -0,0 +1,12 @@
|
||||
# This file is script/.htaccess -- the default distribution contains this
|
||||
# file to prevent script/ files from being accessed directly by browsers
|
||||
# (this is a potential, albeit very unlikely, security hole).
|
||||
#
|
||||
# If you alter or replace this file, it will likely be overwritten when
|
||||
# you upgrade from one version of PmWiki to another. Be sure to save
|
||||
# a copy of your alterations in another location so you can restore them,
|
||||
# and you might try changing this file to be read-only to prevent a PmWiki
|
||||
# upgrade from overwriting your altered version.
|
||||
|
||||
Order Deny,Allow
|
||||
Deny from all
|
54
en/wiki/scripts/author.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
/* Copyright 2004-2013 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
This file is part of PmWiki; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
||||
|
||||
This script handles author tracking.
|
||||
*/
|
||||
|
||||
SDV($AuthorNameChars, "- '\\w\\x80-\\xff");
|
||||
SDV($AuthorCookie, $CookiePrefix.'author');
|
||||
SDV($AuthorCookieExpires,$Now+60*60*24*30);
|
||||
SDV($AuthorCookieDir,'/');
|
||||
SDV($AuthorGroup,'Profiles');
|
||||
SDV($AuthorRequiredFmt,
|
||||
"<h3 class='wikimessage'>$[An author name is required.]</h3>");
|
||||
Markup('[[~','<links','/\\[\\[~(.*?)\\]\\]/',"[[$AuthorGroup/$1]]");
|
||||
|
||||
$LogoutCookies[] = $AuthorCookie;
|
||||
|
||||
if (!isset($Author)) {
|
||||
if (isset($_POST['author'])) {
|
||||
$x = stripmagic($_POST['author']);
|
||||
setcookie($AuthorCookie, $x, $AuthorCookieExpires, $AuthorCookieDir);
|
||||
} elseif (@$_COOKIE[$AuthorCookie]) {
|
||||
$x = stripmagic(@$_COOKIE[$AuthorCookie]);
|
||||
} else $x = @$AuthId;
|
||||
$Author = PHSC(preg_replace("/[^$AuthorNameChars]/", '', $x),
|
||||
ENT_COMPAT);
|
||||
}
|
||||
if (!isset($AuthorPage)) $AuthorPage =
|
||||
FmtPageName('$AuthorGroup/$Name', MakePageName("$AuthorGroup.$AuthorGroup", $Author));
|
||||
SDV($AuthorLink,($Author) ? "[[~$Author]]" : '?');
|
||||
|
||||
if (IsEnabled($EnableAuthorSignature,1)) {
|
||||
SDVA($ROSPatterns, array(
|
||||
'/(?<!~)~~~~(?!~)/' => "[[~$Author]] $CurrentTime",
|
||||
'/(?<!~)~~~(?!~)/' => "[[~$Author]]",
|
||||
));
|
||||
Markup('~~~~','<[[~','/(?<!~)~~~~(?!~)/',"[[~$Author]] $CurrentTime");
|
||||
Markup('~~~','>~~~~','/(?<!~)~~~(?!~)/',"[[~$Author]]");
|
||||
}
|
||||
if (IsEnabled($EnablePostAuthorRequired,0))
|
||||
array_unshift($EditFunctions,'RequireAuthor');
|
||||
|
||||
## RequireAuthor forces an author to enter a name before posting.
|
||||
function RequireAuthor($pagename, &$page, &$new) {
|
||||
global $Author, $MessagesFmt, $AuthorRequiredFmt, $EnablePost;
|
||||
if (!$Author) {
|
||||
$MessagesFmt[] = $AuthorRequiredFmt;
|
||||
$EnablePost = 0;
|
||||
}
|
||||
}
|
213
en/wiki/scripts/authuser.php
Normal file
@ -0,0 +1,213 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
/* Copyright 2005-2015 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
This file is part of PmWiki; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
||||
|
||||
The APR compatible MD5 encryption algorithm in _crypt() below is
|
||||
based on code Copyright 2005 by D. Faure and the File::Passwd
|
||||
PEAR library module by Mike Wallner <mike@php.net>.
|
||||
|
||||
This script enables simple authentication based on username and
|
||||
password combinations. At present this script can authenticate
|
||||
from passwords held in arrays or in .htpasswd-formatted files,
|
||||
but eventually it will support authentication via sources such
|
||||
as LDAP and Active Directory.
|
||||
|
||||
To configure a .htpasswd-formatted file for authentication, do
|
||||
$AuthUser['htpasswd'] = '/path/to/.htpasswd';
|
||||
prior to including this script.
|
||||
|
||||
Individual username/password combinations can also be placed
|
||||
directly in the $AuthUser array, such as:
|
||||
$AuthUser['pmichaud'] = pmcrypt('secret');
|
||||
|
||||
To authenticate against an LDAP server, put the url for
|
||||
the server in $AuthUser['ldap'], as in:
|
||||
$AuthUser['ldap'] = 'ldap://ldap.example.com/ou=People,o=example?uid';
|
||||
*/
|
||||
|
||||
# let Site.AuthForm know that we're doing user-based authorization
|
||||
$EnableAuthUser = 1;
|
||||
|
||||
if (@$_POST['authid'])
|
||||
AuthUserId($pagename, stripmagic(@$_POST['authid']),
|
||||
stripmagic(@$_POST['authpw']));
|
||||
else SessionAuth($pagename);
|
||||
|
||||
function AuthUserId($pagename, $id, $pw=NULL) {
|
||||
global $AuthUser, $AuthUserPageFmt, $AuthUserFunctions,
|
||||
$AuthId, $MessagesFmt, $AuthUserPat;
|
||||
|
||||
$auth = array();
|
||||
foreach((array)$AuthUser as $k=>$v) $auth[$k] = (array)$v;
|
||||
$authid = '';
|
||||
|
||||
# load information from SiteAdmin.AuthUser (or page in $AuthUserPageFmt)
|
||||
SDV($AuthUserPageFmt, '$SiteAdminGroup.AuthUser');
|
||||
SDVA($AuthUserFunctions, array(
|
||||
'htpasswd' => 'AuthUserHtPasswd',
|
||||
'ldap' => 'AuthUserLDAP',
|
||||
# 'mysql' => 'AuthUserMySQL',
|
||||
$id => 'AuthUserConfig'));
|
||||
|
||||
SDV($AuthUserPat, "/^\\s*([@\\w][^\\s:]*):(.*)/m");
|
||||
$pn = FmtPageName($AuthUserPageFmt, $pagename);
|
||||
$apage = ReadPage($pn, READPAGE_CURRENT);
|
||||
if ($apage && preg_match_all($AuthUserPat,
|
||||
$apage['text'], $matches, PREG_SET_ORDER)) {
|
||||
foreach($matches as $m) {
|
||||
if (!preg_match_all('/\\bldaps?:\\S+|[^\\s,]+/', $m[2], $v))
|
||||
continue;
|
||||
if ($m[1]{0} == '@')
|
||||
foreach($v[0] as $g) $auth[$g][] = $m[1];
|
||||
else $auth[$m[1]] = array_merge((array)@$auth[$m[1]], $v[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (func_num_args()==2) $authid = $id;
|
||||
else
|
||||
foreach($AuthUserFunctions as $k => $fn)
|
||||
if (@$auth[$k] && $fn($pagename, $id, $pw, $auth[$k], $authlist))
|
||||
{ $authid = $id; break; }
|
||||
|
||||
if (!$authid) { $GLOBALS['InvalidLogin'] = 1; return; }
|
||||
if (!isset($AuthId)) $AuthId = $authid;
|
||||
$authlist["id:$authid"] = 1;
|
||||
$authlist["id:-$authid"] = -1;
|
||||
foreach(preg_grep('/^@/', (array)@$auth[$authid]) as $g)
|
||||
$authlist[$g] = 1;
|
||||
foreach(preg_grep('/^@/', (array)@$auth['*']) as $g)
|
||||
$authlist[$g] = 1;
|
||||
foreach(preg_grep('/^@/', array_keys($auth)) as $g) # useless? PITS:01201
|
||||
if (in_array($authid, $auth[$g])) $authlist[$g] = 1;
|
||||
if ($auth['htgroup']) {
|
||||
foreach(AuthUserHtGroup($pagename, $id, $pw, $auth['htgroup']) as $g)
|
||||
$authlist["@$g"] = 1;
|
||||
}
|
||||
foreach(preg_grep('/^@/', (array)@$auth["-$authid"]) as $g)
|
||||
unset($authlist[$g]);
|
||||
SessionAuth($pagename, array('authid' => $authid, 'authlist' => $authlist));
|
||||
}
|
||||
|
||||
|
||||
function AuthUserConfig($pagename, $id, $pw, $pwlist) {
|
||||
foreach ((array)$pwlist as $chal)
|
||||
if (_crypt($pw, $chal) == $chal) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function AuthUserHtPasswd($pagename, $id, $pw, $pwlist) {
|
||||
foreach ((array)$pwlist as $f) {
|
||||
$fp = fopen($f, "r"); if (!$fp) continue;
|
||||
while ($x = fgets($fp, 1024)) {
|
||||
$x = rtrim($x);
|
||||
@list($i, $c, $r) = explode(':', $x, 3);
|
||||
if ($i == $id && _crypt($pw, $c) == $c) { fclose($fp); return true; }
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function AuthUserHtGroup($pagename, $id, $pw, $pwlist) {
|
||||
$groups = array();
|
||||
foreach ((array)$pwlist as $f) {
|
||||
$fp = fopen($f, 'r'); if (!$fp) continue;
|
||||
while ($x = fgets($fp, 4096)) {
|
||||
if (preg_match('/^(\\w[^\\s:]+)\\s*:(.*)$/', trim($x), $match)) {
|
||||
$glist = preg_split('/[\\s,]+/', $match[2], -1, PREG_SPLIT_NO_EMPTY);
|
||||
if (in_array($id, $glist)) $groups[$match[1]] = 1;
|
||||
}
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
return array_keys($groups);
|
||||
}
|
||||
|
||||
|
||||
function AuthUserLDAP($pagename, $id, $pw, $pwlist) {
|
||||
global $AuthLDAPBindDN, $AuthLDAPBindPassword;
|
||||
if (!$pw) return false;
|
||||
if (!function_exists('ldap_connect'))
|
||||
Abort('authuser: LDAP authentication requires PHP ldap functions','ldapfn');
|
||||
foreach ((array)$pwlist as $ldap) {
|
||||
if (!preg_match('!(ldaps?://[^/]+)/(.*)$!', $ldap, $match))
|
||||
continue;
|
||||
## connect to the LDAP server
|
||||
list($z, $url, $path) = $match;
|
||||
$ds = ldap_connect($url);
|
||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
## For Active Directory, don't specify a path and we simply
|
||||
## attempt to bind with the username and password directly
|
||||
if (!$path && @ldap_bind($ds, $id, $pw)) { ldap_close($ds); return true; }
|
||||
## Otherwise, we use Apache-style urls for LDAP authentication
|
||||
## Split the path into its search components
|
||||
list($basedn, $attr, $sub, $filter) = explode('?', $path);
|
||||
if (!$attr) $attr = 'uid';
|
||||
if (!$sub) $sub = 'one';
|
||||
if (!$filter) $filter = '(objectClass=*)';
|
||||
$binddn = @$AuthLDAPBindDN;
|
||||
$bindpw = @$AuthLDAPBindPassword;
|
||||
if (ldap_bind($ds, $binddn, $bindpw)) {
|
||||
## Search for the appropriate uid
|
||||
$fn = ($sub == 'sub') ? 'ldap_search' : 'ldap_list';
|
||||
$sr = $fn($ds, $basedn, "(&$filter($attr=$id))", array($attr));
|
||||
$x = ldap_get_entries($ds, $sr);
|
||||
## If we find a unique id, bind to it for success
|
||||
if ($x['count'] == 1) {
|
||||
$dn = $x[0]['dn'];
|
||||
if (@ldap_bind($ds, $dn, $pw)) { ldap_close($ds); return true; }
|
||||
}
|
||||
}
|
||||
ldap_close($ds);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
# The _crypt function provides support for SHA1 encrypted passwords
|
||||
# (keyed by '{SHA}') and Apache MD5 encrypted passwords (keyed by
|
||||
# '$apr1$'); otherwise it just calls PHP's crypt() for the rest.
|
||||
# The APR MD5 encryption code was contributed by D. Faure.
|
||||
|
||||
function _crypt($plain, $salt=null) {
|
||||
if (strncmp($salt, '{SHA}', 5) == 0)
|
||||
return '{SHA}'.base64_encode(pack('H*', sha1($plain)));
|
||||
if (strncmp($salt, '$apr1$', 6) == 0) {
|
||||
preg_match('/^\\$apr1\\$([^$]+)/', $salt, $match);
|
||||
$salt = $match[1];
|
||||
$length = strlen($plain);
|
||||
$context = $plain . '$apr1$' . $salt;
|
||||
$binary = pack('H32', md5($plain . $salt . $plain));
|
||||
for($i = $length; $i > 0; $i -= 16)
|
||||
$context .= substr($binary, 0, min(16, $i));
|
||||
for($i = $length; $i > 0; $i >>= 1)
|
||||
$context .= ($i & 1) ? chr(0) : $plain{0};
|
||||
$binary = pack('H32', md5($context));
|
||||
for($i = 0; $i < 1000; $i++) {
|
||||
$new = ($i & 1) ? $plain : $binary;
|
||||
if ($i % 3) $new .= $salt;
|
||||
if ($i % 7) $new .= $plain;
|
||||
$new .= ($i & 1) ? $binary : $plain;
|
||||
$binary = pack('H32', md5($new));
|
||||
}
|
||||
$q = '';
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
$k = $i + 6;
|
||||
$j = $i + 12;
|
||||
if ($j == 16) $j = 5;
|
||||
$q = $binary{$i}.$binary{$k}.$binary{$j} . $q;
|
||||
}
|
||||
$q = chr(0).chr(0).$binary{11} . $q;
|
||||
$q = strtr(strrev(substr(base64_encode($q), 2)),
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
||||
'./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');
|
||||
return "\$apr1\$$salt\$$q";
|
||||
}
|
||||
if (md5($plain) == $salt) return $salt;
|
||||
return pmcrypt($plain, $salt);
|
||||
}
|
240
en/wiki/scripts/blocklist.php
Normal file
@ -0,0 +1,240 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
/* Copyright 2006-2013 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
This file is part of PmWiki; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
||||
|
||||
This script adds blocklisting capabilities to PmWiki, and can
|
||||
be enabled by simply setting the following in local/config.php:
|
||||
|
||||
$EnableBlocklist = 1;
|
||||
|
||||
With $EnableBlocklist set to 1, this module will search through
|
||||
the SiteAdmin.Blocklist page, as well as any other pages given by
|
||||
the $Blocklist pages variable, looking for lines of the
|
||||
form "block:some phrase" or "block:/regex/", with "some phrase"
|
||||
and "/regex/" indicating things to be excluded from any
|
||||
posting to the site.
|
||||
|
||||
In addition, if a page contains IP addresses of the form
|
||||
"a.b.c.d" or "a.b.c.*", then any posts coming from hosts
|
||||
matching the address will be blocked.
|
||||
|
||||
There is also an "unblock:..." form, which removes an entry
|
||||
from the blocklist. This is useful for removing specific
|
||||
block items in wikifarms and with automatically downloaded
|
||||
blocklists (below).
|
||||
|
||||
The script also has the capability of automatically downloading
|
||||
blocklists from other sources, such as chongqed.org and
|
||||
and the MoinMaster blocklist. These are configured using
|
||||
the $BlocklistDownload array. An $EnableBlocklist value
|
||||
of at least 10 configures PmWiki to automatically download
|
||||
these external blocklists and refresh them daily.
|
||||
|
||||
More information about blocklists is available in the
|
||||
PmWiki.Blocklist page.
|
||||
*/
|
||||
|
||||
|
||||
## Some recipes do page updates outside of the built-in posting
|
||||
## cycle, so $EnableBlocklistImmediate is used to determine if
|
||||
## we need to catch these. Currently this defaults to enabled,
|
||||
## but at some point we may change the default to disabled.
|
||||
if (IsEnabled($EnableBlocklistImmediate, 1)) {
|
||||
SDVA($BlocklistActions, array('comment' => 1));
|
||||
$ptext = implode(' ', @$_POST);
|
||||
if ($ptext && @$BlocklistActions[$action]) {
|
||||
Blocklist($pagename, $ptext);
|
||||
if (!$EnablePost) {
|
||||
unset($_POST['post']);
|
||||
unset($_POST['postattr']);
|
||||
unset($_POST['postedit']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
## If $EnableBlocklist is set to 10 or higher, then arrange to
|
||||
## periodically download the "chongqed" and "moinmaster" blacklists.
|
||||
if ($EnableBlocklist >= 10) {
|
||||
# SDVA($BlocklistDownload['SiteAdmin.Blocklist-Chongqed'], array(
|
||||
# 'url' => 'http://blacklist.chongqed.org/',
|
||||
# 'format' => 'regex'));
|
||||
SDVA($BlocklistDownload['SiteAdmin.Blocklist-MoinMaster'], array(
|
||||
'url' => 'http://moinmo.in/BadContent?action=raw',
|
||||
'format' => 'regex'));
|
||||
}
|
||||
|
||||
|
||||
## CheckBlocklist is inserted into $EditFunctions, to automatically
|
||||
## check for blocks on anything being posted through the normal
|
||||
## "update a page cycle"
|
||||
array_unshift($EditFunctions, 'CheckBlocklist');
|
||||
function CheckBlocklist($pagename, &$page, &$new) {
|
||||
StopWatch("CheckBlocklist: begin $pagename");
|
||||
$ptext = implode(' ', @$_POST);
|
||||
if (@$ptext) Blocklist($pagename, $ptext);
|
||||
StopWatch("CheckBlocklist: end $pagename");
|
||||
}
|
||||
|
||||
|
||||
## Blocklist is the function that does all of the work of
|
||||
## checking for reasons to block a posting. It reads
|
||||
## the available blocklist pages ($BlocklistPages) and
|
||||
## builds an array of strings and regular expressiongs to
|
||||
## be checked against the page; if any are found, then
|
||||
## posting is blocked (via $EnablePost=0). The function
|
||||
## also checks the REMOTE_ADDR against any blocked IP addresses.
|
||||
function Blocklist($pagename, $text) {
|
||||
global $BlocklistPages, $BlockedMessagesFmt, $BlocklistDownload,
|
||||
$BlocklistDownloadRefresh, $Now, $EnablePost, $WhyBlockedFmt,
|
||||
$MessagesFmt, $BlocklistMessageFmt, $EnableWhyBlocked, $IsBlocked;
|
||||
|
||||
StopWatch("Blocklist: begin $pagename");
|
||||
|
||||
$BlocklistDownload = (array)@$BlocklistDownload;
|
||||
SDV($BlocklistPages,
|
||||
array_merge(array('$SiteAdminGroup.Blocklist',
|
||||
'$SiteAdminGroup.Blocklist-Farm'),
|
||||
array_keys($BlocklistDownload)));
|
||||
SDV($BlocklistMessageFmt, "<h3 class='wikimessage'>$[This post has been blocked by the administrator]</h3>");
|
||||
SDVA($BlockedMessagesFmt, array(
|
||||
'ip' => '$[Address blocked from posting]: ',
|
||||
'text' => '$[Text blocked from posting]: '));
|
||||
SDV($BlocklistDownloadRefresh, 86400);
|
||||
|
||||
## Loop over all blocklist pages
|
||||
foreach((array)$BlocklistPages as $b) {
|
||||
|
||||
## load the current blocklist page
|
||||
$pn = FmtPageName($b, $pagename);
|
||||
$page = ReadPage($pn, READPAGE_CURRENT);
|
||||
if (!$page) continue;
|
||||
|
||||
## if the page being checked is a blocklist page, stop blocking
|
||||
if ($pagename == $pn) return;
|
||||
|
||||
## If the blocklist page is managed by automatic download,
|
||||
## schedule any new downloads here
|
||||
if (@$BlocklistDownload[$pn]) {
|
||||
$bd = &$BlocklistDownload[$pn];
|
||||
SDVA($bd, array(
|
||||
'refresh' => $BlocklistDownloadRefresh,
|
||||
'url' => "http://www.pmwiki.org/blocklists/$pn" ));
|
||||
if (!@$page['text'] || $page['time'] < $Now - $bd['refresh'])
|
||||
register_shutdown_function('BlocklistDownload', $pn, getcwd());
|
||||
}
|
||||
|
||||
## If the blocklist is simply a list of regexes to be matched, load
|
||||
## them into $terms['block'] and continue to the next blocklist page.
|
||||
## Some regexes from remote sites aren't well-formed, so we have
|
||||
## to escape any slashes that aren't already escaped.
|
||||
if (strpos(@$page['text'], 'blocklist-format: regex') !==false) {
|
||||
if (preg_match_all('/^([^\\s#].+)/m', $page['text'], $match))
|
||||
foreach($match[0] as $m) {
|
||||
$m = preg_replace('#(?<!\\\\)/#', '\\/', trim($m));
|
||||
$terms['block'][] = "/$m/";
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
## Treat the page as a pmwiki-format blocklist page, with
|
||||
## IP addresses and "block:"-style declarations. First, see
|
||||
## if we need to block the author based on a.b.c.d or a.b.c.*
|
||||
## IP addresses.
|
||||
$ip = preg_quote($_SERVER['REMOTE_ADDR']);
|
||||
$ip = preg_replace('/\\d+$/', '($0\\b|\\*)', $ip);
|
||||
if (preg_match("/\\b$ip/", @$page['text'], $match)) {
|
||||
$EnablePost = 0;
|
||||
$IsBlocked = 1;
|
||||
$WhyBlockedFmt[] = $BlockedMessagesFmt['ip'] . $match[0];
|
||||
}
|
||||
|
||||
## Now we'll load any "block:" or "unblock:" specifications
|
||||
## from the page text.
|
||||
if (preg_match_all('/(un)?(?:block|regex):(.*)/', @$page['text'],
|
||||
$match, PREG_SET_ORDER))
|
||||
foreach($match as $m) $terms[$m[1].'block'][] = trim($m[2]);
|
||||
}
|
||||
|
||||
## okay, we've loaded all of the terms, now subtract any 'unblock'
|
||||
## terms from the block set.
|
||||
StopWatch("Blocklist: diff unblock");
|
||||
$blockterms = array_diff((array)@$terms['block'], (array)@$terms['unblock']);
|
||||
|
||||
## go through each of the remaining blockterms and see if it matches the
|
||||
## text -- if so, disable posting and add a message to $WhyBlockedFmt.
|
||||
StopWatch('Blocklist: blockterms (count='.count($blockterms).')');
|
||||
$itext = strtolower($text);
|
||||
foreach($blockterms as $b) {
|
||||
if ($b{0} == '/') {
|
||||
if (!preg_match($b, $text)) continue;
|
||||
} else if (strpos($itext, strtolower($b)) === false) continue;
|
||||
$EnablePost = 0;
|
||||
$IsBlocked = 1;
|
||||
$WhyBlockedFmt[] = $BlockedMessagesFmt['text'] . $b;
|
||||
}
|
||||
StopWatch('Blocklist: blockterms done');
|
||||
|
||||
## If we came across any reasons to block, let's provide a message
|
||||
## to the author that it was blocked. If $EnableWhyBlocked is set,
|
||||
## we'll even tell the author why. :-)
|
||||
if (@$WhyBlockedFmt) {
|
||||
$MessagesFmt[] = $BlocklistMessageFmt;
|
||||
if (IsEnabled($EnableWhyBlocked, 0))
|
||||
foreach((array)$WhyBlockedFmt as $why)
|
||||
$MessagesFmt[] = "<pre class='blocklistmessage'>$why</pre>\n";
|
||||
}
|
||||
StopWatch("Blocklist: end $pagename");
|
||||
}
|
||||
|
||||
|
||||
## BlocklistDownload() handles retrieving blocklists from
|
||||
## external sources into PmWiki pages. If it's able to
|
||||
## download an updated list, it uses that; otherwise it leaves
|
||||
## any existing list alone.
|
||||
function BlocklistDownload($pagename, $dir = '') {
|
||||
global $BlocklistDownloadFmt, $BlocklistDownload, $FmtV;
|
||||
|
||||
if ($dir) { flush(); chdir($dir); }
|
||||
SDV($BlocklistDownloadFmt, "
|
||||
[@
|
||||
## blocklist-note: NOTE: This page is automatically generated by blocklist.php
|
||||
## blocklist-note: NOTE: Any edits to this page may be lost!
|
||||
## blocklist-url: \$BlocklistDownloadUrl
|
||||
## blocklist-when: \$CurrentTimeISO
|
||||
# blocklist-format: \$BlocklistFormat
|
||||
\$BlocklistData
|
||||
@]
|
||||
");
|
||||
|
||||
## get the existing blocklist page
|
||||
$bd = &$BlocklistDownload[$pagename];
|
||||
$page = ReadPage($pagename, READPAGE_CURRENT);
|
||||
|
||||
## try to retrieve the remote data
|
||||
$blocklistdata = @file($bd['url']);
|
||||
|
||||
## if we didn't get it, and we don't already have text, save a
|
||||
## note in the page so we know what happened
|
||||
if (!$blocklistdata && !@$page['text']) {
|
||||
$auf = ini_get('allow_url_fopen');
|
||||
$blocklistdata = "#### Unable to download blocklist (allow_url_fopen=$auf)";
|
||||
}
|
||||
|
||||
## if we have some new text to save, let's format it and save it
|
||||
if ($blocklistdata) {
|
||||
$blocklistdata = implode('', (array)$blocklistdata);
|
||||
$blocklistdata = preg_replace('/^##blocklist.*/m', '', $blocklistdata);
|
||||
$FmtV['$BlocklistData'] = $blocklistdata;
|
||||
$FmtV['$BlocklistDownloadUrl'] = $bd['url'];
|
||||
$FmtV['$BlocklistFormat'] = $bd['format'];
|
||||
$page['text'] = FmtPageName($BlocklistDownloadFmt, $pagename);
|
||||
SDV($page['passwdread'], '@lock');
|
||||
}
|
||||
|
||||
## save our updated(?) blocklist page
|
||||
WritePage($pagename, $page);
|
||||
}
|
63
en/wiki/scripts/caches.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
/* Copyright 2006-2014 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
This file is part of PmWiki; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
||||
|
||||
*/
|
||||
|
||||
## Browser cache-control. If this is a cacheable action (e.g., browse,
|
||||
## diff), then set the Last-Modified header to the time the site was
|
||||
## last modified. If the browser has provided us with a matching
|
||||
## If-Modified-Since request header, we can return 304 Not Modified.
|
||||
SDV($LastModFile,"$WorkDir/.lastmod");
|
||||
if (!$LastModFile) return;
|
||||
|
||||
$LastModTime = @filemtime($LastModFile);
|
||||
foreach(get_included_files() as $f)
|
||||
{ $v = @filemtime($f); if ($v > $LastModTime) $LastModTime = $v; }
|
||||
|
||||
if (@$EnableIMSCaching) {
|
||||
SDV($IMSCookie, $CookiePrefix.'imstime');
|
||||
SDV($IMSCookieExpires, $Now + 60*60*24*30);
|
||||
SDV($IMSInvalidators, array('authpw', 'author'));
|
||||
$LogoutCookies[] = $IMSCookie;
|
||||
|
||||
if ($IMSCookie) {
|
||||
$IMSTime = @$_COOKIE[$IMSCookie];
|
||||
if ($IMSTime < $LastModTime
|
||||
|| array_intersect($IMSInvalidators, array_keys($_POST))) {
|
||||
$IMSTime = $Now;
|
||||
setcookie($IMSCookie, $IMSTime, $IMSCookieExpires, '/');
|
||||
}
|
||||
} else $IMSTime = $LastModTime;
|
||||
|
||||
if (in_array($action, (array)$CacheActions)) {
|
||||
$HTTPLastMod = gmdate('D, d M Y H:i:s \G\M\T',$IMSTime);
|
||||
$HTTPHeaders[] = "Cache-Control: no-cache";
|
||||
$HTTPHeaders[] = "Last-Modified: $HTTPLastMod";
|
||||
if (@$_SERVER['HTTP_IF_MODIFIED_SINCE']==$HTTPLastMod) {
|
||||
header("HTTP/1.0 304 Not Modified");
|
||||
header("Cache-Control: no-cache");
|
||||
header("Expires: ");
|
||||
header("Last-Modified: $HTTPLastMod");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($NoHTMLCache
|
||||
|| !@$PageCacheDir
|
||||
|| count($_POST) > 0
|
||||
|| count($_GET) > 1
|
||||
|| (count($_GET) == 1 && !@$_GET['n'])) { $NoHTMLCache |= 1; return; }
|
||||
|
||||
mkdirp($PageCacheDir);
|
||||
if (!file_exists("$PageCacheDir/.htaccess")
|
||||
&& $fp = @fopen("$PageCacheDir/.htaccess", "w"))
|
||||
{ fwrite($fp, "Order Deny,Allow\nDeny from all\n"); fclose($fp); }
|
||||
$PageCacheFile = "$PageCacheDir/$pagename,cache";
|
||||
if (file_exists($PageCacheFile) && @filemtime($PageCacheFile) < $LastModTime)
|
||||
@unlink($PageCacheFile);
|
||||
|
66
en/wiki/scripts/creole.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
/* Copyright 2007-2014 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
This file is part of PmWiki; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
||||
|
||||
This script adds Creole v0.4 markup (http://www.wikicreole.org/)
|
||||
to PmWiki. To activate this script, simply add the following into
|
||||
a local customization file:
|
||||
|
||||
include_once('scripts/creole.php');
|
||||
|
||||
*/
|
||||
|
||||
## **strong**
|
||||
Markup('**', 'inline',
|
||||
'/^\\*\\*(?>(.+?)\\*\\*)(?!\\S)|(?<!^)\\*\\*(.+?)\\*\\*/',
|
||||
'<strong>$1$2</strong>');
|
||||
|
||||
## //emphasized//
|
||||
Markup('//', 'inline',
|
||||
'/(?<!http:|https:|ftp:)\\/\\/(.*?)\\/\\//',
|
||||
'<em>$1</em>');
|
||||
|
||||
## == Headings ==
|
||||
Markup_e('^=', 'block',
|
||||
'/^(={1,6})\\s?(.*?)(\\s*=*\\s*)$/',
|
||||
"'<:block,1><h'.strlen(\$m[1]).'>'.\$m[2].'</h'.strlen(\$m[1]).'>'");
|
||||
|
||||
## Line breaks
|
||||
Markup('\\\\', 'inline', '/\\\\\\\\/', '<br />');
|
||||
|
||||
## Preformatted
|
||||
Markup_e('^{{{', '[=',
|
||||
"/^\\{\\{\\{\n(.*?\n)\\}\\}\\}[^\\S\n]*\n/sm",
|
||||
"Keep('<pre class=\"escaped\">'.\$m[1].'</pre>')");
|
||||
Markup_e('{{{', '>{{{',
|
||||
'/\\{\\{\\{(.*?)\\}\\}\\}/s',
|
||||
"Keep('<code class=\"escaped\">'.\$m[1].'</code>')");
|
||||
|
||||
## Tables
|
||||
Markup_e('|-table', '>^||',
|
||||
'/^\\|(.*)$/',
|
||||
"FormatTableRow(\$m[0], '\\|')");
|
||||
|
||||
## Images
|
||||
Markup_e('{{', 'inline',
|
||||
'/\\{\\{(?>(\\L))([^|\\]]*)(?:\\|\\s*(.*?)\\s*)?\\}\\}/',
|
||||
"Keep(\$GLOBALS['LinkFunctions'][\$m[1]](\$pagename, \$m[1], \$m[2], \$m[3],
|
||||
\$m[1].\$m[2], \$GLOBALS['ImgTagFmt']),'L')");
|
||||
|
||||
|
||||
## GUIButtons
|
||||
SDVA($GUIButtons, array(
|
||||
'em' => array(100, "//", "//", '$[Emphasized]',
|
||||
'$GUIButtonDirUrlFmt/em.gif"$[Emphasized (italic)]"',
|
||||
'$[ak_em]'),
|
||||
'strong' => array(110, "**", "**", '$[Strong]',
|
||||
'$GUIButtonDirUrlFmt/strong.gif"$[Strong (bold)]"',
|
||||
'$[ak_strong]'),
|
||||
'h2' => array(400, '\\n== ', ' ==\\n', '$[Heading]',
|
||||
'$GUIButtonDirUrlFmt/h.gif"$[Heading]"'),
|
||||
|
||||
));
|
||||
|
41
en/wiki/scripts/crypt.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php if (!defined('PmWiki')) exit();
|
||||
/* Copyright 2002-2015 Patrick R. Michaud (pmichaud@pobox.com)
|
||||
This file is part of PmWiki; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version. See pmwiki.php for full details.
|
||||
|
||||
This script defines ?action=crypt, providing help for WikiAdministrators
|
||||
to set up site-wide passwords in the installation.
|
||||
*/
|
||||
|
||||
SDV($HandleActions['crypt'],'HandleCrypt');
|
||||
SDV($ActionTitleFmt['crypt'],'| $[Password encryption]');
|
||||
|
||||
function HandleCrypt($pagename, $auth='read') {
|
||||
global $ScriptUrl,$HTMLStartFmt,$HTMLEndFmt;
|
||||
PrintFmt($pagename,$HTMLStartFmt);
|
||||
$passwd = stripmagic(@$_POST["passwd"]);
|
||||
echo FmtPageName(
|
||||
"<form action='{\$ScriptUrl}' method='POST'><p>
|
||||
Enter password to encrypt:
|
||||
<input type='text' name='passwd' value='"
|
||||
. PHSC($passwd, ENT_QUOTES) ."' />
|
||||
<input type='submit' />
|
||||
<input type='hidden' name='n' value='{\$FullName}' />
|
||||
<input type='hidden' name='action' value='crypt' /></p></form>",
|
||||
$pagename);
|
||||
if ($passwd) {
|
||||
$crypt = pmcrypt($passwd);
|
||||
echo "<p class='vspace'>Encrypted password = $crypt</p>";
|
||||
echo "<p class='vspace'>To set a site-wide password, insert the line below
|
||||
in your <i>config.php</i> file, <br />replacing <tt>'type'</tt> with
|
||||
one of <tt>'admin'</tt>, <tt>'read'</tt>, <tt>'edit'</tt>,
|
||||
or <tt>'attr'</tt>. <br />See <a
|
||||
href='$ScriptUrl?n=PmWiki.PasswordsAdmin'>PasswordsAdmin</a> for more
|
||||
details.</p>
|
||||
<pre class='vspace'> \$DefaultPasswords['type']='$crypt';</pre>";
|
||||
}
|
||||
PrintFmt($pagename,$HTMLEndFmt);
|
||||
}
|
||||
|