Upload
satriaf
View
218
Download
0
Embed Size (px)
Citation preview
8/2/2019 Create Joomla Extensions - Manages Back End
1/3
Sviluppare in Joomla!
Menu principale
Home
Chi Siamo
L'offerta
Preservare...
PortFolio
Il vostro sito con Joomla!
E-commerce
Migrazione a Joomla! 1.5
Moduli Opzionali
F.A.Q.
Galleria Immagini
ContattiDomande Frequenti
L'Open Source
Il modello economico
I vantaggi
TYPOLIGHT !!
Ristoranti e Alberghi suCenoFuori
Joomla Development
Home sviluppo Joomla!Esempi e trucchi
>> ITALIAN VERSION
Joomla! Generatore diComponenti
Creare componenti perJoomla! 1.5 - Il Componentedi Esempio
Creare componenti perJoomla! 1.5 - Gestire il frontend
Creare componenti perJoomla! 1.5 - Gestire il backend - parte 1
Ripristare un hack su Joomla!
>> ENGLISH VERSION
Joomla! component builderCreate components forJoomla! - The examplecomponent
Create components forJoomla! - Managing thefront end
Create Joomla! extensions -Manage the Back End- Part1
Marco's noFollow plugin forJoomla! 1.5
SQL Injection and LFIprotection
e Joomla! extensions - Manage the Back End- Part 1 http://www.mmleoni.net/joomla-component-builder/create-jooml
8/28/2010
8/2/2019 Create Joomla Extensions - Manages Back End
2/3
vote
now
Create Joomla! extensions - Manage the Back End- Part 1
Creating extensions for Joomla! 1.5 - Managing the Back - Part 1 view recods
Writing extensions with Joomla!Component Builderis quite easy since it is the program that takes careto write the skeleton for models, views and templates for editing. You have only to define the businesslogic for data managing, but this is your own task.
Operation of the components forJoomla!1.5
Each component of Joomla! has, whether we speak of front end or back end, an entry point. This is aPHP file, named as the component, which receives the requests that must be managed by the component.This file will then define which view and which controllerto load.
Side Back - End
At back end side, the work for the entry point is quite more difficult than front-end, because, as access is not made viaa menu item, you must define the controller / view .
The file generated by Joomla Component Builder includes a die () to remind us where to make changes.
... [ccat.php]die ( 'Insert the default view in'. __FILE__. 'After line n. '. __LINE__);/ / Define default controller & view ...if (!JRequest: getword ( 'controller')) (JRequest:: setvar ( 'controller', '***'); / / insert here!JRequest:: setvar ( 'view', JRequest: getword ( 'controller'));) else (JRequest:: setvar ( 'view', JRequest: getword ( 'controller'));)
Instead of three asterisks we enter the name for the default controller, but what is the default controller?Obviously the answer varies from project to project, usually is the basic information that we changed more frequently,in our case: brands(ccatbrands). Remember to remove or comment out the line with die ().
Note that the basic controller always refers to the record set, never the single record (that brings up the
list).
File ccat.php, as shown by the code, then loads the specified controller, which contains the code needed to performthe following tasks ($ task):
edit (): call the controllorer for editing of individual record
save () saves the information of each record [to eliminate in the next release]
remove (): delete individual records [to be deleted in the next release]
publish (): it publish individual records
unpublish (): Hides the individual records
orderup (): Move through records (requires ccatbrand model, to act on the individual records)
orderdown (): moves the record down (requires model ccatbrand, to act on the individual records)
saveOrder (): save the display order of records (requires ccatbrand model, to act on the individual records)
With the its inclusion, the controller calls the constructorand the method display () of base the class JController;and the Joomla! framework then loads the following files:
/ administrator / components / com_ccat / views / ccatbrands / view.html.php
/ administrator / components / com_ccat / views / ccatbrands / tmpl / default.php
/ administrator / components / com_ccat / models / ccatbrands.php
/ administrator / components / com_ccat / tables / ccatbrand.php
A step back:
1. when statement $controller->execute(JRequest::getVar ( 'task')) is executed, in the file /components/com_ccat/ccat.php,
2. is invoked the method display() in file/administrator/components/com_ccat/controllers/ ccatbrands.php
3. The controller call the method display() of the class CcatViewCcatbrands in /components/com_ccat/views/ccatbrands/view.html.php
Within the last file we have, among others, the following lines of code:
function display ($ tpl = null) (...
Share
e Joomla! extensions - Manage the Back End- Part 1 http://www.mmleoni.net/joomla-component-builder/create-jooml
8/28/2010
8/2/2019 Create Joomla Extensions - Manages Back End
3/3
L'estate si avvicina hai gi trovato l'albergo per le vacanze? cerca un albergo al mare o un hotel in montagna ove trascorrere le tue vacanze.
Copyright 2010 Marco Maria Leoni Web Consulting P.IVA 13089190154. - All Rights Reserved.
e Joomla! extensions - Manage the Back End- Part 1 http://www.mmleoni.net/joomla-component-builder/create-jooml
8/28/2010