Podobne
- Strona startowa
- Borland Delphi 7 Developer's Guide
- Builder 5 Developers Guide
- Robert Ludlum Mozaika Persifala
- Follett Ken Na skrzydlach orlow
- Harry Potter II Komnata Tajemni
- Cyd P.Corneille
- Allen C. Guelzo Abraham Lincoln as a Man of Ideas (2009)
- Ekstaza Gabriela (2)
- Science Fiction wrzesień 2001 (8)
- Kiernan Denise Dziewczyny atomowe
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- oknaszczecin.pev.pl
Cytat
Do celu tam się wysiada. Lec Stanisław Jerzy (pierw. de Tusch-Letz, 1909-1966)
A bogowie grają w kości i nie pytają wcale czy chcesz przyłączyć się do gry (. . . ) Bogowie kpią sobie z twojego poukładanego życia (. . . ) nie przejmują się zbytnio ani naszymi planami na przyszłość ani oczekiwaniami. Gdzieś we wszechświecie rzucają kości i przypadkiem wypada twoja kolej. I odtąd zwyciężyć lub przegrać - to tylko kwestia szczęścia. Borys Pasternak
Idąc po kurzych jajach nie podskakuj. Przysłowie szkockie
I Herkules nie poradzi przeciwko wielu.
Dialog półinteligentów równa się monologowi ćwierćinteligenta. Stanisław Jerzy Lec (pierw. de Tusch - Letz, 1909-1966)
[ Pobierz całość w formacie PDF ]
.The most advanced open source project I am aware of in this area is XHTML Purifier.This is an extensive set of PHP classes that is capable of taking XHTML and forcing itto be valid, including removing elements that have the potential to contain securitythreats.Configuration of XHTML Purifier is possible for special purposes.All theindications are that the code is highly effective for both its purposes.The obviousdrawback is that the XHTML Purifier framework is a very substantial amount ofcode, and can take significant time to execute.It should not be used indiscriminatelyon fields that may contain XHTML, but needs to be used selectively so that it isconfined to dealing with new input that may contain XHTML, and is then validatedonce only.Provided that principle is adopted, XHTML Purifier works extremelywell.The project can be found at http://htmlpurifier.org.The Administrator InterfaceAs mentioned above, there is more scope for standardization in the interfaceprovided solely for the administrator than for a website in general.Another aspectof this is the possibility of standard code for a simple interface that allows the listing, and updating of a database table.The mechanisms needed for the database handlingwere discussed in Chapter 5, but to complete the picture some XHTML generationis needed.This kind of thing is certainly needed if productivity in the creation of CMSextensions is to improve.Compromise is inevitable with a standardized approach,and although quite a lot of flexibility can be built in, there will certainly be a need for some custom development in many cases.But even so, an automated interface maywell be enough to get a project started, and to form a basis for further development.Over time, I would hope that standard services of this kind will evolve so as to bemore acceptable, and also more widely applicable.The need for speedy productionof Web facilities is not likely to go away any time soon, and neither is developereffort likely to be available to match the demands for software.Practical details ofcurrent work in this area are given below.Framework SolutionAliro adopts solutions consistent with the approaches advocated above.Often, morethan one alternative is available to achieve similar results.Selection can be madeaccording to circumstances and by keeping the particular aim in view.Illustrationsof the general approach are given before going into more specific mechanisms.[ 230 ]Chapter 11Using "heredoc" to Define XHTMLTo demonstrate that PHP can be used to define the XHTML for a page in a clear andstraightforward way, we can look at an example from the administrator side of Aliro.The one I've chosen is a simple one, the code that displays a list of the attempts toaccess non-existent pages, the 404 errors.Although it is not possible to modify theentries in the database for these errors, it is possible to select an error from the list so as to see more detailed information.So the 404 administrator interface is a simpleversion of the common case of listing items from a database table, and allowingdetailed access to individual items.Before looking at the specific code, it is better to look in some detail at the base class from which the 404 code is subclassed.This is the basicAdminHTML class, and it startsoff as shown here:class basicAdminHTML extends aliroFriendlyBase{protected $controller = null;protected $pageNav = '';protected $option = '';protected $core = '';protected $optionline = '';protected $optionurl = '';protected $act = '';protected $formstamp;protected $translations = array();function __construct (&$controller){$this->controller = $controller;$this->act = $controller->act;$this->pageNav = $controller->pageNav;$this->option = $this->getOption();if ($this->core = strtolower($this->getParam($_REQUEST,'core'))){$this->optionline = "";$this->optionurl = 'index.php?core='.$this->core;}else{$this->optionline = "";$this->optionurl = 'index.php?option='.$this->option;}$this->optionurl.= '&act='.$this->act;$this->formstamp = $this->makeFormStamp();}[ 231 ]Presentation ServicesThe class is itself subclassed from aliroFriendlyBase, which gives access to a lot ofuseful properties and methods, especially the methods belonging to aliroRequest.The first property is the controller that is invoking the view code, and it will havegathered a number of useful properties of its own
[ Pobierz całość w formacie PDF ]