Skip to content

Commit

Permalink
Merge pull request #88 from C-Lodder/sampledata
Browse files Browse the repository at this point in the history
Simplify the sample data options
  • Loading branch information
C-Lodder authored Oct 27, 2016
2 parents f850c5f + b789b92 commit 8e376d5
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 4,975 deletions.
15 changes: 10 additions & 5 deletions installation/form/field/sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

defined('JPATH_BASE') or die;

JFormHelper::loadFieldClass('radiobasic');
JFormHelper::loadFieldClass('radio');

/**
* Sample data Form Field class.
*
* @since 1.6
*/
class InstallationFormFieldSample extends JFormFieldRadioBasic
class InstallationFormFieldSample extends JFormFieldRadio
{
/**
* The form field type.
Expand Down Expand Up @@ -52,7 +52,7 @@ protected function getOptions()

// Add option to not install sample data.
$options[] = JHtml::_('select.option', '',
JHtml::_('tooltip', JText::_('INSTL_SITE_INSTALL_SAMPLE_NONE_DESC'), '', '', JText::_('INSTL_SITE_INSTALL_SAMPLE_NONE'))
JHtml::_('tooltip', JText::_('INSTL_SITE_INSTALL_SAMPLE_NONE_DESC'), '', '', JText::_('JNO'))
);

// Build the options list from the list of files.
Expand All @@ -62,7 +62,7 @@ protected function getOptions()
{
$options[] = JHtml::_('select.option', $file, JFactory::getLanguage()->hasKey($key = 'INSTL_' . ($file = JFile::stripExt($file)) . '_SET') ?
JHtml::_('tooltip', JText::_('INSTL_' . strtoupper($file = JFile::stripExt($file)) . '_SET_DESC'), '', '',
JText::_('INSTL_' . ($file = JFile::stripExt($file)) . '_SET')
JText::_('JYES')
) : $file
);
}
Expand Down Expand Up @@ -97,6 +97,11 @@ protected function getInput()
}
}

return parent::getInput();
if (empty($this->layout))
{
throw new UnexpectedValueException(sprintf('%s has no layout assigned.', $this->name));
}

return $this->getRenderer($this->layout)->render($this->getLayoutData());
}
}
2 changes: 1 addition & 1 deletion installation/model/forms/summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<field
name="sample_file"
type="installation.sample"
class="form-control"
class="radio btn-group btn-group-reverse"
label="INSTL_SITE_INSTALL_SAMPLE_LABEL"
/>
</fieldset>
Expand Down
174 changes: 0 additions & 174 deletions installation/sql/mysql/sample_blog.sql

This file was deleted.

168 changes: 0 additions & 168 deletions installation/sql/mysql/sample_brochure.sql

This file was deleted.

180 changes: 0 additions & 180 deletions installation/sql/mysql/sample_data.sql

This file was deleted.

768 changes: 0 additions & 768 deletions installation/sql/mysql/sample_learn.sql

This file was deleted.

199 changes: 0 additions & 199 deletions installation/sql/postgresql/sample_blog.sql

This file was deleted.

176 changes: 0 additions & 176 deletions installation/sql/postgresql/sample_data.sql

This file was deleted.

826 changes: 0 additions & 826 deletions installation/sql/postgresql/sample_learn.sql

This file was deleted.

361 changes: 0 additions & 361 deletions installation/sql/sqlazure/sample_blog.sql

This file was deleted.

315 changes: 0 additions & 315 deletions installation/sql/sqlazure/sample_brochure.sql

This file was deleted.

293 changes: 0 additions & 293 deletions installation/sql/sqlazure/sample_data.sql

This file was deleted.

1,508 changes: 0 additions & 1,508 deletions installation/sql/sqlazure/sample_learn.sql

This file was deleted.

10 changes: 9 additions & 1 deletion installation/template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ function initElements()
{
if (input.val() == '')
{
label.addClass('active btn-primary');
// Check for the sample data "No" button
if (input.attr('id') == 'jform_sample_file0')
{
label.addClass('active btn-danger');
}
else
{
label.addClass('active btn-primary');
}
}
else if (input.val() == 0)
{
Expand Down

0 comments on commit 8e376d5

Please sign in to comment.