From b3afd601b0d71637d5efd5efb9ecbdc9f0227a6a Mon Sep 17 00:00:00 2001 From: Romain Date: Tue, 17 Feb 2015 21:05:05 +0100 Subject: [PATCH] [#1] Getting ready for 0.1.1 --- VERSION | 2 +- _build/build.transport.php | 28 +++++++++++++++---- _build/data/chunks.php | 18 ++++++++++++ _build/data/settings.php | 10 +++++++ .../elements/plugins/manager-locker.php | 2 +- 5 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 _build/data/chunks.php diff --git a/VERSION b/VERSION index c992723..7eb8441 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.1-dev +0.1.1-pl diff --git a/_build/build.transport.php b/_build/build.transport.php index a67c883..ba06e33 100644 --- a/_build/build.transport.php +++ b/_build/build.transport.php @@ -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 @@ -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', @@ -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.'); diff --git a/_build/data/chunks.php b/_build/data/chunks.php new file mode 100644 index 0000000..98c7065 --- /dev/null +++ b/_build/data/chunks.php @@ -0,0 +1,18 @@ +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; diff --git a/_build/data/settings.php b/_build/data/settings.php index 3363597..83eca28 100644 --- a/_build/data/settings.php +++ b/_build/data/settings.php @@ -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', diff --git a/core/components/locker/elements/plugins/manager-locker.php b/core/components/locker/elements/plugins/manager-locker.php index 09eaeb5..de08830 100644 --- a/core/components/locker/elements/plugins/manager-locker.php +++ b/core/components/locker/elements/plugins/manager-locker.php @@ -28,7 +28,7 @@ case 'OnManagerLoginFormRender': if ($locked) { // Display a warning in the login form - $msg = $modx->getOption('locker.manager_locked_message', null, '
[[%locker.manager_locked_message]]
'); + $msg = $modx->getOption('locker.manager_locked_message', null, '
[[%locker.manager_locked_message]]
', true); $modx->getParser()->processElementTags('', $msg); $modx->event->output($msg);