iTask 2.0 Content Management Backend
DEVELOPER'S GUIDE Part 1 Introduction
© codeArts Nepal Pvt. Ltd. 2008
Table of Contents No. 1.
2.
3.
Particulars Introduction 1.1. What is I TASK CMS and its use 1.2. Why ITask 1.3. Current version and other issues 1.4. What does the package contains ITask technicalities 2.1. Prerequisites necessary to understand things below 2.2. Directory structure of iTask 2.0 2.3. Core required modules and tables to run the CMS 2.3.1. Modules 2.3.2. Tables 2.4. Other Used Components 2.4.1. TinyMCE: to enable rich text 2.4.2. Spry: for validation. 2.4.3. Datagrid 2.4.4. PEAR DB 2.4.5. Mail – PHP Mailer 2.4.6. Encryption (ECDC) 2.4.7. SimplePie References
Page No. 2 2 2 2 2 3–7 3 3-4 4 4 4 5-7 5 5 5-6 6-7 7 7 7 8
1
Introduction: iTask CMS is a product of codeArts Nepal, it will…. 1.1. What is iTask CMS and its use iTask CMS is the back end handler of the projects carried out at CodeArts Nepal. For back end Create Read Update and Delete (CRUD) operation it is used to effectively handle CRUD and similar data operation. It has been developed keeping flexibility in mind and its modular design permits to use the product in an efficient way. 1.2. Why iTask As this is for the back end it has its own look and feel (theme), we can develop a working version of the site without the need to develop any front end design or other components. It helps us go parallel with the front and back end coding if needed. 1.3. Current version and other issues The current version of this iTask CMS is version 2.0. Some changes can be seen in the CSS theme as per the implementation but components are almost same on all implementations. 1.4. What does this package contains: This package consists mainly of the iTask CMS 2.0 code base with required modules, core database schema and instance SQL, itask_sample_modules with mod_page module, mod_page_elements module which has block as sub module, mod_product and user guides in PDF format, one is introduction and other is tutorial. In addition to it the package also comprises of iTask module generator for module code generation and iTask access generator for generating access to the generated modules as per user level and system requirement and project_folder a folder which has the CMS code base and required modules with its database dump inside the admin folder. The picture below shows what's where, Using zoom feature encouraged:
2
2. iTask technicalities: I TASK is a content management system (CMS) is mainly well suited to handle CRUD (Create Read Update Delete) functionality. With its module generator, needed modules can be generated and edited to suit the needs of any application dealing with data add, update, delete and view in database driven web application.
2.1. Prerequisites necessary to understand things below To understand the documentation from here, it is believed that you have intermediate knowledge of PHP and MYSQL and some basic knowledge of open source content management system like Joomla. If you have PHP and MYSQL knowledge it is believed you know HTML, Javascript and some CSS. It is also presumed that you have some knowledge of object oriented programming and its core implementation like classes, objects, methods and other basic principles.
2.2. Directory structure of iTask 2.0 The directory structure of iTask 2.0 CMS that resides in the project folder as admin folder as follows:
The CMS sits in the project folder usually with the name admin, for example if your project folder is lets say project_folder then it'll be something like follows; htdocs/project_folder --------------------------\admin – Admin is the ITASK root all the files will reside here. -----------------------------------\components – has all the components we use like datagrid. -----------------------------------\db – has the initial database dump with 7 tables -----------------------------------\includes – header, footer, menu and other include files are here. -----------------------------------\js – all the js files like prototype, mootools are stored here. -----------------------------------\lib – has the library of database, file and template object. -----------------------------------\modules – stores all the modules including the 4 core modules, all generated
3
modules should be coped here to use. -----------------------------------\plugins – has the plugins spry, tiny_mce and calendar and can house other plugins -----------------------------------\theme – has the theme images and theme CSS files. -----------------------------------\user_guide – has this user guide PDF file.
2.3. Core required modules and tables to run the CMS 2.3.1. Modules – 4 : The modules are as follows: 2.3.1.1.mod_accesslevel: handles the access level of uses 2.3.1.2.mod_auth: authorized the users 2.3.1.3.mod_default: displays all modules. 2.3.1.4.mod_user: add, update, delete, list and search uses and assign access level to the users. 2.3.2. Tables – 7 : The tables are as follow: 2.3.2.1.tbl_cms_menu: holds the data to show the menu of the back end like one below:
2.3.2.2.tbl_login_history: stores who logged in when in the back end iTask CMS. 2.3.2.3.tbl_module: stores the list of modules used for the site. 2.3.2.4.tbl_module_user_group: stores which user group has access to which modules. 2.3.2.5. tbl_setting: stores the application level variable of the application like site name, mail in addition things like pay pal information can be stored in this table as per need. 2.3.2.6.tbl_user: stores all the users who can use the system. 2.3.2.7.tbl_user_group: stores the users group of the system.
4
2.4. Other Used Components 2.4.1. TinyMCE: TinyMCE also known as the Tiny Moxiecode Content Editor, is a platform-independent web-based JavaScript/HTML WYSIWYG editor control, released as open source software under the LGPL by Moxiecode Systems AB. It has the ability to convert HTML textarea fields or other HTML elements to editor instances. TinyMCE is designed to easily integrate with content management systems. It has been utilized in iTask CMS in textarea to enable input of rich text with font selection, font size selection and all other formatting options. URL: http://tinymce.moxiecode.com/ 2.4.2. Spry: The Spry Framework is an open source Ajax framework developed by Adobe Systems which is used in the construction of Rich Internet Applications. Unlike other pure JavaScript frameworks such as the Dojo Toolkit and Prototype, Spry is geared towards web designers, not web developers, although it is increasingly difficult to decouple these two fields. Spry is currently in beta. The current version is 1.6. Adobe has not specified a target release date for the Spry framework, nor has it posted any sort of roadmap. Spry prerelease 1.5 was released on May 17.The Spry framework is directly integrated into the Dreamweaver CS3. Spry javascript/AJAX framework has been used for validation of textfield mainly. It can be extended to validate textareas, checkbox etc. check the URL below to know more about it. URLs: http://labs.adobe.com/technologies/spry/ http://labs.adobe.com/technologies/spry/home.html http://labs.adobe.com/technologies/spry/articles/textfield_overview/ 2.4.3. Datagrid A grid view or a datagrid is a graphical user interface element (widget) that presents a tabular view of data. A typical grid view also supports some or all of the following: • Clicking a column header to change the sort order of the grid • Dragging column headers to change their size and their order • In-place editing of viewed data • Row and column separators, and alternating row background colors The datagrid we are using for iTask CMS is PHP DataGrid version 4.1.0 (8.04.2007), it has following features. - CSS emb.templates, - Column sorting - Filtering - Pagging
5
-
Automatic validation Client side - View mode Tabular layout Columnar layout - Details mode Columnar layout - Add new mode - Edit mode Tabular layout Columnar layout - Delete mode - Printing - Exporting - Multi-Database support - Multi-Language support - Multi-Browser support - W3C CSS validation - WYSIWYG editor URLs: http://phpbuilder.blogspot.com/ http://phpbuilder.blogspot.com/2007/02/step-by-step-v400-or-above.html
2.4.4. PEAR DB: DB is a database abstraction layer providing: * An OO-style query API * Portability features that make programs written for one DBMS work with other DBMS's * A DSN (data source name) format for specifying database servers * prepare/execute (bind) emulation for databases that don't support it natively * A result object for each query response * Portable error codes * sequence emulation * Sequential and non-sequential row fetching as well as bulk fetching * Formats fetched rows as associative arrays, ordered arrays or objects * Row limit support * Transactions support * Table information interface * DocBook and phpDocumentor API documentation DB layers itself on top of PHP's existing database extensions. Drivers for the following extensions pass the complete test suite and provide interchangeability when all of DB's portability options are enabled:
6
fbsql, ibase, informix, msql, mssql, mysql, mysqli, oci8, odbc, pgsql, sqlite and sybase. There is also a driver for the dbase extension, but it can't be used interchangeably because dbase doesn't support many standard DBMS features. DB is compatible with both PHP 4 and PHP 5. URL: http://pear.php.net/package/DB 2.4.5. Mail (PHPMailer - PHP Email Class) PHPMailer – a full featured email transport class with a small footprint that is simple to use and integrate into your own software. URL: http://phpmailer.codeworxtech.com/ 2.4.6. Encryption (ECDC) A bin2hex function with following code has been used to achieve encryption: function hex2bin($data) { $len = strlen($data); return @pack("H" . $len, $data); }. File at: \admin\components\ecdc\class.ecdc.php A similar library is also available for Code Igniter for front end integration. 2.4.7. SimplePie SimplePie is a very fast and easy-to-use class, written in PHP that puts the ‘simple’ back into ‘really simple syndication’. Flexible enough to suit beginners and veterans alike, SimplePie is focused on speed, ease of use, compatibility and standards compliance. URLs: http://simplepie.org/ http://simplepie.org/wiki/start - Documentation
7
3. References http://en.wikipedia.org/wiki/Datagrid http://en.wikipedia.org/wiki/Create%2C_read%2C_update_and_delete http://en.wikipedia.org/wiki/Spry_framework http://en.wikipedia.org/wiki/TinyMCE http://en.wikipedia.org/wiki/Content_management_system
8