Skip to content

Commit

Permalink
Merge pull request #693 from Joomla-Bible-Study/bcordis-save-cache
Browse files Browse the repository at this point in the history
Bcordis save cache
  • Loading branch information
bcordis authored Sep 4, 2016
2 parents 2745dd2 + 0fc3f3b commit ff678d6
Show file tree
Hide file tree
Showing 41 changed files with 710 additions and 579 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Status
<tr>
<td align="center"><a href="https://travis-ci.org/Joomla-Bible-Study/Joomla-Bible-Study" target="_blank"><img src="https://travis-ci.org/Joomla-Bible-Study/Joomla-Bible-Study.png?branch=development"/></a></td>
<td align="center">Development</td>
<td align="center">9.0.4</td>
<td align="center">9.0.5</td>
<td align="center">TBD</td>
<td align="center">3.4+</td>
</tr>
<tr>
<td align="center"><a href="https://travis-ci.org/Joomla-Bible-Study/Joomla-Bible-Study" target="_blank"><img src="https://travis-ci.org/Joomla-Bible-Study/Joomla-Bible-Study.png?branch=master"/></a></td>
<td align="center">Master</td>
<td align="center">9.0.3</td>
<td align="center">Aug 22, 2016</td>
<td align="center">9.0.4</td>
<td align="center">September 4, 2016</td>
<td align="center">3.4+</td>
</tr>
</table>
Expand Down
Binary file modified build/packages/component/com_biblestudy.zip
Binary file not shown.
Binary file modified build/packages/modules/mod_biblestudy.zip
Binary file not shown.
Binary file modified build/packages/modules/mod_biblestudy_podcast.zip
Binary file not shown.
Binary file modified build/packages/pkg_biblestudy.zip
Binary file not shown.
Binary file modified build/packages/plugins/plg_biblestudy_backup.zip
Binary file not shown.
Binary file modified build/packages/plugins/plg_biblestudy_finder.zip
Binary file not shown.
Binary file modified build/packages/plugins/plg_biblestudy_podcast.zip
Binary file not shown.
Binary file modified build/packages/plugins/plg_biblestudy_search.zip
Binary file not shown.
1 change: 1 addition & 0 deletions build/phpcs/Joomla/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<exclude-pattern type="relative">vendor/*</exclude-pattern>
<exclude-pattern type="relative">bin/*</exclude-pattern>
<exclude-pattern type="relative">.joomla-dev/*</exclude-pattern>
<exclude-pattern type="relative">*/*default.php*</exclude-pattern>

<!-- Exclude folders not containing production code -->
<exclude-pattern type="relative">build/*</exclude-pattern>
Expand Down
4 changes: 2 additions & 2 deletions build/pkg_biblestudy_package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.joomlabiblestudy.org</authorUrl>
<copyright>(C) 2007 - 2016 Joomla Bible Study All rights reserved.</copyright>
<version>9.0.3</version>
<creationDate>Aug 22, 2016</creationDate>
<version>9.0.4</version>
<creationDate>September 4, 2016</creationDate>
<license>http://www.gnu.org/licenses/gpl.html</license>
<packager>Tom Fuller</packager>
<packagerurl>http://www.joomlabiblestudy.org</packagerurl>
Expand Down
3 changes: 1 addition & 2 deletions com_biblestudy/admin/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
define('JBSM_PROFILER', 0);

// Version information
define('BIBLESTUDY_VERSION', '9.0.3');
define('BIBLESTUDY_VERSION_DATE', '2016-08-22');
define('BIBLESTUDY_VERSION', '9.0.4');
define('BIBLESTUDY_VERSION_UPDATEFILE', 'JBS Version ' . BIBLESTUDY_VERSION);

// Default values
Expand Down
4 changes: 2 additions & 2 deletions com_biblestudy/admin/biblestudy.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

if ($jbsstate && $type == 'install')
{
$cache = new JCache(array('defaultgroup' => 'default'));
$cache->clean();
JBSMHelper::clearcache('admin');
JBSMHelper::clearcache('site');
$app->input->set('task', 'browse');
}

Expand Down
8 changes: 4 additions & 4 deletions com_biblestudy/admin/controllers/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public function browse()

if (empty($stack))
{
$cache = new JCache(array('defaultgroup' => 'com_biblestudy'));
$cache->clean();
JBSMHelper::clearcache('site');
JBSMHelper::clearcache('admin');
$session->set('asset_stack', '', 'JBSM');

/** @var BibleStudyModelAssets $model */
Expand Down Expand Up @@ -146,8 +146,8 @@ public function clear()
// Check for request forgeries.
JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));

$cache = new JCache(array('defaultgroup' => 'com_biblestudy'));
$cache->clean();
JBSMHelper::clearcache('admin');
JBSMHelper::clearcache('site');
$session = JFactory::getSession();
$session->set('assat_stack', '', 'JBSM');
$app = JFactory::getApplication();
Expand Down
8 changes: 4 additions & 4 deletions com_biblestudy/admin/controllers/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public function browse()

if (empty($stack))
{
$cache = new JCache(array('defaultgroup' => 'com_biblestudy'));
$cache->clean();
JBSMHelper::clearcache('site');
JBSMHelper::clearcache('admin');
$session->set('migration_stack', '', 'JBSM');

/** @var BibleStudyModelInstall $model */
Expand All @@ -119,8 +119,8 @@ public function browse()
*/
public function clear()
{
$cache = new JCache(array('defaultgroup' => 'com_biblestudy'));
$cache->clean();
JBSMHelper::clearcache('site');
JBSMHelper::clearcache('admin');
$session = JFactory::getSession();
$session->set('migration_stack', '', 'JBSM');
$this->browse();
Expand Down
36 changes: 36 additions & 0 deletions com_biblestudy/admin/helpers/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,40 @@ public static function MediaBuildUrl ($spath, $path, $params, $setProtical = fal

return $path;
}

/**
* Clear Cache of JBSM
*
* @param string $state Where to clean the cache from. Site or Admin.
*
* @since 9.0.4
* @return void
*/
public static function clearcache($state = 'site')
{
$conf = JFactory::getConfig();
$options = array();

if ($state == 'admin')
{
$options = array(
'defaultgroup' => 'com_biblestudy',
'storage' => $conf->get('cache_handler', ''),
'caching' => true,
'cachebase' => $conf->get('cache_path', JPATH_ADMINISTRATOR . '/cache')
);
}
elseif ($state == 'site')
{
$options = array(
'defaultgroup' => 'com_biblestudy',
'storage' => $conf->get('cache_handler', ''),
'caching' => true,
'cachebase' => $conf->get('cache_path', JPATH_SITE . '/cache')
);
}

$cache = JCache::getInstance('', $options);
$cache->clean();
}
}
2 changes: 2 additions & 0 deletions com_biblestudy/admin/models/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public function getForm($data = array(), $loadData = true)
*/
public function save($data)
{
$this->cleanCache();

if (parent::save($data))
{
return true;
Expand Down
2 changes: 2 additions & 0 deletions com_biblestudy/admin/models/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ public function save($data)
$params = JBSMParams::getAdmin()->params;
$input = JFactory::getApplication()->input;

$this->cleanCache();

if ($input->get('a_id'))
{
$data['id'] = $input->get('a_id');
Expand Down
105 changes: 24 additions & 81 deletions com_biblestudy/admin/views/comments/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
$trashed = $this->state->get('filter.published') == -2 ? true : false;
$saveOrder = $listOrder == 'ordering';
$sortFields = $this->getSortFields();
$columns = 9;

JFactory::getDocument()->addScriptDeclaration('
Joomla.orderTable = function()
{
Expand Down Expand Up @@ -62,60 +64,11 @@
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search"
class="element-invisible"><?php echo JText::_('JBS_CMN_FILTER_SEARCH_DESC'); ?></label>
<input type="text" name="filter_search"
placeholder="<?php echo JText::_('JBS_CMN_FILTER_SEARCH_DESC'); ?>"
id="filter_search"
value="<?php echo $this->escape($this->state->get('filter.search')); ?>"
title="<?php echo JText::_('JBS_CMN_FILTER_SEARCH_DESC'); ?>"/>
</div>
<div class="btn-group pull-left hidden-phone">
<button class="btn tip hasTooltip" type="submit"
title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i
class="icon-search"></i></button>
<button class="btn tip hasTooltip" type="button"
onclick="document.id('filter_search').value='';this.form.submit();"
title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>"><i class="icon-remove"></i>
</button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit"
class="element-invisible"><?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable"
class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC'); ?></label>
<select name="directionTable" id="directionTable" class="input-medium"
onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC'); ?></option>
<option
value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JBS_CMN_ASCENDING'); ?></option>
<option
value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JBS_CMN_DESCENDING'); ?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable"
class="element-invisible"><?php echo JText::_('JBS_CMN_SELECT_BY'); ?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JBS_CMN_SELECT_BY'); ?></option>
<?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder); ?>
</select>
</div>
</div>
<div class="clearfix"></div>

<table class="table table-striped adminlist" id="comments">
<thead>
<tr>
<th width="1%" class="hidden-phone">
<input type="checkbox" name="checkall-toggle" value=""
title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>"
onclick="Joomla.checkAll(this)"/>
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th width="1%" style="min-width:55px;" class="nowrap center">
<?php echo JHtml::_('grid.sort', 'JBS_CMN_PUBLISHED', 'comment.published', $listDirn, $listOrder); ?>
Expand Down Expand Up @@ -143,6 +96,12 @@ class="element-invisible"><?php echo JText::_('JBS_CMN_SELECT_BY'); ?></label>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php echo $columns; ?>">
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
Expand All @@ -158,47 +117,31 @@ class="element-invisible"><?php echo JText::_('JBS_CMN_SELECT_BY'); ?></label>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'comments.', $canChange, 'cb', '', ''); ?>
<div class="btn-group">
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'comments.', $canChange, 'cb', '', ''); ?><?php

// Create dropdown items
$action = $archived ? 'unarchive' : 'archive';
JHtml::_('actionsdropdown.' . $action, 'cb' . $i, 'messages');

$action = $trashed ? 'untrash' : 'trash';
JHtml::_('actionsdropdown.' . $action, 'cb' . $i, 'messages');

// Render dropdown list
echo JHtml::_('actionsdropdown.render', $this->escape($item->studytitle));
?>
</div>
</td>

<td class="nowrap has-context" style="width:10%;">
<div class="pull-left">
<?php if ($canEdit || $canEditOwn) : ?>
<a href="<?php echo $link; ?>"><?php echo $this->escape($item->studytitle) . ' - '
. JText::_($item->bookname) . ' ' . $item->chapter_begin; ?></a>
. JText::_($item->bookname) . ' ' . $item->chapter_begin; ?></a>
<?php else : ?>
<?php echo $this->escape($item->studytitle) . ' - ' . JText::_($item->bookname) . ' ' . $item->chapter_begin; ?>
<?php endif; ?>
</div>
<div class="pull-left">
<?php
// Create dropdown items
JHtml::_('dropdown.edit', $item->id, 'comment.');
JHtml::_('dropdown.divider');
if ($item->published) :
JHtml::_('dropdown.unpublish', 'cb' . $i, 'comments.');
else :
JHtml::_('dropdown.publish', 'cb' . $i, 'comments.');
endif;

JHtml::_('dropdown.divider');

if ($archived) :
JHtml::_('dropdown.unarchive', 'cb' . $i, 'comments.');
else :
JHtml::_('dropdown.archive', 'cb' . $i, 'comments.');
endif;

if ($trashed) :
JHtml::_('dropdown.untrash', 'cb' . $i, 'comments.');
else :
JHtml::_('dropdown.trash', 'cb' . $i, 'comments.');
endif;

// Render dropdown list
echo JHtml::_('dropdown.render');
?>
</div>
</td>
<td class="small hidden-phone">
<?php echo $this->escape($item->access_level); ?>
Expand Down
10 changes: 0 additions & 10 deletions com_biblestudy/admin/views/comments/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,6 @@ protected function addToolbar()
}

JHtmlSidebar::setAction('index.php?option=com_biblestudy&view=comments');

JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);

JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'), 'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
}

/**
Expand Down
9 changes: 8 additions & 1 deletion com_biblestudy/admin/views/locations/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$archived = $this->state->get('filter.published') == 2 ? true : false;
$trashed = $this->state->get('filter.published') == -2 ? true : false;
$saveOrder = $listOrder == 'location.ordering';
$columns = 5;

if ($saveOrder)
{
Expand Down Expand Up @@ -70,6 +71,12 @@
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php echo $columns; ?>">
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
Expand Down Expand Up @@ -97,7 +104,7 @@
<?php echo $this->escape($item->location_text); ?></a>
<?php else : ?>
<span
title="<?php echo JText::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->location_text)); ?>"><?php echo $this->escape($item->location_text); ?></span>
title="<?php echo JText::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->location_text)); ?>"><?php echo $this->escape($item->location_text); ?></span>
<?php endif; ?>
</div>
<div class="pull-left">
Expand Down
Loading

0 comments on commit ff678d6

Please sign in to comment.