Editing
Refactoring a CMS to Use Shared LITTLED Libraries
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Configuration== ===Update content settings in site sections CMS=== *AJAX scripts **Listings: <code>/_hostmgr/_ajax/utils/listings.php</code> or <code>/_hostmgr/[CONTENT]/_ajax/listings.php</code> **Delete: <code>/_hostmgr/_ajax/utils/delete_record.php</code> **Update cache: <code>/_hostmgr/_ajax/utils/update_cache.php</code> **Resort: <code>/_hostmgr/_ajax/utils/resort.php</code> *ID parameter *Sortable flag *Cache Content flag ===Rename existing directories in VCS=== *<code>common</code> > <code>_config</code> *<code>common/*.js</code> > <code>_scripts/*.js</code> *<code>inline</code> > <code>_ajax</code> *<code>forms</code> > <code>_templates/forms</code> *<code>content</code> > <code>_templates/content</code> ===Refactor PHP content class=== *Refactor include directives *(Optional) add Netbeans-friendly class documentation *Wrap code within functions in <code>try { /*...*/ } catch (Exception $ex) { /*...*/ }</code> *Use <code>db_content_class</code> as base class for all classes that represent records in the database. ===Refactor PHP content filtering class=== *Refactor include directives *(Optional) add Netbeans-friendly class documentation *Refer to a class that’s been refactored for logic updates within the class’s routines. *Use <code>filter_collection_class</code> as base class for any class that represents records in the database. *Add <code>$site_section</code> property to any class that handles listings and pagination.<br/>TODO: Consider making this a property of <code>filter_collection_class</code>. *Add <code>$section_operations</code> property to any class that handles listings and pagination.<br/>TODO: Consider making this a property of <code>filter_collection_class</code>. ===Add content handlers to PHP cache and resort classes=== *Add include directives for PHP content and content filtering classes to cache_class *Add case for the content type in class routines as necessary **<code><strike>cache_class::update_content()</strike></code> **<code>cache_class::set_initial_properties()</code> **<code>cache_class::update_keywords()</code> **<code>cache_class::set_filters()</code> **<code>cache_class::set_content()</code> **<code>cache_class::load_json_content()</code> **<code>cache_class::refresh_content_after_edit()</code> **<code>cache_class::refresh_content_after_image_edit()</code> **<code><strike>resort_class::retrieve_section_properties()</strike></code> ===Refactor config files=== *<code>_config/core_includes.php</code> **fix paths to include files. *Refactor <code>_config/scripts.php</code> **add definition for <code>SECTION_BASE_URI</code> **<code>*_SCRIPT</code> > <code>*_URI</code> **<code>ADMIN_HTTP_ROOT_URI."section_name/"</code> > <code>SECTION_BASE_URI."</code> ===Local AJAX scripts=== *Refactor include directives *(Optional) refactor to use <code>ajax_page_class</code> *Add any necessary scripts **<code>listings.php</code> ===Local JavaScript libraries=== * Minify existing libraries ** Created “source” version of existing libraries: <code>lib.js</code> > <code>lib-source.js</code> ** Compress existing libraries: http://javascriptcompressor.com/ * Wrap content-specific code in jQuery plugin code: <syntaxhighlight lang="javascript"> (function($) { var methods = { <methodName>: function() { return this.each(function() { /* custom code goes here... */ }); } }; $.fn.<pluginName> = function( method ) { /* method calling logic */ if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if ( typeof method === 'object' || !method ) { return methods.init.apply(this, arguments); } else { $.error('Method ' + method + ' does not exist on jQuery.<pluginName>.'); } }; })(jQuery); </syntaxhighlight> * Use <code>$.cms()</code> JQuery binding routines as much as possible * See also: [[Binding JQuery Handlers]]
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information