-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathconfig.inc.php
117 lines (94 loc) · 3.49 KB
/
config.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
/**
* RexSEO - URLRewriter Addon
*
* @link https://github.com/gn2netwerk/rexseo
*
* @author dh[at]gn2-netwerk[dot]de Dave Holloway
* @author code[at]rexdev[dot]de jdlx
*
* Based on url_rewrite Addon by
* @author markus.staab[at]redaxo[dot]de Markus Staab
*
* @package redaxo 4.3.x/4.4.x
* @version 1.5.0
*/
// ADDON PARAMS
////////////////////////////////////////////////////////////////////////////////
$myself = 'rexseo42';
$myroot = $REX['INCLUDE_PATH'].'/addons/'.$myself;
$REX['ADDON'][$myself]['VERSION'] = array
(
'VERSION' => 1,
'MINORVERSION' => 5,
'SUBVERSION' => 0,
);
$REX['ADDON']['rxid'][$myself] = '0';
$REX['ADDON']['name'][$myself] = 'rexseo42';
$REX['ADDON']['version'][$myself] = '1.0.1';
$REX['ADDON']['author'][$myself] = 'Markus Staab, Wolfgang Huttegger, Dave Holloway, Jan Kristinus, jdlx, RexDude';
$REX['ADDON']['supportpage'][$myself] = 'forum.redaxo.de';
$REX['ADDON']['perm'][$myself] = $myself.'[]';
$REX['PERM'][] = $myself.'[]';
$REX['ADDON'][$myself]['SUBPAGES'] = array (
array ('', 'Einstellungen'),
array ('setup', 'Setup'),
array ('help', 'Hilfe')
);
$REX['ADDON'][$myself]['debug_log'] = 0;
$REX['ADDON'][$myself]['settings']['default_redirect_expire'] = 60;
$REX['PROTOCOL'] = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://' : 'http://';
// INCLUDES
////////////////////////////////////////////////////////////////////////////////
require_once($myroot . '/functions/function.rexseo_helpers.inc.php');
require_once($myroot . '/classes/class.rexseo42.inc.php');
// USER SETTINGS
////////////////////////////////////////////////////////////////////////////////
require_once($myroot . '/settings.inc.php');
// RUN ON ADDONS INLCUDED
////////////////////////////////////////////////////////////////////////////////
if(!$REX['SETUP']){
rex_register_extension('ADDONS_INCLUDED','rexseo_init');
}
if(!function_exists('rexseo_init')){
function rexseo_init($params)
{
global $REX;
if ($REX['MOD_REWRITE'] !== false)
{
// REWRITE
$levenshtein = (bool) $REX['ADDON']['rexseo42']['settings']['levenshtein'];
$rewrite_params = (bool) $REX['ADDON']['rexseo42']['settings']['rewrite_params'];
require_once $REX['INCLUDE_PATH'].'/addons/rexseo42/classes/class.rexseo_rewrite.inc.php';
$rewriter = new RexseoRewrite($levenshtein,$rewrite_params);
$rewriter->resolve();
rex_register_extension('URL_REWRITE', array ($rewriter, 'rewrite'));
}
// CONTROLLER
include $REX['INCLUDE_PATH'].'/addons/rexseo42/controller.inc.php';
// REXSEO POST INIT
rex_register_extension_point('REXSEO_POST_INIT');
}
}
// SEOPAGE
////////////////////////////////////////////////////////////////////////////////
if ($REX['REDAXO']) {
// add new menu item
rex_register_extension('PAGE_CONTENT_MENU', function ($params) {
$class = "";
if ($params['mode'] == 'seo') {
$class = 'class="rex-active"';
}
$seoLink = '<a '.$class.' href="index.php?page=content&article_id=' . $params['article_id'] . '&mode=seo&clang=' . $params['clang'] . '&ctype=' . rex_request('ctype') . '">SEO</a>';
array_splice($params['subject'], '-2', '-2', $seoLink);
return $params['subject'];
});
// include seo page
rex_register_extension('PAGE_CONTENT_OUTPUT', function ($params) {
global $REX, $I18N;
if ($params['mode'] == 'seo') {
include($REX['INCLUDE_PATH'] . '/addons/rexseo42/pages/seopage.inc.php');
}
});
}
?>