diff options
Diffstat (limited to 'mod/developers')
-rw-r--r-- | mod/developers/actions/developers/settings.php | 6 | ||||
-rw-r--r-- | mod/developers/languages/en.php | 12 | ||||
-rw-r--r-- | mod/developers/start.php | 9 | ||||
-rw-r--r-- | mod/developers/views/default/admin/develop_tools/unit_tests.php | 17 | ||||
-rw-r--r-- | mod/developers/views/default/admin/developers/settings.php | 4 | ||||
-rw-r--r-- | mod/developers/views/default/theme_preview/components.php | 15 | ||||
-rw-r--r-- | mod/developers/views/default/theme_preview/components/table.php | 2 |
7 files changed, 48 insertions, 17 deletions
diff --git a/mod/developers/actions/developers/settings.php b/mod/developers/actions/developers/settings.php index 811fd22c0..7c91e2f5f 100644 --- a/mod/developers/actions/developers/settings.php +++ b/mod/developers/actions/developers/settings.php @@ -11,10 +11,10 @@ if (get_input('simple_cache')) { elgg_disable_simplecache(); } -if (get_input('view_path_cache')) { - elgg_enable_filepath_cache(); +if (get_input('system_cache')) { + elgg_enable_system_cache(); } else { - elgg_disable_filepath_cache(); + elgg_disable_system_cache(); } $debug = get_input('debug_level'); diff --git a/mod/developers/languages/en.php b/mod/developers/languages/en.php index a2682363c..262759e23 100644 --- a/mod/developers/languages/en.php +++ b/mod/developers/languages/en.php @@ -9,15 +9,16 @@ $english = array( 'admin:develop_tools' => 'Tools', 'admin:develop_tools:preview' => 'Theming Sandbox', 'admin:develop_tools:inspect' => 'Inspect', + 'admin:develop_tools:unit_tests' => 'Unit Tests', 'admin:developers' => 'Developers', 'admin:developers:settings' => 'Settings', // settings 'elgg_dev_tools:settings:explanation' => 'Control your development and debugging settings below. Some of these settings are also available on other admin pages.', 'developers:label:simple_cache' => 'Use simple cache', - 'developers:help:simple_cache' => 'Turn off the file cache when developing. Otherwise, changes to your views (including css) will be ignored.', - 'developers:label:view_path_cache' => 'Use view path cache', - 'developers:help:view_path_cache' => 'Turn this off when developing. Otherwise, new views in your plugins will not be registered.', + 'developers:help:simple_cache' => 'Turn off this cache when developing. Otherwise, changes to your CSS and JavaScript will be ignored.', + 'developers:label:system_cache' => 'Use system cache', + 'developers:help:system_cache' => 'Turn this off when developing. Otherwise, changes in your plugins will not be registered.', 'developers:label:debug_level' => "Trace level", 'developers:help:debug_level' => "This controls the amount of information logged. See elgg_log() for more information.", 'developers:label:display_errors' => 'Display fatal PHP errors', @@ -54,6 +55,11 @@ $english = array( 'theme_preview:navigation' => 'Navigation', 'theme_preview:typography' => 'Typography', + // unit tests + 'developers:unit_tests:description' => 'Elgg has unit and integration tests for detecting bugs in its core classes and functions.', + 'developers:unit_tests:warning' => 'Warning: Do Not Run These Tests on a Production Site. They can corrupt your database.', + 'developers:unit_tests:run' => 'Run', + // status messages 'developers:settings:success' => 'Settings saved', ); diff --git a/mod/developers/start.php b/mod/developers/start.php index 79ec0655a..d77a96b36 100644 --- a/mod/developers/start.php +++ b/mod/developers/start.php @@ -63,6 +63,7 @@ function developers_setup_menu() { if (elgg_in_context('admin')) { elgg_register_admin_menu_item('develop', 'inspect', 'develop_tools'); elgg_register_admin_menu_item('develop', 'preview', 'develop_tools'); + elgg_register_admin_menu_item('develop', 'unit_tests', 'develop_tools'); elgg_register_menu_item('page', array( 'name' => 'dev_settings', @@ -76,8 +77,8 @@ function developers_setup_menu() { } /** -* Clear all the strings so the raw descriptor strings are displayed -*/ + * Clear all the strings so the raw descriptor strings are displayed + */ function developers_clear_strings() { global $CONFIG; @@ -121,8 +122,8 @@ function developers_wrap_views($hook, $type, $result, $params) { } /** -* Log the events and plugin hooks -*/ + * Log the events and plugin hooks + */ function developers_log_events($name, $type) { // filter out some very common events diff --git a/mod/developers/views/default/admin/develop_tools/unit_tests.php b/mod/developers/views/default/admin/develop_tools/unit_tests.php new file mode 100644 index 000000000..81658e88b --- /dev/null +++ b/mod/developers/views/default/admin/develop_tools/unit_tests.php @@ -0,0 +1,17 @@ +<?php +/** + * Elgg unit and integration tests + * + */ + +echo '<p>' . elgg_echo('developers:unit_tests:description') . '</p>'; +echo '<p><strong>' . elgg_echo('developers:unit_tests:warning') . '</strong></p>'; + +// create a button to run tests +$params = array( + 'text' => elgg_echo('developers:unit_tests:run'), + 'href' => 'engine/tests/suite.php', + 'class' => 'elgg-button elgg-button-submit', + 'is_trusted' => true, +); +echo '<p>' . elgg_view('output/url', $params) . '</p>'; diff --git a/mod/developers/views/default/admin/developers/settings.php b/mod/developers/views/default/admin/developers/settings.php index dcc0a3e4f..459cbabad 100644 --- a/mod/developers/views/default/admin/developers/settings.php +++ b/mod/developers/views/default/admin/developers/settings.php @@ -10,10 +10,10 @@ $data = array( 'checked' => elgg_get_config('simplecache_enabled') == 1, ), - 'view_path_cache' => array( + 'system_cache' => array( 'type' => 'checkbox', 'value' => 1, - 'checked' => elgg_get_config('viewpath_cache_enabled') == 1, + 'checked' => elgg_get_config('system_cache_enabled') == 1, ), 'display_errors' => array( diff --git a/mod/developers/views/default/theme_preview/components.php b/mod/developers/views/default/theme_preview/components.php index ab5a6e941..45f520f2c 100644 --- a/mod/developers/views/default/theme_preview/components.php +++ b/mod/developers/views/default/theme_preview/components.php @@ -3,10 +3,17 @@ * CSS Objects: list, module, image_block, table, messages */ -echo elgg_view_module('info', 'Image Block (.elgg-image-block)', elgg_view('theme_preview/components/image_block')); +$body = elgg_view('theme_preview/components/image_block'); +echo elgg_view_module('info', 'Image Block (.elgg-image-block)', $body); -echo elgg_view_module('info', 'List (.elgg-list)', elgg_view('theme_preview/components/list')); +$body = elgg_view('theme_preview/components/list'); +echo elgg_view_module('info', 'List (.elgg-list)', $body); -echo elgg_view_module('info', 'Table (.elgg-table)', elgg_view('theme_preview/components/table')); +$body = elgg_view('theme_preview/components/table', array('class' => 'elgg-table')); +echo elgg_view_module('info', 'Table (.elgg-table)', $body); -echo elgg_view_module('info', 'Messages (.elgg-message)', elgg_view('theme_preview/components/messages')); +$body = elgg_view('theme_preview/components/table', array('class' => 'elgg-table-alt')); +echo elgg_view_module('info', 'Table Alternate (.elgg-table-alt)', $body); + +$body = elgg_view('theme_preview/components/messages'); +echo elgg_view_module('info', 'Messages (.elgg-message)', $body); diff --git a/mod/developers/views/default/theme_preview/components/table.php b/mod/developers/views/default/theme_preview/components/table.php index e9ef32143..8b8b13e76 100644 --- a/mod/developers/views/default/theme_preview/components/table.php +++ b/mod/developers/views/default/theme_preview/components/table.php @@ -1,4 +1,4 @@ -<table class="elgg-table">
+<table class="<?php echo $vars['class']; ?>">
<?php
echo "<thead><tr><th>column 1</th><th>column 2</th></tr></thead>";
for ($i = 1; $i < 5; $i++) {
|