Skip to content

Commit

Permalink
Merge pull request #698 from Joomla-Bible-Study/development
Browse files Browse the repository at this point in the history
9.0.5 fixes
  • Loading branch information
bcordis authored Sep 22, 2016
2 parents fa37394 + 9c9d17a commit 84b4c85
Show file tree
Hide file tree
Showing 40 changed files with 496 additions and 503 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.5</td>
<td align="center">9.0.6</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.4</td>
<td align="center">September 4, 2016</td>
<td align="center">9.0.5</td>
<td align="center">September 22, 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.
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.4</version>
<creationDate>September 4, 2016</creationDate>
<version>9.0.5</version>
<creationDate>September 22, 2016</creationDate>
<license>http://www.gnu.org/licenses/gpl.html</license>
<packager>Tom Fuller</packager>
<packagerurl>http://www.joomlabiblestudy.org</packagerurl>
Expand Down
2 changes: 1 addition & 1 deletion com_biblestudy/admin/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
define('JBSM_PROFILER', 0);

// Version information
define('BIBLESTUDY_VERSION', '9.0.4');
define('BIBLESTUDY_VERSION', '9.0.5');
define('BIBLESTUDY_VERSION_UPDATEFILE', 'JBS Version ' . BIBLESTUDY_VERSION);

// Default values
Expand Down
23 changes: 17 additions & 6 deletions com_biblestudy/admin/helpers/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ public static function getRemoteFileSize($url)
*
* @param string $spath Server Path
* @param string $path File
* @param Registry $params Paramitors.
* @param bool $setProtical True add protical els no
* @param Registry $params Parameters.
* @param bool $setProtocol True add protocol els no
*
* @return string Completed path.
*
* @since 9.0.3
*/
public static function MediaBuildUrl ($spath, $path, $params, $setProtical = false)
public static function MediaBuildUrl ($spath, $path, $params, $setProtocol = false)
{
$spath = rtrim($spath, '/');
$path = ltrim($path, '/');
Expand All @@ -171,15 +171,26 @@ public static function MediaBuildUrl ($spath, $path, $params, $setProtical = fal
&& !substr_count($path, '://')
&& !substr_count($path, '//'))
{
$path = ltrim($path, '/');
// $path = ltrim($path, '/');
}

if (!substr_count($path, '://') && !substr_count($path, '//') && $setProtical)
if (!substr_count($path, '://') && !substr_count($path, '//') && $setProtocol)
{
if (empty($spath))
{
$spath = JUri::base();

return $spath . $path;
}
elseif (substr_count($spath, '://') || substr_count($spath, '//') && !empty($spath))
{
return $spath . '/' . $path;
}

$protocol = $params->get('protocol', '//');
$path = $protocol . $spath . '/' . $path;
}
elseif (!substr_count($path, '://'))
elseif (!substr_count($spath, '://') && !substr_count($spath, '//') && !empty($spath))
{
$path = $spath . '/' . $path;
}
Expand Down
27 changes: 4 additions & 23 deletions com_biblestudy/admin/helpers/html/jwplayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,7 @@ public static function render($media, $params, $popup = false, $player = null, $
$media->playerheight = $params->get('player_hight');
}

// Check to see if file name is for youtube and helps with old converted file names.
if (!isset($media->path1))
{
$media->path1 = $media->sparams->get('path') . $params->get('filename');

if (!substr_count($media->path1, '://') && !substr_count($media->path1, '//'))
{
$protocol = $params->get('protocol', 'http://');
$media->path1 = $protocol . $media->path1;
}
}
elseif (strpos($media->path1, 'youtube.com') !== false)
{
$media->path1 = 'https://' . strstr($media->path1, 'youtube.com');
}
elseif (strpos($media->path1, 'youtu.be') !== false)
{
$media->path1 = 'https://' . strstr($media->path1, 'youtu.be');
}
$media->path1 = JBSMHelper::MediaBuildUrl($media->sparams->get('path'), $params->get('filename'), $params, true);

// Fall back check to see if JWplayer can play the media. if not will try and return a link to the file.
$acceptedFormats = array('aac', 'm4a', 'f4a', 'mp3', 'ogg', 'oga', 'mp4', 'm4v', 'f4v', 'mov', 'flv', 'webm', 'm3u8', 'mpd', 'DVR');
Expand All @@ -121,13 +103,12 @@ public static function render($media, $params, $popup = false, $player = null, $
}

$media->playerwidth = $params->get('player_width');
$media->playerheight = $params->get('player_height');

if ($params->get('playerheight') < 55 && $params->get('playerheight'))
if ($params->get('playerheight') < 55 && $params->get('playerheight') && !isset($player->mp3))
{
$media->playerheight = 55;
}
elseif ($params->get('playerheight'))
elseif ($params->get('playerheight') && !isset($player->mp3))
{
$media->playerheight = $params->get('playerheight');
}
Expand Down Expand Up @@ -216,7 +197,7 @@ public static function render($media, $params, $popup = false, $player = null, $
'file': '" . $media->path1 . "',
";

if ($params->get('playerresponsive') == 0)
if ($params->get('playerresponsive') == 0 && $media->playerheight)
{
$render .= "'height': '" . $media->playerheight . "',
";
Expand Down
14 changes: 1 addition & 13 deletions com_biblestudy/admin/install/sql/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,7 @@ CREATE TABLE `#__bsms_update` (

INSERT INTO `#__bsms_update` (`id`, `version`)
VALUES
(7, '7.0.0'),
(8, '7.0.1'),
(9, '7.0.1.1'),
(10, '7.0.2'),
(11, '7.0.3'),
(12, '7.0.4'),
(13, '7.1.0'),
(14, '7.1.1'),
(15, '7.1.2'),
(16, '7.1.3'),
(17, '8.0.0'),
(18, '8.0.8'),
(19, '9.0.0');
(1, '9.0.5');

-- --------------------------------------------------------

Expand Down
1 change: 0 additions & 1 deletion com_biblestudy/admin/install/sql/uninstall-dbtables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ DROP TABLE IF EXISTS `#__bsms_update`;
DROP TABLE IF EXISTS `#__bsms_share`;
DROP TABLE IF EXISTS `#__bsms_storage`;
DROP TABLE IF EXISTS `#__bsms_styles`;

2 changes: 2 additions & 0 deletions com_biblestudy/admin/install/sql/updates/mysql/9.0.5.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO `#__bsms_update` (id, version) VALUES ('21', '9.0.5')
ON DUPLICATE KEY UPDATE version = '9.0.5';
3 changes: 2 additions & 1 deletion com_biblestudy/admin/language/en-GB/en-GB.com_biblestudy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ JBS_CMN_DURATION="Duration"
JBS_CMN_EDIT="Edit"
JBS_CMN_EDIT_MEDIA_FILE="Edit Media File"
JBS_CMN_EMBED_CODE="Embed Code"
JBS_CMN_ERROR_ADDON_LANGUAGE_NOT_LOADED="Addon language could not be loaded"
JBS_CMN_ERROR_ADDON_LANGUAGE_NOT_LOADED="Addon language could not be loaded or Default Server Not Set"
JBS_CMN_ERROR_RESETTING_DOWNLOADS="An error occured while resetting the downloads:"
JBS_CMN_ERROR_RESETTING_HITS="An error occured while resetting the hits:"
JBS_CMN_ERROR_RESETTING_PLAYS="An error occured while resetting the plays:"
Expand Down Expand Up @@ -261,6 +261,7 @@ JBS_CMN_MONTHS="Months"
JBS_CMN_DAYS="Days"
JBS_CMN_YEARS_ORDERING="Years Ordering"
JBS_CMN_YES="Yes"
JBS_CMN_POPOUT="Pop Out"

;; ADM Administrator
JBS_ADM_ADDTHIS_SHARE="AddThis Sharing"
Expand Down
50 changes: 33 additions & 17 deletions com_biblestudy/admin/models/mediafile.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BiblestudyModelMediafile extends JModelAdmin
/**
* Data
*
* @var
* @var TableMediafile
* @since 9.0.0
*/
private $data;
Expand Down Expand Up @@ -74,13 +74,16 @@ public function move($direction)
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return TableMediafile A database object
* @return TableMediafile A database object
*
* @since 7.0.0
*/
public function getTable($type = 'Mediafile', $prefix = 'Table', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
/** @var TableMediafile $table */
$table = JTable::getInstance($type, $prefix, $config);

return $table;
}

/**
Expand Down Expand Up @@ -127,7 +130,7 @@ public function save($data)

if ($table->type == 'legacy' || $table->type == 'local')
{
$params->set('size', JBSMHelper::getRemoteFileSize($path->get('protocol') . $set_path . $params->get('filename')));
$params->set('size', JBSMHelper::getRemoteFileSize(JBSMHelper::MediaBuildUrl($set_path, $params->get('filename'), $params, true)));
$data['params'] = $params->toArray();
}
}
Expand Down Expand Up @@ -163,14 +166,17 @@ public function getMediaForm()
/** @var Joomla\Registry\Registry $admin */
$admin = JBSMParams::getAdmin()->params;
$server_id = $admin->get('server');
$this->data->server_id = $server_id;

if (empty($server_id))
if ($server_id != '-1')
{
$this->data->server_id = $server_id;
}
else
{
// @TODO This may not be optimal, seems like a hack
return new JForm("No Default Server");
$server_id = null;
}
}

// Reverse lookup server_id to server type
/** @type BiblestudyModelServer $model */
$model = JModelLegacy::getInstance('Server', 'BibleStudyModel');
Expand All @@ -184,21 +190,29 @@ public function getMediaForm()
$reg1->loadArray($s_item->media);
$reg1->merge($reg);

$path = JPath::clean(JPATH_ADMINISTRATOR . '/components/com_biblestudy/addons/servers/' . $server_type);
if ($server_type)
{
$path = JPath::clean(JPATH_ADMINISTRATOR . '/components/com_biblestudy/addons/servers/' . $server_type);

JForm::addFormPath($path);
JForm::addFieldPath($path . '/fields');

JForm::addFormPath($path);
JForm::addFieldPath($path . '/fields');
// Add language files
$lang = JFactory::getLanguage();

// Add language files
$lang = JFactory::getLanguage();
if (!$lang->load('jbs_addon_' . $server_type, JPATH_ADMINISTRATOR . '/components/com_biblestudy/addons/servers/' . $server_type) && !$server_type)
{
JFactory::getApplication()->enqueueMessage(JText::_('JBS_CMN_ERROR_ADDON_LANGUAGE_NOT_LOADED'), 'error');
}

if (!$lang->load('jbs_addon_' . $server_type, JPATH_ADMINISTRATOR . '/components/com_biblestudy/addons/servers/' . $server_type))
$form = $this->loadForm('com_biblestudy.mediafile.media', "media", array('control' => 'jform', 'load_data' => true), true, "/media");
}
else
{
throw new Exception(JText::_('JBS_CMN_ERROR_ADDON_LANGUAGE_NOT_LOADED'));
JFactory::getApplication()->enqueueMessage(JText::_('JBS_CMN_ERROR_ADDON_LANGUAGE_NOT_LOADED'), 'warning');
$form = $this->getForm();
}

$form = $this->loadForm('com_biblestudy.mediafile.media', "media", array('control' => 'jform', 'load_data' => true), true, "/media");

if (empty($form))
{
return false;
Expand Down Expand Up @@ -477,6 +491,8 @@ protected function batchPlayer($value, $pks, $contexts)
* @param integer $client_id The ID of the client
*
* @return void
*
* @since 7.0.0
*/
protected function cleanCache($group = null, $client_id = 0)
{
Expand Down
4 changes: 2 additions & 2 deletions com_biblestudy/biblestudy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,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.4</version>
<creationDate>September 4, 2016</creationDate>
<version>9.0.5</version>
<creationDate>September 22, 2016</creationDate>
<license>http://www.gnu.org/licenses/gpl.html</license>
<description>JBS_INS_XML_DESCRIPTION</description>

Expand Down
62 changes: 31 additions & 31 deletions com_biblestudy/media/js/assat.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
*/
function assetinstall(event) {

var mySlideInstall = new Fx.Slide('assetinstall');
mySlideInstall.hide();
$('assetinstall').setStyle('display', 'block');
mySlideInstall.toggle();
var mySlideInstall = new Fx.Slide('assetinstall');
mySlideInstall.hide();
$('assetinstall').setStyle('display', 'block');
mySlideInstall.toggle();

var pb3 = new dwProgressBar({
container: $('pb3'),
startPercentage: 2,
speed: 1000,
boxID: 'pb3-box',
percentageID: 'pb3-perc',
displayID: 'text',
displayText: false
});
var pb3 = new dwProgressBar({
container: $('pb3'),
startPercentage: 2,
speed: 1000,
boxID: 'pb3-box',
percentageID: 'pb3-perc',
displayID: 'text',
displayText: false
});

var d = new Ajax('components/com_biblestudy/install/biblestudy.assets.php', {
method: 'get',
noCache: true,
onComplete: function (response) {
pb3.set(100);
pb3.finish();
done();
}
}).request();
var d = new Ajax('components/com_biblestudy/install/biblestudy.assets.php', {
method: 'get',
noCache: true,
onComplete: function (response) {
pb3.set(100);
pb3.finish();
done();
}
}).request();

}

Expand All @@ -41,14 +41,14 @@ function assetinstall(event) {
*/
function done(event) {

var d = new Ajax('components/com_biblestudy/install/done.php', {
method: 'get',
onComplete: function (response) {
var mySlideDone = new Fx.Slide('done');
mySlideDone.hide();
$('done').setStyle('display', 'block');
mySlideDone.toggle();
}
}).request();
var d = new Ajax('components/com_biblestudy/install/done.php', {
method: 'get',
onComplete: function (response) {
var mySlideDone = new Fx.Slide('done');
mySlideDone.hide();
$('done').setStyle('display', 'block');
mySlideDone.toggle();
}
}).request();

}
Loading

0 comments on commit 84b4c85

Please sign in to comment.