Skip to content

Commit

Permalink
[#1] Getting ready for 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rtripault committed Feb 17, 2015
1 parent 6334ba0 commit b3afd60
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.1-dev
0.1.1-pl
28 changes: 23 additions & 5 deletions _build/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@
'assets' => $root . 'assets/',
'core' => $root . 'core/components/locker/',

'build_dir' => '/home/_builds/locker/'
'build_dir' => '/home/_builds/' . PKG_NAME_LOWER . '/'
);
unset($root);

// Override with your own defines here (see build.config.sample.php)
require_once $sources['build'] . 'build.config.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
if (file_exists(MODX_CORE_PATH . 'vendor/autoload.php')) {
require_once MODX_CORE_PATH . 'vendor/autoload.php';
} else {
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
}
require_once $sources['build'] . 'includes/helper.php';

// Instantiate modX
Expand Down Expand Up @@ -74,6 +78,13 @@
}
$category->addMany($plugins);

$modx->log(modX::LOG_LEVEL_INFO, 'Packaging in chunks...');
$chunks = include $sources['data'] . 'chunks.php';
if (empty($chunks)) {
$modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in chunks.');
}
$category->addMany($chunks);

// Create category vehicle
$attr = array(
xPDOTransport::UNIQUE_KEY => 'category',
Expand All @@ -94,21 +105,28 @@
),
),
),
'Chunks' => array(
xPDOTransport::PRESERVE_KEYS => false,
xPDOTransport::UPDATE_OBJECT => false,
xPDOTransport::UNIQUE_KEY => 'name',
),
),
);
$vehicle = $builder->createVehicle($category, $attr);

$modx->log(modX::LOG_LEVEL_INFO, 'Adding PHP resolvers to category...');
$vehicle->resolve('php', array(
'source' => $sources['resolvers'] . 'console.php',
));
$modx->log(modX::LOG_LEVEL_INFO, 'Adding file resolvers to category...');
$vehicle->resolve('file', array(
'source' => $sources['core'],
'target' => "return MODX_CORE_PATH . 'components/';",
));
$vehicle->resolve('php', array(
'source' => $sources['resolvers'] . 'console.php',
));
$builder->putVehicle($vehicle);

// Load system settings
$modx->log(modX::LOG_LEVEL_INFO, 'Packaging in settings...');
$settings = include $sources['data'] . 'settings.php';
if (!is_array($settings)) {
$modx->log(modX::LOG_LEVEL_ERROR, 'Could not package in settings.');
Expand Down
18 changes: 18 additions & 0 deletions _build/data/chunks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* @var modX $modx
* @var array $sources
*/

/** @var modChunk[] $chunks */
$chunks = array();
$i = 0;

$chunks[$i] = $modx->newObject('modPlugin');
$chunks[$i]->fromArray(array(
'name' => 'Manager Locker',
'description' => 'Handle manager locking state.',
'plugincode' => file_get_contents($sources['elements'] . 'chunks/manager_locked_message.html'),
), '', true, true);

return $chunks;
10 changes: 10 additions & 0 deletions _build/data/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@

$i++;

$settings[$i] = $modx->newObject('modSystemSetting');
$settings[$i]->fromArray(array(
'key' => 'locker.manager_locked_message',
'value' => '[[$locker.manager_locked_message]]',
'xtype' => 'text',
'namespace' => 'locker',
), '', true, true);

$i++;

$settings[$i] = $modx->newObject('modSystemSetting');
$settings[$i]->fromArray(array(
'key' => 'locker.status_off_on_lock',
Expand Down
2 changes: 1 addition & 1 deletion core/components/locker/elements/plugins/manager-locker.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
case 'OnManagerLoginFormRender':
if ($locked) {
// Display a warning in the login form
$msg = $modx->getOption('locker.manager_locked_message', null, '<div class="warning">[[%locker.manager_locked_message]]</div>');
$msg = $modx->getOption('locker.manager_locked_message', null, '<div class="warning">[[%locker.manager_locked_message]]</div>', true);
$modx->getParser()->processElementTags('', $msg);

$modx->event->output($msg);
Expand Down

0 comments on commit b3afd60

Please sign in to comment.