Leo Restro
Leo Restro comes in 3 theme colors to suit your style and support customization for background and fonts via template configuration. Leo Restro is built on the Leo Framework.
mysqldump --user=username --password=password --default-character-set=latin1 --skip-set-charset dbname > dump.sql
sed -r 's/latin1/utf8/g' dump.sql > dump_utf.sql
mysql --user=username --password=password --execute="DROP DATABASE dbname; CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql --user=username --password=password --default-character-set=utf8 dbname < dump_utf.sql
article 1 | 1 (continued) |
article 2 | article 4 |
article 3 | article 5 |
article 1 | 1 (continued) |
article 2 | article 3 |
article 4 | article 5 |
<param name="accesskey" type="text" size="1" default="" label="Accessibility Access Key"
description="Accessibility Access Key for the page which this Menu item points to" />
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<state>
<name>Component</name>
<description>Component Parameters</description>
<params>
<param name="page_title" type="text" size="30" default="" label="Page Title"
description="PARAMPAGETITLE" />
<param name="show_page_title" type="radio" default="1" label="Show Page Title"
description="SHOW/HIDE THE PAGES TITLE">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
<param name="pageclass_sfx" type="text" size="20" default="" label="Page Class Suffix"
description="PARAMPAGECLASSSFX" />
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="menu_image" type="imagelist" directory="/images/stories" hide_default="1"
default="" label="Menu Image" description="PARAMMENUIMAGE" />
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="secure" type="radio" default="0" label="SSL Enabled" description="PARAMSECURE">
<option value="-1">Off</option>
<option value="0">Ignore</option>
<option value="1">On</option>
</param>
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="accesskey" type="text" size="1" default="" label="Accessibility Access Key"
description="Accessibility Access Key for the page which this Menu item points to" />
</params>
<advanced />
</state>
</metadata>
// ACCESS KEY HACK - Part 1
$accessKey = $iParams->get('accesskey');
$tmp->accessKey = $accessKey;
// ACCESS KEY HACK - Part 2
if ($tmp->accessKey)
$data = '<a href="'.$tmp->url.'" accesskey="'.$tmp->accessKey.'">'.$image.$tmp->name.'</a>';
else
$data = '<a href="'.$tmp->url.'" >'.$image.$tmp->name.'</a>';
function _getItemData($item)
{
$data = null;
// Menu Link is a special type that is a link to another item
if ($item->type == 'menulink')
{
$menu = &JSite::getMenu();
if ($tmp = clone($menu->getItem($item->query['Itemid']))) {
$tmp->name = '<span><![CDATA['.$item->name.']]></span>';
$tmp->mid = $item->id;
$tmp->parent = $item->parent;
} else {
return false;
}
} else {
$tmp = clone($item);
$tmp->name = '<span><![CDATA['.$item->name.']]></span>';
}
$iParams = new JParameter($tmp->params);
if ($iParams->get('menu_image') && $iParams->get('menu_image') != -1) {
$image = '<img src="'.JURI::base(true).'/images/stories/'.$iParams->get('menu_image').'" alt="" />';
} else {
$image = null;
}
// ACCESS KEY HACK - Part 1
$accessKey = $iParams->get('accesskey');
$tmp->accessKey = $accessKey;
switch ($tmp->type)
{
case 'separator' :
return '<span class="separator">'.$image.$tmp->name.'</span>';
break;
case 'url' :
if ((strpos($tmp->link, 'index.php?') !== false) && (strpos($tmp->link, 'Itemid=') === false)) {
$tmp->url = $tmp->link.'&Itemid='.$tmp->id;
} else {
$tmp->url = $tmp->link;
}
break;
default :
$router = JSite::getRouter();
$tmp->url = $router->getMode() == JROUTER_MODE_SEF ?
'index.php?Itemid='.$tmp->id : $tmp->link.'&Itemid='.$tmp->id;
break;
}
// Print a link if it exists
if ($tmp->url != null)
{
// Handle SSL links
$iSecure = $iParams->def('secure', 0);
if ($tmp->home == 1) {
$tmp->url = JURI::base();
} elseif (strcasecmp(substr($tmp->url, 0, 4), 'http') && (strpos($tmp->link, 'index.php?') !== false)) {
$tmp->url = JRoute::_($tmp->url, true, $iSecure);
} else {
$tmp->url = str_replace('&', '&', $tmp->url);
}
switch ($tmp->browserNav)
{
default:
case 0:
// _top
// ACCESS KEY HACK - Part 2 ###############################
if ($tmp->accessKey)
$data = '<a href="'.$tmp->url.'" accesskey="'.$tmp->accessKey.'">'.$image.$tmp->name.'</a>';
else
$data = '<a href="'.$tmp->url.'" >'.$image.$tmp->name.'</a>';
break;
case 1:
// _blank
$data = '<a href="'.$tmp->url.'" target="_blank">'.$image.$tmp->name.'</a>';
break;
case 2:
// window.open
$attribs = 'toolbar=no,location=no,status=no,menubar=no,
scrollbars=yes,resizable=yes,'.$this->_params->get('window_open');
// hrm...this is a bit dickey
$link = str_replace('index.php', 'index2.php', $tmp->url);
$data = '<a href="'.$link.'" onclick="window.open(this.href,\'targetWindow\',\''.$attribs.'\');
return false;">'.$image.$tmp->name.'</a>';
break;
}
} else {
$data = '<a>'.$image.$tmp->name.'</a>';
}
return $data;
}
JPlugin
class. In the effort to move Joomla! toward a more efficient object-oriented framework, a new plugin system has been developed which follows the Observer pattern. Plugins are observer classes that attach to a global event dispatcher object in the Joomla! core. What does this mean in English? It means that either the Joomla! core or a third party component or module can trigger an event which causes one or more plugins to execute some code.JPlugin
, and an observable class, JEventDispatcher
./**
* JPlugin Class
*
* @package Joomla.Framework
* @subpackage Application
* @since 1.5
*/
class JPlugin extends JObserver
{
/**
* Constructor
*
* For php4 compatability we must not use the __constructor as a constructor for plugins
* because func_get_args ( void ) returns a copy of all passed arguments NOT references.
* This causes problems with cross-referencing necessary for the observer design pattern.
*
* @param object $subject The object to observe
* @since 1.5
*/
function JPlugin(& $subject)
{
parent::__construct($subject);
}
/**
* Method to map events to handler methods
*
* @access public
* @param array Arguments
* @return mixed Routine return value
* @since 1.1
*/
function update( &$args )
{
/*
* First lets get the event from the argument array. Next we will unset the
* event argument as it has no bearing on the method to handle the event.
*/
$event = $args['event'];
unset($args['event']);
/*
* If the method to handle an event exists, call it and return its return
* value. If it does not exist, return a boolean true.
*/
if (method_exists($this, $event)) {
return call_user_func_array(array($this, $event), $args);
} else {
return true;
}
}
}
JObserver
. The following is what happens in the constructor:// Register the observer ($this) so we can be notified
$subject->attach($this);
// Set the subject to observe
$this->_subject = &$subject;
JPlugin
to an observable object. In the case of plugins, they observe the JEventDispatcher
object.<?php
/**
* @version $Id: $
* @package
* @subpackage
* @copyright
* @license
*/
jimport('joomla.plugin');
/**
* Example Plugin
*
* @author
* @package
* @subpackage
* @since
*/
class ExamplePlugin extends JPlugin
{
/**
* Constructor
*
* @param object $subject The object to observe
* @since 1.1
*/
function ExamplePlugin( &$subject ) {
parent::__construct( $subject );
}
/**
* This method handles the onIncrement event. It takes an integer input and
* increments its value.
*
* @access public
* @param int $input An integer to increment
* @return int Incremented integer
* @since 1.1
*/
function onIncrement($input)
{
return $input++;
}
}
?>
JPlugin
. It is truly as simple as creating a class that extends JPlugin
and writing a method for each event you want the plugin to handle.