ADDTODOC-PREPEND-BODY
if($controller = JRequest::getVar('controller')) {
require_once (JPATH_COMPONENT.DS.'controllers'.
DS.$controller.'.php');
}
$classname = 'MvcController'.ucfirst($controller);
$controller = new $classname( );
$controller->execute( JRequest::getVar('task'));
$controller->redirect();
?>
Line 2 is to protect document from direct access. line 4 to require default controller. This controller will render pages if controller GET/POST variable is not set. 6-8 to include other controller class if controller GET/POST variable was set. 10-11 create new controller class. 13-14 execute controller or render page according task

This file is quite simple. First it includes controller, then create class, then execute.

Create administrator/components/com_mvc/controller.php. This is controller we includes in line 4 of admin.mvc.php. This controller will be launched if there was not any GET/POST controller variable found.
File listing: controller.php

<?php
jimport('joomla.application.component.controller');class MvcController extends JController{ function display() { parent::display(); }}?> 2d line to include Joomla API controller class for extending new one created in line 4. Function display render default view. More about that later.

Basically that is all we need. If instead parent::display(); we put echo "test this"; we will see this on the main page of the component. But let's create fully structured MVC component. For that we need to create View for this controller.

Default view should have the same name as the component.

Create folder administrator/components/com_mvc/views. Create folder administrator/components/com_mvc/views/mvc. To create default view we need to name this folder as we named component. Create file administrator/components/com_mvc/view/mvc/view.html.php. This file will have view class. We do not use "mvc" word in the name of this file. Every view class has different folder but the same file name. it is view.html.php

File listing: views/mvc/view.html.php

<?phpjimport( 'joomla.application.component.view');class MvcViewMvc extends JView{ function display($tpl = null) { JToolBarHelper::title(JText::_( 'MVC Main' ), 'generic.png'); parent::display($tpl); }}?> Line 2 we include Joomla API View class to extend new one we create in line 3. 5-10 create function display(). This function is called by default, by MvcController class if not task called.

I used JToolBarHelper::title() to display tile. Here you can also use other JToolBarHelper methods. Also here you can make DB queries and prepare HTML elements to render such as Published Yes/No radio button set, Public/Registered/Special access select list, pageNav class to create navigation and other. Please, note the difference. In this view class we use Models(tables) and SQL queries to get information to create HTML elements to render. But in controller we make SQL queries and use models to control and operate records. Something like delete, publish, save, ...

Function display() will be called by default if there is no GET/POST task variable set. parent::display($tpl); will call default template if POST/GET layout variable is not set. So let's create default template.

Create file administrator/components/com_mvc/view/mvc/tmpl/default.php. File listing: views/mvc/tmpl/default.php

<h1>MVC Main</h1>;
<a href="index.php?option=com_mvc&controller=list">List something</a>; This is HTML document. This template will display H1 header and link to other controller. This is complete MVC minimum component. We only lack Models.

Please, save all files and try to call your new component. Login to Joomla admin and put to address line /index.php?option=com_mvc. Before you continue please, be sure all code works fine till this point.

Everything you will read below just to explain some more things. How to control different tasks and different Views within one Controller. For that, let's create another section that will be controlled by Controller list. First link to controller is without task so we will call default View again and create some more links with tasks to call other Views.

Lets imagine we clicked on index.php?option=com_mvc&controller=list link. That means we enable following lines in admin.mvc.php. File listing: views/mvc/tmpl/default.php

if($controller = JRequest::getVar('controller')) { require_once (JPATH_COMPONENT.DS.'controllers'. DS.$controller.'.php');} That means we need to create file administrator/components/com_mvc/controllers/list.php.

Create it.
File listing: controllers/list.php

<?phpjimport('joomla.application.component.controller');class MvcControllerList extends JController{ function __construct() { parent::__construct(); } function display() { JRequest::setVar('view', 'list'); parent::display(); }}?> JRequest::setVar('view', 'list'); tells this controller to look for View in views/list folder. If we skip or delete this line, this controller class will look for View in views/mvc default folder. So if we told controller to look for View in list folder, let's create it.

Create folder administrator/components/com_mvc/view/list Create folder administrator/components/com_mvc/view/list/tmpl Create file administrator/components/com_mvc/view/list/view.html.php File listing: views/list/view.html.php

<?phpjimport( 'joomla.application.component.view');class MvcViewList extends JView{ function display($tpl = null) { JToolBarHelper::title(JText::_( 'List' ), 'generic.png' ); parent::display($tpl); }}?> I won't explain this file. It is the same as views/mvc/view.html.php, only name of the class is different.

Create file administrator/components/com_mvc/view/list/tmpl/default.php File listing: views/list/tmpl/default.php

<h1>This is Default.php</h1><P>This file launch automatically is nothing passed to JRequest::setVar('layout', 'something');</P><a href="index.php?option=com_mvc&controller=list&task=test"> test</a><BR><a href="index.php?option=com_mvc&controller=list&task=new_task"> new_task</a><BR> That is it. It should work ok now. I mean you can easily navigate from MVC component homepage to list controller homepage.

But this file will display few links that have different tasks within same Controller. Here is how you can handle them. Start with task=new_task.

Create function new_task in File controllers/list.php.
File listing after adding function: controllers/list.php

<?phpjimport('joomla.application.component.controller');class MvcControllerList extends JController{ function __construct() { parent::__construct(); } function display() { JRequest::setVar('view', 'list'); parent::display(); } function new_task() { JRequest::setVar('view', 'list'); JRequest::setVar('layout','newtask'); parent::display(); }}?> We created function new_task() in line 13-18, that will be called if GET/POST task variable equal to new_task. JRequest::setVar('view', 'list'); tells controller to look for View in views/list/ folder. JRequest::setVar('layout','newtask'); tells controller that View should display newtask template or really newtask.php. Let's create it.

Create file administrator/components/com_mvc/view/list/tmpl/newtask.php File listing: views/list/tmpl/newtask.php

<h1>This is new task</h1><P>This task1, task2, new_task triger the same function </P><a href="index.php?option=com_mvc&controller=list">Go back</a> This file displays some text and link back to list controller homepage. Save all files and try it. Try to navigate to list controller homepage and click on new_task link. If you see text of above listing you are done. Congratulation. You have just created new task.

One more thins to know. It is possible to call same method with different tasks. For that add $this->registerTask( 'test' , 'new_task' ); to construct method of controllers/list.php.

Final listing: controllers/list.php

<?phpjimport('joomla.application.component.controller');class MvcControllerList extends JController{ function __construct() { parent::__construct(); $this->registerTask( 'test' , 'new_task' ); } function display() { JRequest::setVar('view', 'list'); parent::display(); } function new_task() { JRequest::setVar('view', 'list'); JRequest::setVar('layout','newtask'); parent::display(); }}?> Save all files and now try click test link on list controller homepage. Later I'll write a lesson on how to use Models and we will create simple guestbook component.

1.5.9 Update

Its been awhile since we really added anything new to the site. Today we have the first update for the new year.

Security Features

High Priority: Directory Traversal. A crafted request can allow an attacker to view directory trees on the server. Note: contents of files cannot be edited or deleted, just viewed. More information »Low Priority: SSL Session Token Disclosure. When running a site as SSL ONLY, if a non-SSL request is made, an attacker can obtain the session token. There is NO risk for Web sites that use both HTTP and HTTPS. More information »Components Fixed Contact Page so that a blank page is not displayed when vCard is not enabled, but is selected in the Contact Parameters (10680)Resolved problem with Category View Table where filter did not work when cache was enabled (10840)vCard no longer displays excess spaces (11871)Small change in components/com_banners/models/banner.php (12577)Resolved invalid XHTML 1.0 Transitional issues introduced in 1.5.7 for the Contact form (12868)Fixed problem that resulted in erroneous '404 - Contact not found' page for dropdown in Contact View (12989)Fixed Contact Category URL problems (13045)Fulltext Search for Uncategorized and Archived Articles is now working (13490)onPrepareContent issue for non-com_content Components resulting in a warning message has been resolved (13505)'Change Contact Details' link now loads correct page (13542)Contact image not displaying in front end (13643)Front-end article submission no longer auto-populates, finish publishing date with same date as start publishing (13673)Media Manager Javascript error: "Object doesn't support this property or method" that presented for IE has been fixed (13761)Space between meta keywords no longer removed when saving Articles (13794)com_installer Module View now correctly displays Author e-mail and URL (13942)Robots and Author meta retained when copying Articles (13949)Article Archive pagination fixed (14070)Correction so that unregistered site visitors can no longer access PDF for registered Articles (14196)Hits filter in Category List fixed (14390)Resolved problem where "Register to read more" incorrectly redirected to Front Page, rather than Article (14392)Poll error message resolved (14394)Resolved problem where Category List failed to retain Column Sort preference when navigating to a different page (14398)Resolved problem in Category List where changing Display # to All in page 2 of list would display no results (12932)Category List now correctly shows filtering option in use (14402)Corrected 404 error that resulted when menu access was set to Public and Contact Item is Registered (14412) Modules New modules can now be added, even when there are no modules entries already defined (11874)Inconsistency removed for Login/Logout Redirection page of mod_login (13611)JMenu getMenu() doc error corrected (13617)Archive Module Count Parameter and Tool Tip corrections (13694)STRPOS error corrected when editing Alias Menu Item (13909)Toolbar Image now points to an existing image (14171) Plugins OpenID upgraded to 2.0 protocol, now works with Yahoo (12217)plgSystemCache plugin now respect site and page language (12115)Page string in plugins/content/pagebreak.php is now properly externalized (12730)Legacy Plugin - Login Timeout resolved (13662)Access level for Plugins fixed (14106)Fixed OpenID Transition issues (14433)Templates RTL feeds PARAM is now saved in database which corrects RTL feeds in Milkyway and Beez (11235)CSS and XHTML valid error in JA_Purity resolved, as was invalid CSS validator link (12887)JA_Purity default status for Modules defined for right position now collapse correctly, when unused (12925)Fixed CSS errors in rhuk_milkyway/css/template_rtl.css (13517)Missing H1 text-align in rhuk_milkyway/css/template_rtl.css fixed (13570)Beez template override for com_search now displays error messages correctly (13584)Corrected Last Updated date for Beez Template (13632)Resolved inconsistencies for Beez Template Override Page Titles (13634)Contact image changes for Beez override (13700)Incorrect File Reference corrected for Beez Template (13859)Short PHP Notation in Beez Windows hosting bug introduced in 12798 has been fixed (14313)en-GB.com_statistics.ini are now correctly deleted (14391)Removed unnecessary string in JA_Purity template (14414)Removed unnecessary strings in rhuk_Milkyway template (14415) Language Language INI files that were incorrectly encoded using UTF-8 with BOM have been fixed (13499)Untranslated strings in en-GB.ini after SVN 11236 are fixed (13514)Fixed untranslated strings in com_weblinks (13608)Fixed untranslated strings in com_contact (13626)Fixed untranslated Strings in admin/mod_feed (13666)Spacer values are now translatable (14308)Fixed issue with JA_Purity spacer so that it is now translatable (14360)Resolved remaining English string hard-coded in mod_search (14374)String missing in en-GB.com_installer.ini (14389)Resolved untranslated language string for "Email a Friend" feature (14395)Tooltip language string in com_config corrected (13633) Administrator Added better tooltip text for the Help Server Reset button in Global Configuration System Settings (12023)Toolbar & value fixed for Media Manager button (12841)JInstallerHelper Class Function description has been corrected (13574)Help screens made (13616)Remove default filter for Super Admininistrator and fix filter whitelist problem (13770)Corrected error where Editor deleted content for default filter; UTF-8 compatibility is now enforced with JInputFilter (13901)Removed old dev.joomla.org links (14227) System query_batch corrected for SQL error (12247)uri.php changes made in 1.5.7 no longer break back-end URLs if $live_site=Http has an uppercase H (12812)JFolder::delete bug fixed when folder contain symbolic links on folders (12939)Typo in sample_data.sql resolved (13549)License correction for PHPMailer in CREDITS.php (13811)Fixed error that resulted from invoking JDatabase::Query() more than once (13860)Cache space is now correctly released (14317)String bug for strspn() resolved (14339)Weird characters removed from LICENSES.php file (14408)Removed outdated link in the installer language file (14410)Fixed typo in Cache Manager (14434)Updated Archive_Tar to relicensed BSD version (12746) 

In addition to this we got a new php programmer for Joomla and will be releasing hopefully the first quarter a nearly complete rewrite of Mafia Icons, There will be a basic version and a pro version. 

As well as Joomla Components we are in the works of launching a hosting service with Object6.com as well as joomla customization, From template development, custom components, modules. (e.g. you will be able to submit a psd that you want converted into a template/module/component) and they will do it.

 For a sample of work recently done www.digitalchow.com was a Joomla 1.0.13 site, With a template from Template Plazza that was 1.0 and did not work in 1.5 even with legacy mode turned on. Its now a Native 1.5 template and took the team not even 1 hour to complete.  Then they did component migration to the latest version of mosets tree as of 20 minutes about the sites running 1.5.9

So look forward to some more new products this year and services.

Migrating from 1.0.x to 1.5 Stable

Migrating from 1.0.x to 1.5 Stable
from joomla.org Jump to: navigation, search
The migration from Joomla! 1.0 to 1.5 is handled for the most part automatically in two stages. The first stage is the export migration component for Joomla! 1.0 and the second stage is the import or migration phase of the Joomla! 1.5 installer. The system is automated due to a large number of changes that make data slightly incompatible between Joomla! 1.0 and 1.5, such as parameters for menus and content items. Whilst it is still possible to use a database dump to migrate, this is not advised as there will be data loss. This page aims to detail how to migrate from Joomla! 1.0 to Joomla! 1.5 with as much ease as possible.

Note: Read all of this document first and test before you attempt this in your production site to minimise down time.

Prerequisites You will need a working Joomla! install, though using the latest available release of Joomla! 1.0 is always the best option. It is suggested that if you are using 1.0.13 you install Rob Schley's patch for admin sessions. As with everything you should take a full backup of everything before you start just in case something does go wrong. We advise that you do not destroy your 1.0.x install until you have completely finished migrating to 1.5 and are happy that things are working properly. Ideally you should complete migration using a testing system first before attempting it on your production system (e.g. either by using sites restored from backups or other replicas) and when deploying, separate your 1.0.x install from 1.5 (e.g. different database or at the least a different prefix).

Step 1: Downloading the Migrator component and installing it into your 1.0 instance The latest version of the migrator component exists at the Pasamio Project's FRS site. At the time of writing the latest release is Migrator 1.1. Download the Migrator component to your system and then install it into the 1.0 install. This is done like any normal component install. There will be a Migrator entry in the Component menu option where you can access the Migrator.

Step 2: Installing Third Party Migrator plugins The Migration system only handles the core system in its migration which means that if you want to include third party extension data from other tables you will have to install migrator plugins to handle the migration of this data. There are two types of plugins that are used: an "SQL" plugin which is a plain text SQL file and an "ETL" Plugin which is a bit of PHP that tells the migrator how to handle the data stored in tables (or in configuration files). This is done by selecting "Add Third Party Migrators", and then locating the plugin you wish to install and uploading the file. SQL files will be prepended to the output automatically and ETL plugins will be executed automatically. You can view a list of ETL plugins by clicking "List Plugins" in the main screen.

Step 3: Creating the Migration SQL File Once you have installed any third party migrator plugins, you can select the "Create Migration SQL file" to begin the creation process. The system is designed to build an SQL file without causing a timeout on the server, so you may notice that the page automatically refreshes and displays status information. Eventually it will display a notification that the process has been completed and the SQL file will be available for download. Part of the SQL file generation involves the alteration of various fields to make them compatible with changes made in Joomla! 1.5, including the rewriting of mosimage tags.

Step 4: Installing Joomla! 1.5 Note: Create your new Joomla! 1.5 install in a separate directory and database to your existing install (or different prefix if you cannot create a new database). You cannot extract over the top of your 1.0 install, you have to create a new Joomla! 1.5 site. Alternatively, move your 1.0 install to a safe location and install into the empty directory 1.0 will have created.

Note: It is not a very good idea to install a new Joomla! 1.5 site over the top of your existing 1.0 site, it is better to test things in a seperate directory and progress from there.

If you haven't done so already, take a full back up of your 1.0 site, including all of the filesystem and the database.

The last phase of the migration is the installation of a new Joomla! 1.5 site. You need to install '1.5 into a completely new directory, you should keep this separate to your 1.0 directory. If you just unzip over the top of your existing 1.0 site, you will have issues with it finding an invalid copy of the configuration.php" file, so either move your original install or create a new directory. Complete the initial steps of the installation as per a normal installation. In the final step where you are prompted for the site name you are given the opportunity to initiate the migration process. Migration requires the generated SQL file to complete its operation, which might need to be uploaded to your new 1.5 site, there are two options for doing this:

HTTP Upload FTP/SCP Upload The first method, HTTP upload, is best for smaller SQL files that will fit within the upload limits of PHP. The alternative is to upload a file using either FTP, SCP or some other method of file transfer that your hosting provider offers. This is useful for larger SQL files that would normally not be permitted by PHP. To use the HTTP method, simply select the file like a normal component installation. To use the alternative upload method, upload the files into the installation/sql/migration folder and rename the file to be called "migrate.sql". If for some reason the migration fails you will need to reupload the SQL file for both methods, HTTP and FTP/SCP, as the file is altered through the migration process. The prefix for all migration dumps is "jos_", this should be placed into the provided text box. Once migration has been completed, enter in a site name (the site name cannot be migrated for technical reasons) and finish the installation.

Using either method the "/installation/sql/migration" folder and your temporary files folder (e.g. "/tmp") need to be writeable by the web user (e.g. "wwwrun", "www-data" or "apache"). The migrator will write data back to these locations as it updates the dump files.

Please note you also need to tick the "This script is a Joomla! 1.0 migration script" box as well before you migrate otherwise you will have issues with importing data.

Set as favorite Bookmark Email This Hits: 35 Trackback(0) TrackBack URI for this entry Comments (0) Subscribe to this comment's feed Show/Hide comments
Write comment Name Email Website Title Comment smaller | bigger
Subscribe via email (Registered users only) I have read and agree to the Terms of Usage.
Write the displayed characters

Add Comment Please enable JavaScript to post a new comment
jc_loadUserInfo();

Page 1 of 2

ADDTODOC-APPEND-BODY