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
package MAUS::Callbacks; | |
use strict; | |
sub _data_api_pre_save_entry { | |
my ( $cb, $app, $obj, $original ) = @_; | |
my $entry = $app->param( 'entry' ); | |
$entry = MT::DataAPI::Format::JSON::unserialize( $entry ); | |
# if ( $entry->{ 'convert_breaks' } ) { | |
# $obj->convert_breaks( lc( $entry->{ 'convert_breaks' } ) ); | |
# } |
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
<?php | |
define( 'DataAPICacheDir', '/tmp/api_cache' ); | |
define( 'DataAPIUploadCacheDir', '/tmp/upload' ); | |
define( 'DataAPICacheTtl', 1200 ); | |
define( 'DataAPICacheWithAuth', TRUE ); | |
define( 'DataAPIURL', 'http://localhost/mt/mt-data-api.cgi' ); | |
define( 'SendHTTPHeaderMethod', '' ); | |
$cache_ttl = DataAPICacheTtl; | |
$cache_with_auth = DataAPICacheWithAuth; | |
$cache_dir = DataAPICacheDir; |
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
<?php | |
global $app; | |
$q = $app->param( 'q' ); | |
$q = $app->db()->escape( $q ); | |
$q = preg_replace( '/[^0-9]/', '', $q ); | |
if ( $q ) { | |
$terms = array( 'name' => $q, | |
'class' => 'postalcode' ); | |
$extra = array( 'limit' => 1 ); | |
$postalcode = $app->load( 'CustomObject', $terms, $extra ); |
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
Trigger1: | |
params: | |
- __mode=view | |
- _type=entrygroup | |
- saved=1 | |
template_id: 93 | |
Trigger2: | |
params: | |
- __mode=view | |
- _type=campaigngroup |
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
<mt:Asset id="1"> | |
<mt:AssetThumbnailFile width="32" square="1" convert2base64="1" setvar="src"> | |
<mt:Var name="src" get_content_length="1" setvar="image_size"> | |
<mt:If name="image_size" lt="32768"> | |
<img src="data:<mt:AssetMimeType>;base64,<mt:Var name="src">" width="32" height="32" alt="<mt:AssetLabel escape="html">" /> | |
<mt:else> | |
<img src="<mt:AssetThumbnailURL>" width="32" height="32" alt="<mt:AssetLabel escape="html">" /> | |
</mt:If> | |
</mt:Asset> |
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
use MT; | |
my $mt = MT->new; | |
require MT::TheSchwartz::FuncMap; | |
require MT::TheSchwartz::Job; | |
require MT::FileInfo; | |
require MT::WeblogPublisher; | |
my $funcmap = MT::TheSchwartz::FuncMap->load( { funcname => 'MT::Worker::Publish' } ); | |
return unless $funcmap; | |
my @jobs = MT::TheSchwartz::Job->load( { funcid => $funcmap->funcid, }, | |
{ 'sort' => 'priority', |
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
#!/usr/bin/perl | |
package MT::Tool::Foo; | |
use strict; | |
use warnings; | |
use File::Spec; | |
use FindBin; | |
use lib map File::Spec->catdir( $FindBin::Bin, File::Spec->updir, $_ ), qw/lib extlib/; | |
use base qw( MT::Tool ); | |
sub usage { '--debug 1' } |
NewerOlder