This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( $this->request->query( 'fmt' ) == 'items' ) : | |
$invoices = collection( $invoices )->map( function( $invoice, $key ) use ( $columns ) { | |
// Iterated through line items, rather than invoices: | |
$lis = collection( $invoice->line_items )->map( function( $line_item, $k ) use ( $invoice, $columns ) { | |
$line = []; | |
foreach( $columns as $ckey=>$meta ) : | |
// For line item lists: | |
if( preg_match( '/line_item/i', $meta ) ) : | |
$meta = preg_replace( '/line_item\./i', '', $meta ); | |
$line[] = $line_item->{$meta}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array | |
( | |
[0] => Array | |
( | |
[0] => Array | |
( | |
[0] => 290144 | |
[1] => 01/31/17 | |
[2] => | |
[3] => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In AppController.php: | |
public function initialize() { | |
// Default title | |
$title = sprintf( | |
'%s: %s', | |
ucfirst( $this->name ), | |
$this->request->params['action'] | |
); | |
$this->set( 'title', $title ); | |
parent::initialize(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CREDIT: http://stackoverflow.com/a/25497346/5418851 | |
// Make sure all change events on autocomplete fields happen before submit: | |
$(document).on( 'submit', '#facet-search', function( e, changeDone ) { | |
changeDone = changeDone || false; | |
if( !changeDone ) { | |
e.preventDefault(); | |
$( '.ui-autocomplete' ).trigger( 'change' ); | |
$( e.currentTarget ).trigger( 'submit', true ); | |
} else { | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Generic function for opening a dialog box | |
* @var str url: the URL for the content that will be loaded into the dialog | |
* @var obj data: a data object to pass to the URL | |
* @var obj options: the Dialog "options" object | |
* @var func complete: a callable function to be performed when the content loads into the dialog | |
*/ | |
jQuery.fn.openDialog = function( url, data, options, complete ) { | |
var popup = $( "#popup" ); | |
var content = $( "#popup-content" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="popup"> | |
<div id="spinner"><?= $this->Html->image('ajax-loader.gif', ['alt' => 'Please wait...']); ?></div> | |
<div id="popup-content"> </div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function name( $post ) { | |
// Use nonce for verification | |
wp_nonce_field( plugin_basename( __FILE__ ), 'scholar_name_nonce' ); | |
$prefix = get_post_meta( $post->ID, 'scholar_prefix', true ); | |
$first = get_post_meta( $post->ID, 'scholar_first_name', true ); | |
$middle = get_post_meta( $post->ID, 'scholar_middle_name', true ); | |
$last = get_post_meta( $post->ID, 'scholar_last_name', true ); | |
$gender = get_post_meta( $post->ID, 'scholar_gender', true ); | |
$suffix = get_post_meta( $post->ID, 'scholar_suffix', true ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function name($post) | |
{ | |
$ei = new EasyInputs([ | |
'name' => 'Person', | |
'group' => 'name', | |
'type' => 'meta' | |
]); | |
// Use nonce for verification | |
wp_nonce_field(plugin_basename(__FILE__), 'scholar_name_nonce'); | |
$prefix = get_post_meta($post->ID, 'scholar_prefix', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Display column headers for the user-selected array of columns. | |
* | |
* @var str $query: The query array. | |
*/ | |
public function displayColumnHeaders( $query ) { | |
$headers = ''; | |
$sort = $query['sort']; | |
$direction = $query['direction']; | |
$arrow = sprintf('fa fa-sort-%s', $direction); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Icon Fonts: | |
foreach( ReactiveCustomizer::$icon_fonts as $slug=>$name ) : | |
$wp_customize->add_setting( 'hn_icon_fonts_' . $slug , array( | |
'default' => '0' | |
) ); | |
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'icon_fonts_' . $slug, array( | |
'label' => __( $name, 'hn-reactive' ), | |
'section' => 'icon_fonts', | |
'settings' => 'hn_icon_fonts_' . $slug, | |
'type' => 'checkbox' |