Skip to content

Commit

Permalink
Merge pull request #702 from Joomla-Bible-Study/development
Browse files Browse the repository at this point in the history
v9.0.6 from Dev
  • Loading branch information
bcordis authored Nov 8, 2016
2 parents 84b4c85 + a8dc727 commit 6d07500
Show file tree
Hide file tree
Showing 627 changed files with 22,170 additions and 14,585 deletions.
674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

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.6</td>
<td align="center">9.0.7</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.5</td>
<td align="center">September 22, 2016</td>
<td align="center">9.0.6</td>
<td align="center">November 8, 2016</td>
<td align="center">3.4+</td>
</tr>
</table>
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.5</version>
<creationDate>September 22, 2016</creationDate>
<version>9.0.6</version>
<creationDate>Noveber 8, 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: 2 additions & 1 deletion com_biblestudy/admin/addons/servers/legacy/legacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public function upload($data)
preg_match('/\/+.+/', $path, $matches);

// Make filename safe and move it to correct folder
$destFile = JApplicationHelper::stringURLSafe($_FILES["file"]["name"]);
$destFile = JFile::makeSafe($_FILES["file"]["name"]);
$destFile = str_replace(' ', '_', $destFile);

if (!JFile::upload($_FILES['file']['tmp_name'], JPATH_ROOT . $matches[0] . $destFile))
{
Expand Down
3 changes: 2 additions & 1 deletion com_biblestudy/admin/addons/servers/legacy/legacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
</fieldset>
<fieldset name="parameters" label="JBS_ADDON_LEGACY_PARAMETERS">
<field name="autostart" type="list"
label="JBS_CMN_MEDIA_AUTOSTART" description="JBS_CMN_MEDIA_AUTOSTART_DESC" default="1">
label="JBS_CMN_MEDIA_AUTOSTART" description="JBS_CMN_MEDIA_AUTOSTART_DESC" default="">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="1">JYES</option>
<option value="2">JNO</option>
</field>
Expand Down
3 changes: 2 additions & 1 deletion com_biblestudy/admin/addons/servers/local/local.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public function upload($data)
preg_match('/\/+.+/', $path, $matches);

// Make filename safe and move it to correct folder
$destFile = JApplicationHelper::stringURLSafe($_FILES["file"]["name"]);
$destFile = JFile::makeSafe($_FILES["file"]["name"]);
$destFile = str_replace(' ', '_', $destFile);

if (!JFile::upload($_FILES['file']['tmp_name'], JPATH_ROOT . $matches[0] . $destFile))
{
Expand Down
171 changes: 88 additions & 83 deletions com_biblestudy/admin/addons/servers/local/local.xml
Original file line number Diff line number Diff line change
@@ -1,86 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<server type="storage" supports="*.*">
<name>Local Server</name>
<description>Use the same server serving this website as a source of media.</description>
<config>
<media_resource>filename</media_resource>
</config>
<fields name="media">
<fieldset name="details" label="JBS_ADDON_LEGACY_DETAILS">
<field name="link_type" type="list" extension="com_biblestudy"
label="JBS_MED_SHOW_DOWNLOAD_ICON" description="JBS_MED_SHOW_DOWNLOAD_ICON_DESC"
class="inputbox" default="1">
<option value="0">JBS_MED_NO_DOWNLOAD_ICON</option>
<option value="1">JBS_MED_SHOW_DOWNLOAD_ICON</option>
<option value="2">JBS_MED_SHOW_ONLY_DOWNLOAD_ICON</option>
</field>
</fieldset>
<fieldset name="files_settings" label="JBS_ADDON_LEGACY_FILE_SETTINGS">
<field name="player" type="list" label="JBS_MED_PLAYER"
description="JBS_MED_PLAYER_DESC" class="inputbox" default="2">
<option value="0">JBS_CMN_DIRECT_LINK</option>
<option value="1">JBS_CMN_USE_INTERNAL_PLAYER</option>
<option value="3">JBS_CMN_USE_AV</option>
<option value="7">JBS_CMN_USE_MP3_PLAYER</option>
<option value="8">JBS_CMN_USE_EMBED_CODE</option>
</field>
<field name="popup" type="list" label="JBS_MED_INTERNAL_POPUP"
description="JBS_MED_INTERNAL_POPUP_DESC" class="inputbox"
default="3">
<option value="1">JBS_CMN_POPUP</option>
<option value="2">JBS_CMN_INLINE</option>
<option value="3">JBS_CMN_SQUEEZEBOX</option>
</field>
</fieldset>
<fieldset name="media_type" label="JBS_ADDON_LEGACY_MEDIA_TYPE">
<field name="media_image" type="media" directory="biblestudy"
label="JBS_CMN_IMAGE" description="JBS_MED_IMAGE_DESC"
class="inputbox"/>
<field name="media_use_button_icon" label="JBS_ADDON_LEGACY_MEDIA_USE_BUTTON"
description="JBS_ADDON_LEGACY_MEDIA_USE_BUTTON_DESC" class="inputbox" type="list" default="">
<option value="-1">JGLOBAL_USE_GLOBAL</option>
<option value="">JBS_MED_NONE</option>
<option value="1">JBS_MED_BUTTON_ONLY</option>
<option value="2">JBS_MED_BUTTON_AND_ICON</option>
<option value="3">JBS_MED_ICON_ONLY</option>
</field>
<field name="media_button_text" type="text" default="Audio" label="JBS_ADDON_LEGACY_BUTTON_TEXT" description="JBS_ADDON_LEGACY_BUTTON_TEXT_DESC" />
<field name="media_button_type" type="list" class="inputbox" default="" label="JBS_ADDON_LEGACY_BUTTON_TYPE"
description="JBS_ADDON_LEGACY_BUTTON_TYPE_DESC">
<option value="btn-link">JBS_MED_NO_COLOR</option>
<option value="btn-primary">JBS_MED_PRIMARY</option>
<option value="btn-success">JBS_MED_SUCCESS</option>
<option value="btn-info">JBS_MED_INFO</option>
<option value="btn-warning">JBS_MED_WARNING</option>
<option value="btn-danger">JBS_MED_DANGER</option>
</field>
<field name="media_button_color" type="color" description="JBS_ADDON_LEGACY_BUTTON_COLOR_DESC" label="JBS_ADDON_LEGACY_BUTTON_COLOR"/>
<field name="media_icon_type" type="list" class="inputbox" default="" label="JBS_ADDON_LEGACY_ICON_TYPE"
description="JBS_ADDON_LEGACY_ICON_TYPE_DESC">
<option value="fa fa-play">JBS_MED_PLAY</option>
<option value="fa fa-youtube">JBS_MED_YOUTUBE</option>
<option value="fa fa-video-camera">JBS_MED_VIDEO</option>
<option value="fa fa-television">JBS_MED_BROADCAST</option>
<option value="fa fa-file">JBS_MED_FILE</option>
<option value="fa fa-vimeo">JBS_MED_VIMEO</option>
<option value="1">JBS_MED_CUSTOM</option>
</field>
<field name="media_custom_icon" type="text" default="" label="JBS_ADDON_LEGACY_CUSTOM_ICON" description="JBS_ADDON_LEGACY_CUSTOM_ICON_DESC" />
<field name="media_icon_text_size" type="text" default="24" label="JBS_ADDON_LEGACY_FONT_SIZE" description="JBS_ADDON_LEGACY_FONT_SIZE_DESC" />
<field name="mime_type" type="mimetype" extension="com_biblestudy"
label="JBS_MED_CHOOSE_MIMETYPE" description="JBS_MED_CHOOSE_MIMETYPE_DESC"
class="inputbox" default="">
</field>
<field name="mime_type" type="mimetype" extension="com_biblestudy"
label="JBS_MED_CHOOSE_MIMETYPE" description="JBS_MED_CHOOSE_MIMETYPE_DESC"
class="inputbox"/>
</fieldset>
<fieldset name="parameters" label="JBS_ADDON_LEGACY_PARAMETERS">
<field name="autostart" type="list"
label="JBS_CMN_MEDIA_AUTOSTART" description="JBS_CMN_MEDIA_AUTOSTART_DESC" default="1">
<option value="1">JYES</option>
<option value="2">JNO</option>
</field>
</fieldset>
</fields>
<name>Local Server</name>
<description>Use the same server serving this website as a source of media.</description>
<config>
<media_resource>filename</media_resource>
</config>
<fields name="media">
<fieldset name="details" label="JBS_ADDON_LEGACY_DETAILS">
<field name="link_type" type="list" extension="com_biblestudy"
label="JBS_MED_SHOW_DOWNLOAD_ICON" description="JBS_MED_SHOW_DOWNLOAD_ICON_DESC"
class="inputbox" default="1">
<option value="0">JBS_MED_NO_DOWNLOAD_ICON</option>
<option value="1">JBS_MED_SHOW_DOWNLOAD_ICON</option>
<option value="2">JBS_MED_SHOW_ONLY_DOWNLOAD_ICON</option>
</field>
</fieldset>
<fieldset name="files_settings" label="JBS_ADDON_LEGACY_FILE_SETTINGS">
<field name="player" type="list" label="JBS_MED_PLAYER"
description="JBS_MED_PLAYER_DESC" class="inputbox" default="2">
<option value="0">JBS_CMN_DIRECT_LINK</option>
<option value="1">JBS_CMN_USE_INTERNAL_PLAYER</option>
<option value="3">JBS_CMN_USE_AV</option>
<option value="7">JBS_CMN_USE_MP3_PLAYER</option>
<option value="8">JBS_CMN_USE_EMBED_CODE</option>
</field>
<field name="popup" type="list" label="JBS_MED_INTERNAL_POPUP"
description="JBS_MED_INTERNAL_POPUP_DESC" class="inputbox"
default="3">
<option value="1">JBS_CMN_POPUP</option>
<option value="2">JBS_CMN_INLINE</option>
<option value="3">JBS_CMN_SQUEEZEBOX</option>
</field>
</fieldset>
<fieldset name="media_type" label="JBS_ADDON_LEGACY_MEDIA_TYPE">
<field name="media_image" type="media" directory="biblestudy"
label="JBS_CMN_IMAGE" description="JBS_MED_IMAGE_DESC"
class="inputbox"/>
<field name="media_use_button_icon" label="JBS_ADDON_LEGACY_MEDIA_USE_BUTTON"
description="JBS_ADDON_LEGACY_MEDIA_USE_BUTTON_DESC" class="inputbox" type="list" default="">
<option value="-1">JGLOBAL_USE_GLOBAL</option>
<option value="">JBS_MED_NONE</option>
<option value="1">JBS_MED_BUTTON_ONLY</option>
<option value="2">JBS_MED_BUTTON_AND_ICON</option>
<option value="3">JBS_MED_ICON_ONLY</option>
</field>
<field name="media_button_text" type="text" default="Audio" label="JBS_ADDON_LEGACY_BUTTON_TEXT"
description="JBS_ADDON_LEGACY_BUTTON_TEXT_DESC"/>
<field name="media_button_type" type="list" class="inputbox" default="" label="JBS_ADDON_LEGACY_BUTTON_TYPE"
description="JBS_ADDON_LEGACY_BUTTON_TYPE_DESC">
<option value="btn-link">JBS_MED_NO_COLOR</option>
<option value="btn-primary">JBS_MED_PRIMARY</option>
<option value="btn-success">JBS_MED_SUCCESS</option>
<option value="btn-info">JBS_MED_INFO</option>
<option value="btn-warning">JBS_MED_WARNING</option>
<option value="btn-danger">JBS_MED_DANGER</option>
</field>
<field name="media_button_color" type="color" description="JBS_ADDON_LEGACY_BUTTON_COLOR_DESC"
label="JBS_ADDON_LEGACY_BUTTON_COLOR"/>
<field name="media_icon_type" type="list" class="inputbox" default="" label="JBS_ADDON_LEGACY_ICON_TYPE"
description="JBS_ADDON_LEGACY_ICON_TYPE_DESC">
<option value="fa fa-play">JBS_MED_PLAY</option>
<option value="fa fa-youtube">JBS_MED_YOUTUBE</option>
<option value="fa fa-video-camera">JBS_MED_VIDEO</option>
<option value="fa fa-television">JBS_MED_BROADCAST</option>
<option value="fa fa-file">JBS_MED_FILE</option>
<option value="fa fa-vimeo">JBS_MED_VIMEO</option>
<option value="1">JBS_MED_CUSTOM</option>
</field>
<field name="media_custom_icon" type="text" default="" label="JBS_ADDON_LEGACY_CUSTOM_ICON"
description="JBS_ADDON_LEGACY_CUSTOM_ICON_DESC"/>
<field name="media_icon_text_size" type="text" default="24" label="JBS_ADDON_LEGACY_FONT_SIZE"
description="JBS_ADDON_LEGACY_FONT_SIZE_DESC"/>
<field name="mime_type" type="mimetype" extension="com_biblestudy"
label="JBS_MED_CHOOSE_MIMETYPE" description="JBS_MED_CHOOSE_MIMETYPE_DESC"
class="inputbox" default="">
</field>
<field name="mime_type" type="mimetype" extension="com_biblestudy"
label="JBS_MED_CHOOSE_MIMETYPE" description="JBS_MED_CHOOSE_MIMETYPE_DESC"
class="inputbox"/>
</fieldset>
<fieldset name="parameters" label="JBS_ADDON_LEGACY_PARAMETERS">
<field name="autostart" type="list"
label="JBS_CMN_MEDIA_AUTOSTART" description="JBS_CMN_MEDIA_AUTOSTART_DESC" default="">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="1">JYES</option>
<option value="2">JNO</option>
</field>
</fieldset>
</fields>
</server>
3 changes: 2 additions & 1 deletion com_biblestudy/admin/addons/servers/youtube/youtube.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
</fieldset>
<fieldset name="parameters" label="JBS_ADDON_LEGACY_PARAMETERS">
<field name="autostart" type="list"
label="JBS_CMN_MEDIA_AUTOSTART" description="JBS_CMN_MEDIA_AUTOSTART_DESC" default="1">
label="JBS_CMN_MEDIA_AUTOSTART" description="JBS_CMN_MEDIA_AUTOSTART_DESC" default="0">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="1">JYES</option>
<option value="2">JNO</option>
</field>
Expand Down
8 changes: 5 additions & 3 deletions 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.5');
define('BIBLESTUDY_VERSION', '9.0.6');
define('BIBLESTUDY_VERSION_UPDATEFILE', 'JBS Version ' . BIBLESTUDY_VERSION);

// Default values
Expand Down Expand Up @@ -64,7 +64,7 @@
define('BIBLESTUDY_PATH_MOD', BIBLESTUDY_ROOT_PATH . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'mod_biblestudy');

// Minimum version requirements
define('BIBLESTUDY_MIN_PHP', '5.3.10');
define('BIBLESTUDY_MIN_PHP', '5.4.0');
define('BIBLESTUDY_MIN_MYSQL', '5.1');

// Time related
Expand All @@ -84,12 +84,14 @@
JLoader::discover('Table', BIBLESTUDY_PATH_ADMIN_TABLES, 'false', 'true');
JHtml::addIncludePath(BIBLESTUDY_PATH_ADMIN_HELPERS . '/html/');

// Fixes Router overrider.
JLoader::register('JBSMHelperRoute', BIBLESTUDY_PATH_HELPERS . '/route.php', true);

// If phrase is not found in specific language file, load english language file:
$language = JFactory::getLanguage();
$language->load('com_biblestudy', BIBLESTUDY_PATH_ADMIN, 'en-GB', true);
$language->load('com_biblestudy', BIBLESTUDY_PATH_ADMIN, null, true);


// Component debugging
if (JBSMBibleStudyHelper::debug() === '1' || JFactory::getApplication()->input->getInt('jbsmdbg', '0') === '1')
{
Expand Down
38 changes: 22 additions & 16 deletions com_biblestudy/admin/helpers/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,46 +149,52 @@ public static function getRemoteFileSize($url)
}

/**
* Media Build URL Fix up for '/' and protical.
* Media Build URL Fix up for '/' and protocol.
*
* @param string $spath Server Path
* @param string $path File
* @param Registry $params Parameters.
* @param bool $setProtocol True add protocol els no
* @param bool $local Local server
*
* @return string Completed path.
*
* @since 9.0.3
*/
public static function MediaBuildUrl ($spath, $path, $params, $setProtocol = false)
public static function MediaBuildUrl($spath, $path, $params, $setProtocol = false, $local = false)
{
$spath = rtrim($spath, '/');
$path = ltrim($path, '/');

// Check to make sure a '/' is not in the start of the path.
if (!JBSMBibleStudyHelper::endsWith($spath, '/')
&& !JBSMBibleStudyHelper::startsWith($path, '/')
&& !substr_count($path, '://')
&& !substr_count($path, '//'))
$spath = rtrim($spath, '/');
$path = ltrim($path, '/');
$host = $_SERVER['HTTP_HOST'];
$protocol = JUri::root();

// To see if the server is local
if (strpos($spath, $host) !== false)
{
// $path = ltrim($path, '/');
$local = true;
}

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

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

$protocol = $params->get('protocol', '//');
$path = $protocol . $spath . '/' . $path;
// Set Protocol based on server status
if (!$local)
{
$protocol = $params->get('protocol', '//');
$path = $protocol . $spath . '/' . $path;
}
else
{
$path = $protocol . $path;
}
}
elseif (!substr_count($spath, '://') && !substr_count($spath, '//') && !empty($spath))
{
Expand Down
2 changes: 0 additions & 2 deletions com_biblestudy/admin/install/sql/updates/mysql/9.0.5.sql

This file was deleted.

2 changes: 2 additions & 0 deletions com_biblestudy/admin/install/sql/updates/mysql/9.0.6.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.6')
ON DUPLICATE KEY UPDATE version = '9.0.6';
5 changes: 2 additions & 3 deletions com_biblestudy/admin/models/mediafile.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function save($data)

if ($table->type == 'legacy' || $table->type == 'local')
{
$params->set('size', JBSMHelper::getRemoteFileSize(JBSMHelper::MediaBuildUrl($set_path, $params->get('filename'), $params, true)));
$params->set('size', JBSMHelper::getRemoteFileSize(JBSMHelper::MediaBuildUrl($set_path, $params->get('filename'), $params, true, true)));
$data['params'] = $params->toArray();
}
}
Expand Down Expand Up @@ -249,7 +249,6 @@ public function getForm($data = array(), $loadData = true)
return false;
}

// @TODO Maybe this needs to be removed from here? (Separation of concerns)
$jinput = JFactory::getApplication()->input;

// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
Expand Down Expand Up @@ -316,7 +315,7 @@ public function getItem($pk = null)

if (!empty($this->data))
{
// Make Podcast Id to be array for view
// Make PodCast Id to be array for view
if (!empty($this->data->podcast_id))
{
$this->data->podcast_id = explode(',', $this->data->podcast_id);
Expand Down
4 changes: 2 additions & 2 deletions com_biblestudy/admin/models/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ public function getMediaFiles()
$db = $this->getDbo();
$query = $db->getQuery(true);

$query->select('m.id, m.language, m.createdate, m.params');
$query->select('m.id, m.language, m.published, m.createdate, m.params');
$query->from('#__bsms_mediafiles AS m');
$query->where('m.study_id = ' . (int) $this->getItem()->id);
$query->where('published =' . 1);
$query->where('m.published = 0 OR m.published = 1');
$query->order('m.createdate DESC');

// Join over the asset groups.
Expand Down
Loading

0 comments on commit 6d07500

Please sign in to comment.