Version 1.1.0 released
git-svn-id: svn://p-o.co.uk/p-o.co.uk/com_ajaxdemo@60 60e5ea7b-c093-dd11-ac13-000423648166
This commit is contained in:
1
site/views/colour/index.html
Normal file
1
site/views/colour/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#fff"></body></html>
|
||||
81
site/views/colour/tmpl/default.php
Normal file
81
site/views/colour/tmpl/default.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Ajax demonstration component
|
||||
*
|
||||
* PHP version 5.3
|
||||
*
|
||||
* @category Joomla_Component
|
||||
* @package Com_Ajaxdemo
|
||||
* @subpackage View
|
||||
* @author Alan Hicks <ahicks@p-o.co.uk>
|
||||
* @copyright 2010-2012 Persistent Objects Ltd
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* @link http://p-o.co.uk/
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<div style="position:relative;">
|
||||
<div style='width:350px; float:right;'>
|
||||
<h3><i><?php echo $this->item->title ?></i></h3>
|
||||
<div><?php echo $this->item->notes;?></div>
|
||||
</div>
|
||||
|
||||
<?php if (count($this->colours) > 1) { ?>
|
||||
<div style='width:350px; position:absolute;bottom:0;left:450px;'>
|
||||
<p> </p>
|
||||
<p>More of this colour</p>
|
||||
<p><?php
|
||||
foreach ($this->colours as $item) {
|
||||
$link = JRoute::_(
|
||||
'index.php?option=com_ajaxdemo&view=colour&id='.$item->id, false
|
||||
);
|
||||
$image = 'components/com_ajaxdemo/images/' . $item->thumbnail_image;?>
|
||||
<a href='<?php echo $link ?>'>
|
||||
<img src='<?php echo $image;?>'
|
||||
alt='<?php echo $item->title ?>' /></a><?php
|
||||
} ?>
|
||||
</p>
|
||||
</div><?php
|
||||
}?>
|
||||
|
||||
<div><img src='<?php
|
||||
echo 'components/com_ajaxdemo/images/'
|
||||
. $this->item->main_image;
|
||||
?>' alt='<?php
|
||||
echo htmlspecialchars($this->title)
|
||||
?>' /></div>
|
||||
<div style='width:100%'>
|
||||
<hr/>
|
||||
<?php if ( $this->next_colour ) {
|
||||
$link = JRoute::_(
|
||||
'index.php?option=com_ajaxdemo&view=colour&id='
|
||||
. $this->next_colour->colour_id,
|
||||
false
|
||||
);?>
|
||||
<p style='float: right;'><a href='<?php echo $link ?>'>
|
||||
Next: <?php echo $this->next_colour->title ?><br/>
|
||||
<img
|
||||
src='<?php echo 'components/com_ajaxdemo/images/'
|
||||
. $this->next_colour->thumbnail_image;?>'
|
||||
alt='<?php echo $this->next_colour->title ?>' />
|
||||
</a></p><?php
|
||||
} ?>
|
||||
<?php if ( $this->prev_colour ) {
|
||||
$link = JRoute::_(
|
||||
'index.php?option=com_ajaxdemo&view=colour&id='
|
||||
. $this->prev_colour->colour_id,
|
||||
false
|
||||
);?>
|
||||
<p style='float: left;'><a href='<?php echo $link ?>'>
|
||||
Previous: <?php echo $this->prev_colour->title ?><br/>
|
||||
<img
|
||||
src='<?php echo '/components/com_ajaxdemo/images/'
|
||||
. $this->prev_colour->thumbnail_image;?>'
|
||||
alt='<?php echo $this->prev_colour->title ?>' />
|
||||
</a></p><?php
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
16
site/views/colour/tmpl/default.xml
Normal file
16
site/views/colour/tmpl/default.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="Individual Colour">
|
||||
<message>
|
||||
<![CDATA[Individual Colour layout.]]>
|
||||
</message>
|
||||
</layout>
|
||||
<state>
|
||||
<params>
|
||||
<param type="sql" name="Colour" default="10" label="Select a colour" query="SELECT id AS value, name FROM #__ajaxdemo_colours ORDER BY ordering" />
|
||||
</params>
|
||||
<advanced>
|
||||
<param />
|
||||
</advanced>
|
||||
</state>
|
||||
</metadata>
|
||||
1
site/views/colour/tmpl/index.html
Normal file
1
site/views/colour/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#fff"></body></html>
|
||||
95
site/views/colour/tmpl/lightbox.php
Normal file
95
site/views/colour/tmpl/lightbox.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* Ajax demonstration component
|
||||
*
|
||||
* PHP version 5.3
|
||||
*
|
||||
* @category Joomla_Component
|
||||
* @package Com_Ajaxdemo
|
||||
* @subpackage View
|
||||
* @author Alan Hicks <ahicks@p-o.co.uk>
|
||||
* @copyright 2010-2012 Persistent Objects Ltd
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* @link http://p-o.co.uk/
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
$rel_handler="{handler: 'ajax',"
|
||||
." size: {x: 800, y: 450},"
|
||||
." onClose: function() {},"
|
||||
." onAjax: function() {"
|
||||
."SqueezeBox.assign($$('a.lightbox2'),"
|
||||
." {parse: 'rel'});"
|
||||
."},"
|
||||
." ajaxOptions: {method: 'post'}}";
|
||||
?>
|
||||
<div id='lightbox-content' style="position:relative;">
|
||||
<div id='lb-maingroup' style='width:350px; position:absolute; left:420px'>
|
||||
<h3><i><?php echo $this->item->title ?></i></h3>
|
||||
<div><?php echo $this->item->notes;?></div>
|
||||
</div>
|
||||
|
||||
<?php if (count($this->colours) > 1) { ?>
|
||||
<div id='lb-more' style='width:350px; position:absolute;bottom:0;left:420px;'>
|
||||
<p> </p>
|
||||
<p>More of this colour</p>
|
||||
<p><?php
|
||||
foreach ($this->colours as $item) {
|
||||
$link = JRoute::_(
|
||||
'index.php?option=com_ajaxdemo&view=colour&id='.$item->id, false
|
||||
);
|
||||
$image = 'components/com_ajaxdemo/images/' . $item->thumbnail_image;?>
|
||||
<a href='<?php echo $link ?>'
|
||||
class="lightbox2"
|
||||
rel="<?php echo $rel_handler; ?>"
|
||||
><img src='<?php echo $image;?>'
|
||||
alt='<?php echo $item->title ?>' /></a><?php
|
||||
} ?>
|
||||
</p>
|
||||
</div><?php
|
||||
}?>
|
||||
|
||||
<div id='lb-image'><img src='<?php
|
||||
echo 'components/com_ajaxdemo/images/'
|
||||
. $this->item->main_image;
|
||||
?>' alt='<?php
|
||||
echo htmlspecialchars($this->title)
|
||||
?>' /></div>
|
||||
<div style='width:98%'>
|
||||
<hr/>
|
||||
<?php if ( $this->next_colour ) {
|
||||
$link = JRoute::_(
|
||||
'index.php?option=com_ajaxdemo&view=colour&id='
|
||||
. $this->next_colour->colour_id,
|
||||
false
|
||||
);?>
|
||||
<p style='float: right;'>
|
||||
<a href='<?php echo $link ?>'
|
||||
class="lightbox2"
|
||||
rel="<?php echo $rel_handler; ?>">
|
||||
Next: <?php echo $this->next_colour->title ?><br/>
|
||||
<img
|
||||
src='<?php echo 'components/com_ajaxdemo/images/'
|
||||
. $this->next_colour->thumbnail_image;?>'
|
||||
alt='<?php echo $this->next_colour->title ?>'
|
||||
/></a></p><?php
|
||||
} ?>
|
||||
<?php if ( $this->prev_colour ) {
|
||||
$link = JRoute::_(
|
||||
'index.php?option=com_ajaxdemo&view=colour&id='
|
||||
. $this->prev_colour->colour_id,
|
||||
false
|
||||
);?>
|
||||
<p style='float: left;'><a href='<?php echo $link ?>'
|
||||
class="lightbox2"
|
||||
rel="<?php echo $rel_handler; ?>">
|
||||
Previous: <?php echo $this->prev_colour->title ?><br/>
|
||||
<img
|
||||
src='<?php echo 'components/com_ajaxdemo/images/'
|
||||
. $this->prev_colour->thumbnail_image;?>'
|
||||
alt='<?php echo $this->prev_colour->title ?>' />
|
||||
</a></p><?php
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
68
site/views/colour/view.html.php
Normal file
68
site/views/colour/view.html.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* Ajax demonstration component
|
||||
*
|
||||
* PHP version 5.3
|
||||
*
|
||||
* @category Joomla_Component
|
||||
* @package Com_Ajaxdemo
|
||||
* @subpackage View
|
||||
* @author Alan Hicks <ahicks@p-o.co.uk>
|
||||
* @copyright 2010-2012 Persistent Objects Ltd
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* @link http://p-o.co.uk/
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* HTML View class for the Ajax demonstration component
|
||||
*
|
||||
* @category Joomla_Component
|
||||
* @package Com_Ajaxdemo
|
||||
* @subpackage Components
|
||||
* @author Alan Hicks <ahicks@p-o.co.uk>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* @link http://p-o.co.uk/
|
||||
*/
|
||||
class AjaxdemoViewColour extends JView
|
||||
{
|
||||
protected $item;
|
||||
protected $colours;
|
||||
|
||||
/**
|
||||
* Display method for Colours
|
||||
*
|
||||
* @param string $tpl Template to display
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
function display($tpl = null)
|
||||
{
|
||||
// Get data from the model
|
||||
$this->item = $this->get('Item');
|
||||
$this->prev_colour = $this->get('PrevColour');
|
||||
$this->next_colour = $this->get('NextColour');
|
||||
$this->colours = $this->get('Colours');
|
||||
|
||||
if (JRequest::getMethod() == 'POST') {
|
||||
JRequest::setVar('tmpl', 'component');
|
||||
$this->setLayout('lightbox');
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
JError::raiseError(500, implode('<br />', $errors));
|
||||
return false;
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user