Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
7Activity
P. 1
ocPortal 4.2 Code Book

ocPortal 4.2 Code Book

Ratings: (0)|Views: 691|Likes:
Published by ocproducts
Programming details for the ocPortal CMS, designed for PHP/XHTML/CSS/ECMA developers who already have some experience.
Programming details for the ocPortal CMS, designed for PHP/XHTML/CSS/ECMA developers who already have some experience.

More info:

Published by: ocproducts on Mar 16, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/10/2014

pdf

text

original

 
ocPortal Code Book:
for ocPortal v
ersion 4.2
The Code Book contains documentation to teach experienced developers how to program for ocPortal.This guide is not a substitute for learning PHP, HTML, CSS, or other languages. Some introductorymaterial for learning web development is available in our main set of tutorials(http://ocportal.com/docs/). There is anexcellent PHP bookavailable for free online. In addition to this Code Book, we also have some tutorials with worked examples of making addons:
 
 
 
http://ocportal.com/docs/pg/tut_hardcore_3and an introduction to the ocPortal framework:
 
http://ocportal.com/docs/pg/tut_frameworkTo learn ocPortal's API, see the phpdoc comments in the source files. The source files are logicallynamed, so it should be relatively easy to get a handle on it all. Alternatively, view the autogenerateddocumentation onhttp://ocportal.com/docs/api/.
Table of Contents
ocPortal terms .......................................................................................................................6Bootstrapping ........................................................................................................................9Addons .................................................................................................................................9Modules ..............................................................................................................................10What is a module? ............................................................................................................10How do you create a new full-module? ................................................................................11The 'info' function .............................................................................................................11The 'run' function .............................................................................................................12The 'get_entry_points' function ..........................................................................................13The 'get_page_links' function..............................................................................................13The 'extract_page_link_permissions' function.......................................................................13The 'install' and 'uninstall' functions.....................................................................................14The 'install' function..........................................................................................................14Upgrading via the 'install' function ......................................................................................16
Copyright ocProducts Ltd.
Page 1 of 74
 
The 'uninstall' function ......................................................................................................16Screen conventions ..........................................................................................................17Templates and Tempcode ..................................................................................................17Making a simple two-screen full-module ..............................................................................19Setting up our basic screens ..............................................................................................19Creating our templates .....................................................................................................20Hooks..................................................................................................................................21Another example: member profiles......................................................................................22Another example: symbols.................................................................................................23Installation code...................................................................................................................23Programming/progmattic-interface standards ..........................................................................23Javadoc-like commenting ..................................................................................................31Error handling ..................................................................................................................32Escaping .........................................................................................................................33Security ..........................................................................................................................34Type strictness..................................................................................................................37Example strict-typing mistakes...........................................................................................38Do-next-manager interfaces ..............................................................................................40The translation table .........................................................................................................41GUIDs..............................................................................................................................41The persistent cache .........................................................................................................41Feature architecting standards, and implementation notes ........................................................43Design/copy standards .........................................................................................................44Web development standards ..................................................................................................46Templates and themes ......................................................................................................48Tempcode syntax .............................................................................................................48WCAG notes ....................................................................................................................49PNG images .....................................................................................................................50
Copyright ocProducts Ltd.
Page 2 of 74
 
Javascript ............................................................................................................................51Javascript libraries ............................................................................................................51Javascript event handlers ..................................................................................................52Inline Javascript ...............................................................................................................52Example: mixing event handlers, inline Javascript, and a library ............................................52Simpler example ..............................................................................................................53Diff tools..............................................................................................................................53Debugging, and stack traces...................................................................................................54How Tempcode works............................................................................................................54Development mode (aka debug mode)....................................................................................56Custom version of PHP...........................................................................................................57Engineering standards and trade-off .......................................................................................57Importers ............................................................................................................................58Import or forum driver?.....................................................................................................58Writing a forum driver.......................................................................................................59Writing an importer...........................................................................................................59eCommerce..........................................................................................................................62Permissions .........................................................................................................................62Referencing existing permissions ........................................................................................63Adding a new specific permission .......................................................................................63SEO meta-data ....................................................................................................................64Feedback mechanisms ..........................................................................................................65Language lookups, Comcode, and attachments ........................................................................67Hidden features inside ocPortal ..............................................................................................68Empty files ......................................................................................................................68Hidden 'values' ................................................................................................................68Hidden 'keep' parameters ..................................................................................................69Hints for making websites for other people...............................................................................71
Copyright ocProducts Ltd.
Page 3 of 74

Activity (7)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
ALi liked this
ALi liked this
April Showers liked this
prashpro liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->