Skip to content

Commit

Permalink
Merge pull request #6 from davidpede/master
Browse files Browse the repository at this point in the history
Bump version for 1.0.1-pl
  • Loading branch information
David Pede committed Jul 1, 2013
2 parents 9d58276 + 504a795 commit f8519c1
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 186 deletions.
94 changes: 47 additions & 47 deletions _build/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@
* @package getvimeo
* @subpackage build
*/

$mtime = microtime();
$mtime = explode(" ", $mtime);
$mtime = $mtime[1] + $mtime[0];
$tstart = $mtime;
set_time_limit(0);

/* define package names */
define('PKG_NAME','getVimeo');
define('PKG_NAME_LOWER','getvimeo');
define('PKG_VERSION','1.0.0');
define('PKG_VERSION','1.0.1');
define('PKG_RELEASE','pl');

/* define sources */
$root = dirname(dirname(__FILE__)).'/';
$sources = array(
'root' => $root,
'build' => $root . '_build/',
'data' => $root . '_build/data/', //Files used to fetch Snippets, Chunks etc from elements folder
'resolvers' => $root . '_build/resolvers/',
'chunks' => $root.'core/components/'.PKG_NAME_LOWER.'/elements/chunks/',
'snippets' => $root.'core/components/'.PKG_NAME_LOWER.'/elements/snippets/',
'lexicon' => $root . 'core/components/'.PKG_NAME_LOWER.'/lexicon/',
'docs' => $root.'core/components/'.PKG_NAME_LOWER.'/docs/',
'elements' => $root.'core/components/'.PKG_NAME_LOWER.'/elements/',
'source_assets' => $root.'assets/components/'.PKG_NAME_LOWER,
'source_core' => $root.'core/components/'.PKG_NAME_LOWER,
'root' => $root,
'build' => $root . '_build/',
'data' => $root . '_build/data/', //Files used to fetch Snippets, Chunks etc from elements folder
'resolvers' => $root . '_build/resolvers/',
'chunks' => $root.'core/components/'.PKG_NAME_LOWER.'/elements/chunks/',
'snippets' => $root.'core/components/'.PKG_NAME_LOWER.'/elements/snippets/',
'lexicon' => $root . 'core/components/'.PKG_NAME_LOWER.'/lexicon/',
'docs' => $root.'core/components/'.PKG_NAME_LOWER.'/docs/',
'elements' => $root.'core/components/'.PKG_NAME_LOWER.'/elements/',
'source_assets' => $root.'assets/components/'.PKG_NAME_LOWER,
'source_core' => $root.'core/components/'.PKG_NAME_LOWER,
);

unset($root);

/* instantiate MODx */
require_once $sources['build'].'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
Expand All @@ -57,60 +57,60 @@
/* add snippets */
$snippets = include $sources['data'].'transport.snippets.php';
if (!is_array($snippets)) {
$modx->log(modX::LOG_LEVEL_ERROR,'Could not package in snippets.');
$modx->log(modX::LOG_LEVEL_ERROR,'Could not package in snippets.');
} else {
$category->addMany($snippets);
$modx->log(modX::LOG_LEVEL_INFO,'Packaged in '.count($snippets).' snippets.');
$category->addMany($snippets);
$modx->log(modX::LOG_LEVEL_INFO,'Packaged in '.count($snippets).' snippets.');
}

/* add chunks */
$chunks = include $sources['data'].'transport.chunks.php';
if (!is_array($chunks)) {
$modx->log(modX::LOG_LEVEL_ERROR,'Could not package in chunks.');
$modx->log(modX::LOG_LEVEL_ERROR,'Could not package in chunks.');
} else {
$category->addMany($chunks);
$modx->log(modX::LOG_LEVEL_INFO,'Packaged in '.count($chunks).' chunks.');
$category->addMany($chunks);
$modx->log(modX::LOG_LEVEL_INFO,'Packaged in '.count($chunks).' chunks.');
}

/* create category vehicle */
$attr = array(
xPDOTransport::UNIQUE_KEY => 'category',
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::RELATED_OBJECTS => true,
xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array (
'Snippets' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'name',
),
'Chunks' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'name',
),
),
xPDOTransport::UNIQUE_KEY => 'category',
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::RELATED_OBJECTS => true,
xPDOTransport::RELATED_OBJECT_ATTRIBUTES => array (
'Snippets' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'name',
),
'Chunks' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => true,
xPDOTransport::UNIQUE_KEY => 'name',
),
),
);
$vehicle = $builder->createVehicle($category,$attr);

/* add the file resolvers */
$modx->log(modX::LOG_LEVEL_INFO,'Adding file resolvers to category...');
$vehicle->resolve('file',array(
'source' => $sources['source_core'],
'target' => "return MODX_CORE_PATH . 'components/';",
'source' => $sources['source_core'],
'target' => "return MODX_CORE_PATH . 'components/';",
));
/*$vehicle->resolve('file',array(
'source' => $sources['source_assets'],
'target' => "return MODX_ASSETS_PATH . 'components/';",
'source' => $sources['source_assets'],
'target' => "return MODX_ASSETS_PATH . 'components/';",
));*/

$builder->putVehicle($vehicle);

/* pack in the license file, readme and changelog */
$builder->setPackageAttributes(array(
'license' => file_get_contents($sources['docs'] . 'license.txt'),
'readme' => file_get_contents($sources['docs'] . 'readme.txt'),
'changelog' => file_get_contents($sources['docs'] . 'changelog.txt'),
'license' => file_get_contents($sources['docs'] . 'license.txt'),
'readme' => file_get_contents($sources['docs'] . 'readme.txt'),
'changelog' => file_get_contents($sources['docs'] . 'changelog.txt'),
));

/* zip up package */
Expand All @@ -125,6 +125,6 @@
$totalTime= sprintf("%2.4f s", $totalTime);

$modx->log(modX::LOG_LEVEL_INFO,"\n<br />Package Built.<br />\nExecution time: {$totalTime}\n");

session_write_close();
exit ();
exit();
12 changes: 6 additions & 6 deletions _build/data/transport.chunks.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
* @package getvimeo
* @subpackage build
*/

$chunks = array();

$chunks[0]= $modx->newObject('modChunk');
$chunks[0]->fromArray(array(
'id' => 0,
'name' => 'vimeoTpl',
'description' => 'Example Chunk serving as a Template.',
'snippet' => file_get_contents($sources['source_core'].'/elements/chunks/vimeotpl.chunk.tpl'),
'properties' => '',
'id' => 0,
'name' => 'vimeoTpl',
'description' => 'Example Chunk serving as a Template.',
'snippet' => file_get_contents($sources['source_core'].'/elements/chunks/vimeotpl.chunk.tpl'),
'properties' => '',
),'',true,true);

return $chunks;
14 changes: 7 additions & 7 deletions _build/data/transport.snippets.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
*/

function getSnippetContent($filename) {
$o = file_get_contents($filename);
$o = trim(str_replace(array('<?php','?>'),'',$o));
return $o;
$o = file_get_contents($filename);
$o = trim(str_replace(array('<?php','?>'),'',$o));
return $o;
}

$snippets = array();

$snippets[0]= $modx->newObject('modSnippet');
$snippets[0]->fromArray(array(
'id' => 0,
'name' => 'getVimeo',
'description' => 'A video retrieval Snippet for MODX Revolution',
'snippet' => getSnippetContent($sources['source_core'].'/elements/snippets/snippet.getvimeo.php'),
'id' => 0,
'name' => 'getVimeo',
'description' => 'A video retrieval Snippet for MODX Revolution. This snippet uses the Vimeo Simple API to search a specified channel and return requested videos and associated data.',
'snippet' => getSnippetContent($sources['source_core'].'/elements/snippets/snippet.getvimeo.php'),
),'',true,true);
$properties = include $sources['build'].'properties/properties.getvimeo.php';
$snippets[0]->setProperties($properties);
Expand Down
118 changes: 59 additions & 59 deletions _build/properties/properties.getvimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,64 @@
*/

$properties = array(
array(
'name' => 'channel',
'desc' => 'Name or ID of the target Vimeo Channel. [REQUIRED PARAMETER]',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'id',
'desc' => 'A comma-separated list of Video IDs to output from target Channel. Use `all` to output all Videos. [REQUIRED PARAMETER]',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'tpl',
'desc' => 'Name of a chunk serving as a template. [REQUIRED PARAMETER]',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'tplAlt',
'desc' => 'Name of a chunk serving as a template for every other Video.',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'tplWrapper',
'desc' => 'Name of a chunk serving as a wrapper template for the output. [NOTE: Only works when placeholder is set with &toPlaceholder]',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'sortby',
'desc' => 'A placeholder name to sort by. Defaults to `upload_date`. [NOTE: Please see placeholder docs for more details]',
'type' => 'textfield',
'options' => '',
'value' => 'upload_date',
),
array(
'name' => 'sortdir',
'desc' => 'Order which to sort by. Defaults to `DESC`.',
'type' => 'list',
'options' => array(
array('text' => 'ASC','value' => 'ASC'),
array('text' => 'DESC','value' => 'DESC'),
),
'value' => 'DESC',
),
array(
'name' => 'toPlaceholder',
'desc' => 'If set, will assign the output to this placeholder instead of outputting it directly.',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'channel',
'desc' => 'The URL Name or Numeric ID of the target Vimeo Channel. [REQUIRED]',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'id',
'desc' => 'A comma-separated list of Numeric Video IDs to output from target Channel. Use `all` to output all Videos. [REQUIRED]',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'tpl',
'desc' => 'Name of a chunk serving as a template. [REQUIRED]',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'tplAlt',
'desc' => 'Name of a chunk serving as a template for every other Video.',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'tplWrapper',
'desc' => 'Name of a chunk serving as a wrapper template for the output. [NOTE: Only works when placeholder is set with &toPlaceholder]',
'type' => 'textfield',
'options' => '',
'value' => '',
),
array(
'name' => 'sortby',
'desc' => 'A placeholder name to sort by. [NOTE: Please see placeholder docs for more details]',
'type' => 'textfield',
'options' => '',
'value' => 'upload_date',
),
array(
'name' => 'sortdir',
'desc' => 'Order which to sort by. [OPTIONS: DESC or ASC]',
'type' => 'list',
'options' => array(
array('text' => 'ASC','value' => 'ASC'),
array('text' => 'DESC','value' => 'DESC'),
),
'value' => 'DESC',
),
array(
'name' => 'toPlaceholder',
'desc' => 'If set, will assign the output to this placeholder instead of outputting it directly.',
'type' => 'textfield',
'options' => '',
'value' => '',
),
);
return $properties;
8 changes: 8 additions & 0 deletions core/components/getvimeo/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Changelog for getVimeo.

getVimeo 1.0.1-pl (July 01, 2013)
====================================
- Add [[+total]] placeholder.
- Fix incorrect video count.
- Fix define output variable in correct place.
- Fix page rendering when there is an error.
- Tidy up tabs and convert to spaces.

getVimeo 1.0.0-pl (June 24, 2013)
====================================
- Add &sortby parameter.
Expand Down
6 changes: 3 additions & 3 deletions core/components/getvimeo/docs/readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--------------------
Extra: getVimeo
--------------------
Version: 1.0.0-pl
Released: June 24, 2013
Version: 1.0.1-pl
Released: July 01, 2013
Since: June 12, 2013
Author: David Pede <dev@tasianmedia.com>

Expand All @@ -14,7 +14,7 @@ http://rtfm.modx.com/display/ADDON/getVimeo
GitHub Repository:
http://github.com/tasianmedia/getVimeo

Bug Reports:
Bugs & Feature Requests:
http://github.com/tasianmedia/getVimeo/issues

Please Note:
Expand Down
6 changes: 3 additions & 3 deletions core/components/getvimeo/elements/chunks/vimeotpl.chunk.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div>
<span><a href="[[+url]]" target="_blank">[[+title]]</a></span><br>
<a href="[[+url]]" target="_blank"><img src="[[+thumbnail_small]]" alt="[[+title]]"></a><br>
<span><i>[[+upload_date:ago]]</i><br></span>
<span><a href="[[+url]]" target="_blank">[[+title]]</a></span><br>
<a href="[[+url]]" target="_blank"><img src="[[+thumbnail_small]]" alt="[[+title]]"></a><br>
<span><i>[[+upload_date:ago]]</i><br></span>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div>
<span><a href="[[+url]]" target="_blank">[[+title]]</a>(Alt Tpl)</span><br>
<a href="[[+url]]" target="_blank"><img src="[[+thumbnail_small]]" alt="[[+title]]"></a><br>
<span><i>[[+upload_date:ago]]</i></span>
<span><a href="[[+url]]" target="_blank">[[+title]]</a>(Alt Tpl)</span><br>
<a href="[[+url]]" target="_blank"><img src="[[+thumbnail_small]]" alt="[[+title]]"></a><br>
<span><i>[[+upload_date:ago]]</i></span>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div>
<span>Outer Tpl</span><br>
[[+vids]]
<span>Outer Tpl</span><br>
[[+vids]]
</div>
Loading

0 comments on commit f8519c1

Please sign in to comment.