Skip to content

Commit

Permalink
Added support for optional file include titles
Browse files Browse the repository at this point in the history
  • Loading branch information
aaslun committed Nov 12, 2014
1 parent fa1073d commit 2e1fa16
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion arlima.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: https://github.com/victorjonsson/Arlima
Description: Manage the order of posts on your front page, or any page you want. This is a plugin suitable for online newspapers that's in need of a fully customizable front page.
Author: VK (<a href="http://twitter.com/chredd">@chredd</a>, <a href="http://twitter.com/znoid">@znoid</a>, <a href="http://twitter.com/victor_jonsson">@victor_jonsson</a>, <a href="http://twitter.com/lefalque">@lefalque</a>)
Version: 3.0.beta.59
Version: 3.0.beta.60
License: GPL2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
Expand Down
2 changes: 1 addition & 1 deletion constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
or define('ARLIMA_COMPILE_LESS_IN_BROWSER', ARLIMA_DEV_MODE);

// Plugin version (only edit this via grunt!)
define('ARLIMA_FILE_VERSION', '3.0.beta.59' .(ARLIMA_DEV_MODE ? '__'.time():''));
define('ARLIMA_FILE_VERSION', '3.0.beta.60' .(ARLIMA_DEV_MODE ? '__'.time():''));

// Which type of tag to use for images in Arlima RSS feeds
defined('ARLIMA_RSS_IMG_TAG')
Expand Down
4 changes: 2 additions & 2 deletions js/arlima/arlima.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions js/arlima/dev/ArlimaFileIncludes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ var ArlimaFileIncludes= (function($, window, ArlimaUtils, ArlimaFormBuilder) {
this.$elem.find('.file-include').each(function(i, fileElement) {

var $file = $(fileElement),
fileArgs = $.parseJSON($file.attr('data-args'));
fileArgs = $.parseJSON($file.attr('data-args')),
title = typeof($file.data('args').title !== 'undefined') ? $file.data('args').title : $file.data('label');

// Create arlima article object, monkey pathc
// Create arlima article object, monkey patch
fileElement.arlimaArticle = new ArlimaArticle({
title : $file.data('label'),
title : title,
options : {
fileInclude : $(fileElement).data('file')
}
Expand Down
1 change: 1 addition & 0 deletions pages/count-down.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
$args = arlima_file_args(array(
'title' => __('Count Down Timer'),
array(
'type' => 'date',
'property' => 'count_down_to',
Expand Down
6 changes: 3 additions & 3 deletions pages/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,14 @@
</tr>
</thead>
<tbody>
<?php foreach( $file_includes as $label => $file ): if( is_numeric($label) ) $label = basename($file); ?>
<?php foreach( $file_includes as $label => $file ): if( is_numeric($label) ) $label = basename($file); $file_args = $arlima_file_include->getFileArgs($file); ?>
<tr>
<td colspan="2">
<div class="file-include"
data-args='<?php echo json_encode($arlima_file_include->getFileArgs($file)) ?>'
data-args='<?php echo json_encode($file_args) ?>'
data-file="<?php echo $file; ?>"
data-label="<?php echo $label ?>">
<?php echo $label; ?>
<?php echo isset($file_args['title']) ? $file_args['title'] : $label; ?>
</div>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: @chredd, @znoid, @victor_jonsson, @lefalque, @aaslun
Tags: CMS, e-paper, e-magazine, magazine, newspaper, front page, wysiwyg
Requires at least: 3.8
Tested up to: 3.9.1
Stable tag: 3.0.beta.59
Stable tag: 3.0.beta.60
License: GPL2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down

1 comment on commit 2e1fa16

@aaslun
Copy link
Owner

@aaslun aaslun commented on 2e1fa16 Nov 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a suggestion on how to provide support for custom titles for a file include.
Our editors have requested easier-to-read names for the file includes in the file include container, this could be a solution. Fall backs on the default behaviour if the 'title' argument is left out.

Please sign in to comment.