Permalink
Browse files

Closes #13

Added new fields to the gallery module and plugin to support slideshows.
  • Loading branch information...
cosmomathieu committed Jan 19, 2016
1 parent 46a8bce commit ab959d431ea039cb2f6a6290f06d79d01e62a2f3
@@ -266,6 +266,8 @@ CREATE TABLE IF NOT EXISTS `gallery_images` (
`title` varchar(100) NOT NULL,
`alt` varchar(250) DEFAULT NULL,
`description` varchar(250) DEFAULT NULL,
`credits` varchar(250) DEFAULT NULL,
`link` varchar(250) DEFAULT NULL,
`hide` tinyint(1) NOT NULL DEFAULT '0',
`sort` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
@@ -93,13 +93,17 @@ function edit()
$this->form_validation->set_rules('title', 'Title', "trim|required");
$this->form_validation->set_rules('alt', 'Alternative Text', "trim");
$this->form_validation->set_rules('description', 'Description', 'trim');
$this->form_validation->set_rules('credits', 'Credits', 'trim');
$this->form_validation->set_rules('link', 'Link', 'trim');
$this->form_validation->set_rules('filename', 'filename', 'trim|required');
$this->form_validation->set_rules('hide', 'Hide', 'trim|integer');
if ($this->form_validation->run() == TRUE)
{
$Image->from_array($this->input->post());
$Image->description = ($this->input->post('description') != '') ? $this->input->post('description') : NULL;
$Image->credits = ($this->input->post('credits') != '') ? $this->input->post('credits') : NULL;
$Image->link = ($this->input->post('link') != '') ? $this->input->post('link') : NULL;
$Image->alt = ($this->input->post('alt') != '') ? $this->input->post('alt') : NULL;
$Image->hide = ($this->input->post('hide')) ? 1 : 0;
$Image->save();
@@ -90,6 +90,8 @@ private function _build_image_array()
'title' => $Image->title,
'alt' => $Image->alt,
'description' => $Image->description,
'credits' => $Image->credits,
'link' => $Image->link,
'image' => $Image->filename,
);
}
@@ -33,6 +33,16 @@
<?php echo form_textarea(array( 'name' => 'description', 'id' => 'description', 'value' => set_value('description', isset($Image->description) ? $Image->description : ''))); ?>
</div>
</div>
<div>
<?php echo form_label('Credits:', 'credits'); ?>
<?php echo form_input(array( 'name' => 'credits', 'value' => set_value('credits', isset($Image->credits) ? $Image->credits : ''))); ?> <span style="display: inline;" class="help">(The author name or URL)<span>
</div>
<div>
<?php echo form_label('Link:', 'link'); ?>
<?php echo form_input(array( 'name' => 'link', 'value' => set_value('link', isset($Image->link) ? $Image->link : ''))); ?> <span style="display: inline;" class="help"><span>
</div>
<div>
<?php echo form_label('', '')?>
@@ -71,11 +81,26 @@
);
});
var thin_config = {
toolbar : [
{ name: 'basicstyles', items : [ 'Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink'] }
],
{
name: 'basicstyles',
items: [ 'Format','Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','Source' ]
}
],
entities : false,
resize_maxWidth : '400px',
width : '550px',
height : '120px'
};
var thin_config = {
toolbar : [
{
name: 'basicstyles',
items: [ 'Format','Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','Source' ]
}
],
entities : false,
resize_maxWidth : '400px',
width : '550px',

0 comments on commit ab959d4

Please sign in to comment.