Skip to content

Commit 7df54ff

Browse files
committed
add files
0 parents  commit 7df54ff

14 files changed

+923
-0
lines changed

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.gitignore

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
#################
2+
## Eclipse
3+
#################
4+
5+
*.pydevproject
6+
.project
7+
.metadata
8+
bin/
9+
tmp/
10+
*.tmp
11+
*.bak
12+
*.swp
13+
*~.nib
14+
local.properties
15+
.classpath
16+
.settings/
17+
.loadpath
18+
19+
# External tool builders
20+
.externalToolBuilders/
21+
22+
# Locally stored "Eclipse launch configurations"
23+
*.launch
24+
25+
# CDT-specific
26+
.cproject
27+
28+
# PDT-specific
29+
.buildpath
30+
31+
32+
#################
33+
## Visual Studio
34+
#################
35+
36+
## Ignore Visual Studio temporary files, build results, and
37+
## files generated by popular Visual Studio add-ons.
38+
39+
# User-specific files
40+
*.suo
41+
*.user
42+
*.sln.docstates
43+
44+
# Build results
45+
[Dd]ebug/
46+
[Rr]elease/
47+
*_i.c
48+
*_p.c
49+
*.ilk
50+
*.meta
51+
*.obj
52+
*.pch
53+
*.pdb
54+
*.pgc
55+
*.pgd
56+
*.rsp
57+
*.sbr
58+
*.tlb
59+
*.tli
60+
*.tlh
61+
*.tmp
62+
*.vspscc
63+
.builds
64+
*.dotCover
65+
66+
## TODO: If you have NuGet Package Restore enabled, uncomment this
67+
#packages/
68+
69+
# Visual C++ cache files
70+
ipch/
71+
*.aps
72+
*.ncb
73+
*.opensdf
74+
*.sdf
75+
76+
# Visual Studio profiler
77+
*.psess
78+
*.vsp
79+
80+
# ReSharper is a .NET coding add-in
81+
_ReSharper*
82+
83+
# Installshield output folder
84+
[Ee]xpress
85+
86+
# DocProject is a documentation generator add-in
87+
DocProject/buildhelp/
88+
DocProject/Help/*.HxT
89+
DocProject/Help/*.HxC
90+
DocProject/Help/*.hhc
91+
DocProject/Help/*.hhk
92+
DocProject/Help/*.hhp
93+
DocProject/Help/Html2
94+
DocProject/Help/html
95+
96+
# Click-Once directory
97+
publish
98+
99+
# Others
100+
[Bb]in
101+
[Oo]bj
102+
sql
103+
TestResults
104+
*.Cache
105+
ClientBin
106+
stylecop.*
107+
~$*
108+
*.dbmdl
109+
Generated_Code #added for RIA/Silverlight projects
110+
111+
# Backup & report files from converting an old project file to a newer
112+
# Visual Studio version. Backup files are not needed, because we have git ;-)
113+
_UpgradeReport_Files/
114+
Backup*/
115+
UpgradeLog*.XML
116+
117+
118+
119+
############
120+
## Windows
121+
############
122+
123+
# Windows image file caches
124+
Thumbs.db
125+
126+
# Folder config file
127+
Desktop.ini
128+
129+
130+
#############
131+
## Python
132+
#############
133+
134+
*.py[co]
135+
136+
# Packages
137+
*.egg
138+
*.egg-info
139+
dist
140+
build
141+
eggs
142+
parts
143+
bin
144+
var
145+
sdist
146+
develop-eggs
147+
.installed.cfg
148+
149+
# Installer logs
150+
pip-log.txt
151+
152+
# Unit test / coverage reports
153+
.coverage
154+
.tox
155+
156+
#Translations
157+
*.mo
158+
159+
#Mr Developer
160+
.mr.developer.cfg
161+
162+
# Mac crap
163+
.DS_Store

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Плагин PHx 2.2.0 для MODx Evo
2+
-----------------------------------
3+
4+
* Исправлено съедание плейсхолдеров, в том числе и в @CODE (требуется Evo 1.0.9 и выше).
5+
* Исправлено выполнение кода в then и в else для чанков и сниппетов.
6+
* Исправлен кэш сниппетов, который создавал лишние запросы к базе.
7+
* Строковые функции заменены на их аналоги, либо на мультибайтовые функции, и теперь нормально работают с русским языком.
8+
* Некоторые исправления для php 5.3

assets/plugins/phx/docs/install.txt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Quick Installation and Setup quide:
2+
-------------------------------------
3+
4+
New Install:
5+
6+
1) Download and extract the archive.
7+
2) Create a directory called "phx" in your [MODx Directory]/assets/plugins directory
8+
3) FTP or copy the files into [MODx Directory]/assets/plugins/phx
9+
4) Create a new plugin in the manager called "PHx" and copy/paste the contents of phx.plugin.txt into the code field.
10+
5) Check "OnParseDocument" at the System Events tab
11+
12+
Update:
13+
14+
1) Download and extract the archive.
15+
2) Backup and delete the contents of [MODx Directory]/assets/snippets/phx
16+
3) Create a directory called "phx" in your [MODx Directory]/assets/plugins directory
17+
4) FTP or copy the files into [MODx Directory]/assets/plugins/phx
18+
5) Update the "PHx" plugin in the manager and copy/paste the contents of phx.plugin.txt into the code field.
19+
6) Check "OnParseDocument" at the System Events tab
20+
21+
Optional steps (as of 2.0):
22+
23+
On the Configuration tab -> Plugin configuration enter:
24+
25+
&phxdebug=Debug;int;0 &phxmaxpass=Max. Passes;int;50
26+
27+
28+
29+
30+
31+
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
/* Retrieved from http://wiki.modxcms.com/index.php/PHx/CustomModifiers
4+
* description: returns the 7bit representation of a string
5+
* usage: [+string:7bit+]
6+
*/
7+
8+
$text = mb_convert_encoding($output,'HTML-ENTITIES',mb_detect_encoding($output));
9+
$text = preg_replace(array('/&szlig;/','/&(..)lig;/','/&([aouAOU])uml;/','/&(.)[^;]*;/'),array('ss',"$1","$1".'e',"$1"),$text);
10+
return $text;
11+
12+
?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
// Retrieved from http://wiki.modxcms.com/index.php/PHx/CustomModifiers
4+
// description: parse bb code (also escapes all html and MODx tags characters)
5+
// usage: [+variable:bbcode+]
6+
7+
$string = preg_replace("/&amp;(#[0-9]+|[a-z]+);/i", "&$1;", htmlspecialchars($output));
8+
$string = preg_replace('~\[b\](.+?)\[/b\]~is', '<b>\1</b>', $string);
9+
$string = preg_replace('~\[i\](.+?)\[/i\]~is', '<i>\1</i>', $string);
10+
$string = preg_replace('~\[u\](.+?)\[/u\]~is', '<u>\1</u>', $string);
11+
$string = preg_replace('~\[link\]www.(.+?)\[/link\]~is', '<a href="http://www.\1">www.\1</a>', $string);
12+
$string = preg_replace('~\[link\](.+?)\[/link\]~is', '<a href="\1">\1</a>', $string);
13+
$string = preg_replace('~\[link=(.+?)\](.+?)\[/link\]~is', '<a href="\1">\2</a>', $string);
14+
$string = preg_replace('~\[url\]www.(.+?)\[/url\]~is', '<a href="http://www.\1">www.\1</a>', $string);
15+
$string = preg_replace('~\[url\](.+?)\[/url\]~is', '<a href="\1">\1</a>', $string);
16+
$string = preg_replace('~\[url=(.+?)\](.+?)\[/url\]~is', '<a href="\1">\2</a>', $string);
17+
$string = preg_replace('~\[img\](.+?)\[/img\]~is', '<img src="\1" alt="[image]" style="margin: 5px 0px 5px 0px" />', $string);
18+
$string = preg_replace('~\[img-l\](.+?)\[/img\]~is', '<img src="\1" alt="[image]" style="border: thin solid #DFE5F2; FLOAT: left; MARGIN-RIGHT: 20px" />', $string);
19+
$string = preg_replace('~\[img-r\](.+?)\[/img\]~is', '<img src="\1" alt="[image]" style="border: thin solid #DFE5F2; FLOAT: right; MARGIN-LEFT: 20px;" />', $string);
20+
$string = str_replace(array("[","]","`"),array("&#91;","&#93;","&#96;"),$string);
21+
return $string;
22+
23+
24+
?>
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
// Returns the GET parameter which has been posted as a query string
4+
// It takes the paramater name as an argument
5+
// e.g. a page with URL of http://www.whatever.com/modx?paramname=rckt
6+
// [*phx:get=`paramname`*] returns "rckt"
7+
8+
return $_GET[$options];
9+
10+
?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/*
3+
* description: The opposite of the native PHX "isempty" function. Returns the option value ONLY if the input value is empty (excluding whitespace)
4+
* usage: [+string:ifnotempty=`String to return if not empty`+]
5+
*/
6+
7+
if (trim($output) != '') {
8+
return $options;
9+
}
10+
?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
/*
4+
Retrieved from http://wiki.modxcms.com/index.php/PHx/CustomModifiers
5+
* description: Removes the http:// from a URL, to create a display-friendly web address
6+
* usage: [+string:nohttp+]
7+
8+
*/
9+
10+
$url = str_replace('http://', '', $output);
11+
return $url;
12+
?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
/* Retrived from http://wiki.modxcms.com/index.php/PHx/CustomModifiers
4+
* description: get specified document field from parent document (id)
5+
* usage: [+variable:parent=`field`+]
6+
* defaults to pagetitle
7+
*/
8+
9+
$field = (strlen($options)>0) ? $options : 'pagetitle';
10+
$parent = $modx->getParent($output,1,$field);
11+
return $parent[$field];
12+
13+
?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
// Returns the POST parameter which has been posted
4+
// It takes the paramater name as an argument
5+
// [*phx:post=`paramname`*]
6+
7+
return $_POST[$options];
8+
9+
?>

0 commit comments

Comments
 (0)