Professional Documents
Culture Documents
Overview Presentation
$ntrod!%tion Core &a%' lternatives ( 1) Template override ( 2) Clone Mod!le ( *) +se o, Pl!"ins ( -) Component with .own %ontroller/ ( 0) 1verridin" Core %lasses ( 2) 3an"!a"e override +ndoin" %ore ha%'s 4!estions5
Core Hack
Core Hack
Joomla ( ( (
6 1pen So!r%e li%ense .78+ 7P3/ 7P3 prote%ts ,reedom 9 ri"hts o, !sers So!r%e %ode 6 p!bli% :o! can and are allowed to %han"e all Joomla %ode
Core Hack
;isadvanta"e o, %han"in" .%ore %ode/< Stability
(
Mi"ht "ive problems with *rd party e=tensions :o!r %ode %han"es %an be overwritten when yo! !p"rade
Maintainability
(
@%omponents@%omA%onta%t@%ontrollers@%onta%t)php private ,!n%tion AsendBmailCDdataE D%onta%tFE G!st !nder @@ Prepare email body DmailH>setIodyCDbodyFJ %han"e into< DmailH>setIodyC"IP adres: " !"#E$%E$&'$E(O)E"*++$', "-n-n" DbodyFJ
7
;ate< SatE 17 !" 2012 10<*0<00 L0200 From< >isitor name <in,oMe=ample)%om> KeplyHTo< N8ame visitorO <Nemail address visitorO> To< Nemail address S!per dmin o, PebsiteO IP adres: 012 3 3 0 This is an enQ!iry email via http<@@www)e=ample)%om@ ,rom< N8ame visitorO <Nemail address visitorO> NMessa"e o, visitorO
#
0 )emplate override
0 )emplate override
Template
(
Components
(
9 Mod!les
Template
(
10
Chan"e
11
12
<@!l>
1*
1-
10
12
3atest 8ews
Sat!rday 01 Gan!ari 2011E 01<00<01 H Ie"inners Sat!rday 01 Gan!ari 2011E 01<00<01 H 7ettin" &elp Sat!rday 01 Gan!ari 2011E 01<00<01 H 7ettin" Started Sat!rday 01 Gan!ari 2011E 01<00<01 H JoomlaT Sat!rday 01 Gan!ari 2011E 01<00<01 H 1ptions
17
1 Clone a (odule
1#
1 Clone a (odule
1R
1 Clone a (odule
Dhtml 6 J&tml<<AC?i%ons)b!ttons?E Db!ttonsFJ 5> <5php i, CTemptyCDhtmlFF< 5> <div %lass6S%panelS><5php e%ho DhtmlJ5><@div> <5php endi,J5> \ 8ot possible to !se template override)))
20
1 Clone a (odule
2a) Copy Mod!le
@administrator@mod!les@modAQ!i%'i%on@ to @administrator@mod!les@modAQ!i%'i%on1@
21
1 Clone a (odule
2%) Bdit modAQ!i%'i%on re,eren%es modAQ!i%'i%on1)php
Db!ttons 6 mod4!i%'$%on1&elper<<"etI!ttonsCDparamsFJ reQ!ire JMod!le&elper<<"et3ayo!tPathC?modAQ!i%'i%on 1?E DparamsH>"etC?layo!t?E ?de,a!lt?FFJ
modAQ!i%'i%on1)=ml
<name>modAQ!i%'i%on1<@name> <,ilename mod!le6SmodAQ!i%'i%on1S>modAQ!i%'i%on1)php<@,ilename>
22
1 Clone a (odule
2d) dd to Joomla< B=tensions > B=tension Mana"er > ;is%over
2*
1 Clone a (odule
2e) dd Mod!le modAQ!i%'i%on2<
( ( ( (
B=tensions > Mod!le Mana"er > Filter< .administrator/ N8ewO > modAQ!i%'i%on2 Title< My own 4!i%' $%ons Position< i%on
2-
1 Clone a (odule
1ops< Fatal error< Cannot rede%lare %lass mod4!i%'$%on&elper in @administrator@mod!les@modAQ!i%'i%on1@helper)php on line 1#
20
1 Clone a (odule
2") dd yo!r own .array/
(
@administrator@mod!les@modAQ!i%'i%on1@helper)php arrayC ?lin'? 6> Jro!te<<AC?inde=)php5option6com"search?FE ?ima"e? 6> ?header@icon=>?=search png?E ?te=t? 6> Jte=t<<AC?#earch?FE ?a%%ess? 6> arrayC?%ore)mana"e?E ?com"search?F FE
22
1 Clone a (odule
2h) Kes!lt<
27
@ Ase o7 Plugins
2#
@ Ase o7 Plugins
Joomla
( ( (
Pater
( ( (
is &21
Men! item .&<s!b>2<@s!b>1/ \ Pater is &11 rti%le title .&<s!b>2<@s!b>1/ \ Pater is &11 Te=t in arti%le .&<s!b>2<@s!b>1/ \ Pater is & 1
1
2R
@ Ase o7 Plugins
KeKepla%er
( ( (
*0
@ Ase o7 Plugins
Start
( (
s!bs%ript ta"
Bnd
( ( *1
s!bs%ript ta"
@ Ase o7 Plugins
Pater
is &21
( ( ( (
Men! item .&]s!b]2]@s!b]1/ \ Pater is &11 Men! itemE Irowser Pa"e TitleT\ Pater is &11 rti%le title .&]s!b]2]@s!b]1/ \ Pater is &11 Te=t in arti%le .&<s!b>2<@s!b>1/ \ Pater is &11
*2
**
%onta%t %omponent<
;isplays %onta%t details ;isplays %onta%t ,orm Ketrieves inp!t %onta%t ,orm C%he%' inp!tE send to spe%i,ied email addressF
&oweverE
( ( (
\
*-
( (
B=ample<
%han"e .tas'/<
<inp!t type6ShiddenS name6Stas'S val!e6SmE"own"controller)s!bmitS @>
*2
be%omes<
%lass Conta%tController(E"own"controller e=tends JControllerForm
*7
-%2) s' ,or model CConta%tF with e=pli%it pre,i= to prevent error<
Fatal error< Call to a member ,!n%tion "et$temCF on a nonHobGe%t in @%omponents@%omA%onta%t@%ontrollers@myAownA%ontroller)php on line *#
be%omes<
Dmodel 6 DthisH>"etModelC?Conta%t?E?Contact(odel?FJ *#
-%*) dd yo!r own %ode in method private ,!n%tion AsendBmailCDdataE D%onta%tFE G!st below @@ Prepare email body
DmailH>setIodyCDbodyFJ
be%omes<
DmailH>setIodyC"IP address: " "#E$%E$&'$E(O)E"*++$', "-n-n" DbodyFJ
*R
NMessa"e o, visitorO
-1
Core
( (
%lasses %an
Phat
i, yo! want to add somethin" to a %ore %lass so that all inheritan%es will have that %ode5
-2
Pa"e
-*
short<
System pl!"ins are loaded be,ore 1th event ConIe,ore$nitialiseF Pl!"ins %an load Classes @ plain %ode H> load %lass Cwith in%l!deAon%eF Classes that have already been loaded be,ore the System Pl!"ins are imported)))
B=%eption<
(
--
G 5anguage Overrides
-0
G 5anguage Overrides
Sin%e Joomla 2)0 ( Ie,ore 2)0< .Core ha%'/ lan"!a"e ,iles B=tensions > 3an"!a"e Mana"er > 1verrides
-2
G 5anguage Overrides
.8ew/E
-7
G 5anguage Overrides
.Kead
-#
G 5anguage Overrides
.Save
9 Close/<
-R
G 5anguage Overrides
Kes!lt<
00
01
Core &a%'s are 81T do%!mented nalyse %ode to ,ind Core &a%'s<
Joomla 2)0)2 witho!t *rd party e=tensions< 0E0#2 itemsE totallin" 1R)0 MI Test site with some *rd party e=tensions< 7E21# itemsE totallin" -2)2 MI
\ 7ood l!%'T
02
Preparations
( ( (
1@2<
Ia%'H!p o, website C+se 'eeba ba%'!pTF 3o%al 3 MP sta%' C3 MP@^ MPP@M MP@P MPF Kestore ba%'H!p to two websites !sin" 2 databases<
@myHsiteHwithHha%'@ @myHsiteHwitho!tHha%'@
0*
2@2<
;ownload same version o, Joomla 9 !nYip ;ownload same versions o, *rd party e=tensions 1verwrite all ,iles with Joomla ,iles Ce=%ept @installation@ ,olderF to
@myHsiteHwitho!tHha%'@
Kes!lt<
( 0-
@myHsiteHwithHha%'@ @myHsiteHwitho!tHha%'@
00
02
07
Conclusion
0#
Conclusion
1) Template override C%opy e=tensions &TM3 o!tp!t to yo!r templates @html@ dire%tory and %han"e thatF 2) Clone Mod!le C%opy %omplete mod!le 9 %han"e thatF *) +se Pl!"ins -) .1wn %ontroller/ Cadd own %ontroller 9 !se template override to tri""er yo!r %ontrollerF 0) 1verridin" Core Classes 2) 3an"!a"e 1verrides
( ( (
( (
+ndoin" Core &a%'s ( +se .di,,/ tools to %ompare ori"inal 9 modi,ied %ode
0R
Conclusion
Core
(
&a%' \ don?tT
Most
(
o, the 2 alternatives<
20
Huestions9
21
Huestions9
Sheets
Ased Photos
=e H Peter &!ysE http<@@www)s=%)h!@photo@#0##71 Photo Frame R ( Iilly le=anderE http<@@www)s=%)h!@photo@1*271R# &iSpeed %opier 1 H Mar%in Iar_ows'iE http<@@www)s=%)h!@photo@0*70*7 !sb H >an"elis ThomaidisE http<@@www)s=%)h!@photo@R1*0R0 7ame pad H Mi%hal Xa%harYews'iE http<@@www)s=%)h!@photo@R070-0 bl!eprint H `erem :!%elE http<@@www)s=%)h!@photo@2#22*7 Ien"ali `eyborad H Mohammad Jobaed dnan http<@@www)s=%)h!@photo@272#-Ked Plaster H Pa!l Iar'erE http<@@www)s=%)h!@photo@111-17si"ns si"ns H Jason ntonyE http<@@www)s=%)h!@photo@7010*Fa%e H 4!estions H Iob SmithE http<@@www)s=%)h!@photo@-1#210
2*