diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 2820fa5888219013c5155da31466f3e3b4e5db30..0000000000000000000000000000000000000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -FirePHPCore* \ No newline at end of file diff --git a/README.look_at_8.x_please.txt b/README.look_at_8.x_please.txt new file mode 100644 index 0000000000000000000000000000000000000000..4ad67e785e13a9c168277a3ec36596a35df1aa46 --- /dev/null +++ b/README.look_at_8.x_please.txt @@ -0,0 +1 @@ +The master branch is empty. Please see 8.x-1.x and 7.x-1.x branches. \ No newline at end of file diff --git a/README.txt b/README.txt deleted file mode 100644 index aa4df0b0372d5fe3afe77cd270832deb0b1841f5..0000000000000000000000000000000000000000 --- a/README.txt +++ /dev/null @@ -1,48 +0,0 @@ -README.txt -========== - -A module containing helper functions for Drupal developers and -inquisitive admins. This module can print a log of -all database queries for each page request at the bottom of each page. The -summary includes how many times each query was executed on a page, and how long -each query took. - - It also offers - - a block for running custom PHP on a page - - a block for quickly accessing devel pages - - a block for masquerading as other users (useful for testing) - - reports memory usage at bottom of page - - more - - This module is safe to use on a production site. Just be sure to only grant - 'access development information' permission to developers. - -Also a dpr() function is provided, which pretty prints arrays and strings. -Useful during development. Many other nice functions like dpm(), dvm(). - -AJAX developers in particular ought to install FirePHP Core from -http://www.firephp.org/ and put it in the devel directory. -This happens automatically when you enable via drush. You may also -use a drush command to download the library. If downloading by hand, -your path to fb.php should look like devel/FirePHPCore/lib/FirePHPCore/fb.php. -You can use svn checkout http://firephp.googlecode.com/svn/trunk/trunk/Libraries/FirePHPCore. -Then you can log php variables to the Firebug console. Is quite useful. - -Included in this package is also: - -- devel_node_access module which prints out the node_access records for a given node. Also offers hook_node_access_explain for all node access modules to implement. Handy. -- devel_generate.module which bulk creates nodes, users, comment, terms for development - -Some nifty drush integration ships with devel and devel_generate. See drush help for details. - -COMPATIBILITY NOTES -================== -- Modules that use AHAH may have incompatibility with the query log and other - footer info. Consider setting $GLOBALS['devel_shutdown'] = FALSE if you run into - any issues. - -AUTHOR/MAINTAINER -====================== --moshe weitzman -http://cyrve.com -Hans Salvisberg diff --git a/README_devel_node_access.txt b/README_devel_node_access.txt deleted file mode 100644 index 1d9362f377dd06b22f612995d984a7808dedb158..0000000000000000000000000000000000000000 --- a/README_devel_node_access.txt +++ /dev/null @@ -1,42 +0,0 @@ -README -====== - -This module contains tools for developers using access control modules -to restrict access to some nodes. It is intended to help catch some -common mistakes and provide feedback to confirm that restricted nodes -are in fact visible only to the intended users. - -Provides a summary page which queries the node_access table and -reports common mistakes such as the presence of Drupal's default entry -which grants all users read access to all nodes. Also reports the -presence of nodes not represented in node_access table. This may -occur when an access control module is installed after nodes have -already been created. - -Provides a block which shows all node_access entries for the nodes -shown on a given page. This gives developers a quick check to see -that grants are provided as they should be. This block auto-enables -to the footer region. You may move it as desired. - -If Views module is installed, allows browsing of nodes by realm, -including those nodes not in the node_access table (NULL realm). - -WISHLIST -======== - -Things I'd like to see but haven't had time to do: - -* Automatically solve common problems. I.e. delete the "all" realm - entry, and automatically save all nodes not in the node_access table. - -* Nicer feedback indicating whether nodes are visible to the public or - not. I.e. use color coding or icons. - -* Summary does not differentiate between view grants and other types - of grants. I personally use node_access only for view grants so I'm - not sure exactly what else it should show. - -AUTHOR -====== - -Dave Cohen AKA yogadex on drupal.org diff --git a/devel-rtl.css b/devel-rtl.css deleted file mode 100644 index fe784a8da7a7637fd37b640c9176396ae2b86cba..0000000000000000000000000000000000000000 --- a/devel-rtl.css +++ /dev/null @@ -1,8 +0,0 @@ -.dev-query, .dev-timer, .dev-memory-usage { - align: left; - direction: ltr; - padding-top: inherit; -} -.dev-query, .dev-timer, .dev-memory-usage table { - direction: ltr; -} \ No newline at end of file diff --git a/devel.admin.inc b/devel.admin.inc deleted file mode 100644 index ca95cc5690dfbc1f85d9c09a862fb58bc715c20a..0000000000000000000000000000000000000000 --- a/devel.admin.inc +++ /dev/null @@ -1,142 +0,0 @@ - 'fieldset', '#title' => t('Query log')); - - $description = t('Display a log of the database queries needed to generate the current page, and the execution time for each. Also, queries which are repeated during a single page view are summed in the # column, and printed in red since they are candidates for caching.'); - if (!devel_is_compatible_optimizer()) { - $description = t('You must disable or upgrade the php Zend Optimizer extension in order to enable this feature. The minimum required version is 3.2.8. Earlier versions of Zend Optimizer are horribly buggy and segfault your Apache ... ', array('!url' => url('http://drupal.org/node/126098'))) . $description; - } - $form['queries']['devel_query_display'] = array('#type' => 'checkbox', - '#title' => t('Display query log'), - '#default_value' => variable_get('devel_query_display', 0), - '#description' => $description, - '#disabled' => !devel_is_compatible_optimizer(), - ); - $form['queries']['settings'] = array( - '#type' => 'container', - '#states' => array( - // Hide the query log settings when not displaying query log. - 'invisible' => array( - 'input[name="devel_query_display"]' => array('checked' => FALSE), - ), - ), - ); - $form['queries']['settings']['devel_query_sort'] = array('#type' => 'radios', - '#title' => t('Sort query log'), - '#default_value' => variable_get('devel_query_sort', DEVEL_QUERY_SORT_BY_SOURCE), - '#options' => array(t('by source'), t('by duration')), - '#description' => t('The query table can be sorted in the order that the queries were executed or by descending duration.'), - ); - $form['queries']['settings']['devel_execution'] = array('#type' => 'textfield', - '#title' => t('Slow query highlighting'), - '#default_value' => variable_get('devel_execution', 5), - '#size' => 4, - '#maxlength' => 4, - '#description' => t('Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibly inefficient query, or a candidate for caching.'), - ); - - $form['xhprof'] = array( - '#type' => 'fieldset', - '#title' => 'XHProf', - '#description' => t('XHProf is a php extension which is essential for profiling your Drupal site. It pinpoints slow functions, and also memory hogging functions.'), - ); - $description = extension_loaded('xhprof') ? t('Profile requests with the xhprof php extension.') : '' . t('You must enable the xhprof php extension to use this feature.', array('!url' => url('http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/'))) . ''; - $form['xhprof']['devel_xhprof_enabled'] = array( - '#type' => 'checkbox', - '#title' => t('Enable profiling of all page views and drush requests.', array('!drush' => url('http://drush.ws'))), - '#default_value' => variable_get('devel_xhprof_enabled', FALSE), - '#description' => $description, - '#disabled' => !extension_loaded('xhprof'), - ); - $form['xhprof']['settings'] = array( - '#type' => 'container', - '#states' => array( - 'invisible' => array( - 'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE), - ), - ), - ); - $form['xhprof']['settings']['devel_xhprof_directory'] = array( - '#type' => 'textfield', - '#title' => 'xhprof directory', - '#description' => t('Location of the xhprof source code on your system, usually somewhere in /usr/local/share or /usr/share, include the leading forward slash.'), - '#default_value' => variable_get('devel_xhprof_directory', ''), - '#states' => array( - 'invisible' => array( - 'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE), - ), - ), - ); - $form['xhprof']['settings']['devel_xhprof_url'] = array( - '#type' => 'textfield', - '#title' => 'XHProf URL', - '#description' => t('Path to the publically accessible xhprof_html - required to display profiler reports. You will need to set this up outside Drupal, for example at http://xhprof.localhost/xhprof_html'), - '#default_value' => variable_get('devel_xhprof_url', ''), - '#states' => array( - 'invisible' => array( - 'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE), - ), - ), - ); - - $form['devel_api_url'] = array('#type' => 'textfield', - '#title' => t('API Site'), - '#default_value' => variable_get('devel_api_url', 'api.drupal.org'), - '#description' => t('The base URL for your developer documentation links. You might change this if you run api.module locally.', array('!url' => url('http://drupal.org/project/api')))); - $form['dev_timer'] = array('#type' => 'checkbox', - '#title' => t('Display page timer'), - '#default_value' => variable_get('dev_timer', 0), - '#description' => t('Display page execution time in the query log box.'), - ); - - $form['dev_mem'] = array('#type' => 'checkbox', - '#title' => t('Display memory usage'), - '#default_value' => variable_get('dev_mem', 0), - '#description' => t('Display how much memory is used to generate the current page. This will show memory usage when devel_init() is called and when devel_exit() is called.'), - ); - $form['devel_redirect_page'] = array('#type' => 'checkbox', - '#title' => t('Display redirection page'), - '#default_value' => variable_get('devel_redirect_page', 0), - '#description' => t('When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page.'), - ); - $form['devel_page_alter'] = array('#type' => 'checkbox', - '#title' => t('Display $page array'), - '#default_value' => variable_get('devel_page_alter', FALSE), - '#description' => t('Display $page array from hook_page_alter() in the messages area of each page.'), - ); - $form['devel_error_handler'] = array('#type' => 'radios', - '#title' => t('Error handler'), - '#default_value' => variable_get('devel_error_handler', DEVEL_ERROR_HANDLER_STANDARD), - '#options' => array(DEVEL_ERROR_HANDLER_NONE => t('None'), DEVEL_ERROR_HANDLER_STANDARD => t('Standard drupal')), - '#description' => t('Choose an error handler for your site. Backtrace prints nice debug information when an error is noticed, and you choose to show errors on screen. Backtrace requires the krumo library. None is a good option when stepping through the site in your debugger.', array('@krumo' => url('http://krumo.sourceforge.net'), '@choose' => url('admin/config/development/logging'))), - ); - if (has_krumo()) { - $form['devel_error_handler']['#options'][DEVEL_ERROR_HANDLER_BACKTRACE] = t('Backtrace'); - } - - $options = drupal_map_assoc(array('default', 'blue', 'green', 'orange', 'white', 'disabled')); - $form['devel_krumo_skin'] = array( - '#type' => 'radios', - '#title' => t('Krumo display'), - '#description' => t('Select a skin for your debug messages or select disabled to display object and array output in standard PHP format.'), - '#options' => $options, - '#default_value' => variable_get('devel_krumo_skin', 'default'), - ); - - $form['devel_rebuild_theme_registry'] = array( - '#type' => 'checkbox', - '#title' => t('Rebuild the theme registry on every page load'), - '#description' => t('While creating new templates and theme_ overrides the theme registry needs to be rebuilt.'), - '#default_value' => variable_get('devel_rebuild_theme_registry', FALSE), - ); - - $form['devel_use_uncompressed_jquery'] = array( - '#type' => 'checkbox', - '#title' => t('Use uncompressed jQuery'), - '#default_value' => variable_get('devel_use_uncompressed_jquery', FALSE), - '#description' => t("Use a human-readable version of jQuery instead of the minified version that ships with Drupal, to make JavaScript debugging easier."), - ); - - return system_settings_form($form); -} diff --git a/devel.css b/devel.css deleted file mode 100644 index f06179d366823b362dc1bb8603f96f3add1ee2ab..0000000000000000000000000000000000000000 --- a/devel.css +++ /dev/null @@ -1,102 +0,0 @@ -.dev-query, .dev-timer, .dev-memory-usage { - padding: 1em; -} - -.devel-obj-output .field { - color: red; -} - -.devel-obj-output dd { - display: block; -} - -/** - * Query summary - */ -div.dev-query { - font-size:11px; - background:#fff; - border-top:3px solid #ccc; - color:#333; - /*padding:.5em;*/ - } - -div.dev-query .marker { - color: #f00; - font-weight: bold; -} - -/** - * Querylog - */ -div.devel-querylog { - color:#333; - border-bottom:1px solid #eee; - font-size:11px; - line-height:100%; - padding-left:30em; - padding-right:2em; - position:relative; - overflow:hidden; - } - -div.devel-querylog .marker { - color: #f00; - font-weight: bold; -} - -div.devel-querylog-header { - border-top:3px solid #ccc; - background:#fff; - font-weight:bold; - } - -div.devel-querylog-even { - background:#fff; - } - -div.devel-querylog-odd { - background:#f8f8f8; - } - -div.devel-querylog div.cell { - overflow:hidden; - padding: 1em .5em; - } - - div.devel-querylog div.cell-1 { - position:absolute; - left:0px; - width:4em; - } - - div.devel-querylog div.cell-2 { - position:absolute; - left:4em; - width:3em; - } - - div.devel-querylog div.cell-3 { - position:absolute; - left:6em; - width:19em; - } - - div.devel-querylog div.cell-4 { - position:absolute; - left:26em; - width:4em; - } - - div.devel-querylog-even div.cell-5, - div.devel-querylog-odd div.cell-5 { - /*max-height:18em;*/ - font-family: 'Andale Mono', monospace; - } - - div.devel-querylog div.cell-6 { - position:absolute; - right:0em; - top:0em; - /*width:9em;*/ - } diff --git a/devel.drush.inc b/devel.drush.inc deleted file mode 100644 index ec17f3e8fa34580a6cc3f268a82db68c2a611674..0000000000000000000000000000000000000000 --- a/devel.drush.inc +++ /dev/null @@ -1,216 +0,0 @@ - dt('Downloads the FirePHP library from http://firephp.org/.'), - 'arguments' => array( - 'path' => dt('Optional. A path to the download folder. If omitted Drush will use the default location (sites/all/libraries/firephp).'), - ), - ); - $items['devel-reinstall'] = array( - 'description' => dt('Disable, Uninstall, and Install a list of projects.'), - 'arguments' => array( - 'path' => dt('A space separated list of project names.'), - ), - 'aliases' => array('dre'), - ); - $items['fn-hook'] = array( - 'description' => 'List implementations of a given hook and explore source of specified one.', - 'arguments' => array( - 'hook' => 'The name of the hook to explore.' - ), - 'aliases' => array('fnh', 'hook'), - ); - $items['fn-view'] = array( - 'description' => 'Show the source of specified function or method.', - 'arguments' => array( - 'function' => 'The name of the function or method to view.', - ), - 'options' => array( - '--pipe' => 'Output just the filename of the function', - ), - 'examples' => array( - 'fn-view drupal_set_breadcrumb' => 'View the source code for function "drupal_set_breadcrumb"', - 'vi `drush --pipe fn-view user_access`' => 'Edit the file that contains the function "user_access"', - 'fn-view NodeController::load' => 'View the source code for method load in the class NodeController' - ), - 'aliases' => array('fnv'), - ); - $items['devel-token'] = array( - 'description' => dt('List available tokens'), - 'aliases' => array('token'), - 'core' => array(7), // Remove once 3.0 is released. - ); - return $items; -} - -/** - * Implementation of hook_drush_help(). - */ -function devel_drush_help($section) { - switch ($section) { - case 'drush:devel-reinstall': - return dt('Disable, Uninstall, and Install a list of projects.'); - case 'drush:devel-download': - return dt("Downloads the FirePHP library from http://firephp.org/. Places it in the devel module directory. Skips download if library already present. This all happens automatically if you enable devel using drush."); - } -} - - -/** - * A command callback. This is faster than 3 separate bootstraps. - */ -function drush_devel_reinstall() { - $projects = func_get_args(); - - $args = array_merge(array('pm-disable'), $projects); - call_user_func_array('drush_invoke', $args); - - $args = array_merge(array('pm-uninstall'), $projects); - call_user_func_array('drush_invoke', $args); - - $args = array_merge(array('pm-enable'), $projects); - call_user_func_array('drush_invoke', $args); -} - -/** - * A command callback. - */ -function drush_devel_download() { - $args = func_get_args(); - if (isset($args[0])) { - $path = $args[0]; - } - else { - $path = drush_get_context('DRUSH_DRUPAL_ROOT'); - if (module_exists('libraries')) { - $path .= '/' . libraries_get_path('FirePHPCore') . '/FirePHPCore'; - } - else { - $path .= '/'. drupal_get_path('module', 'devel') . '/FirePHPCore'; - } - } - - if (is_dir($path)) { - drush_log('FirePHP already present. No download required.', 'ok'); - } - elseif (drush_shell_exec('svn checkout http://firephp.googlecode.com/svn/branches/Library-FirePHPCore-0.3 ' . $path)) { - drush_log(dt('FirePHP has been checked out via svn to @path.', array('@path' => $path)), 'success'); - } - else { - drush_log(dt('Drush was unable to checkout FirePHP to @path.', array('@path' => $path)), 'error'); - } -} - -/** - * Implements drush_MODULE_post_COMMAND(). - */ -function drush_devel_post_pm_enable() { - $modules = func_get_args(); - if (in_array('devel', $modules) && !drush_get_option('skip')) { - drush_devel_download(); - } -} - -/** - * Command handler. Show hook implementations - */ -function drush_devel_fn_hook($hook) { - // Get implementations in the .install files as well. - include_once './includes/install.inc'; - drupal_load_updates(); - - if ($hook_implementations = module_implements($hook)) { - if ($choice = drush_choice(array_combine($hook_implementations, $hook_implementations), 'Enter the number of the hook implementation you wish to view.')) { - return drush_devel_fn_view($choice . "_$hook"); - } - } - else { - drush_log(dt('No implementations.'), 'ok'); - } -} - -/** - * Command handler. Show source code of specified function or method. - */ -function drush_devel_fn_view($function_name) { - // Get implementations in the .install files as well. - include_once './includes/install.inc'; - drupal_load_updates(); - - if (strpos($function_name, '::') === FALSE) { - if (!function_exists($function_name)) { - return drush_set_error(dt('Function not found')); - } - $reflect = new ReflectionFunction($function_name); - } - else { - list($class, $method) = explode('::', $function_name); - if (!method_exists($class, $method)) { - return drush_set_error(dt('Method not found')); - } - $reflect = new ReflectionMethod($class, $method); - } - $func_info = array('!file' => $reflect->getFileName(), '!startline' => $reflect->getStartLine(), '!endline' => $reflect->getEndLine()); - //drush_print_pipe(dt("!file -line !startline", $func_info)); - drush_print_pipe($reflect->getFileName()); - drush_print(dt("// file: !file, lines !startline-!endline", $func_info)); - - _drush_devel_print_function($reflect->getFileName(), $reflect->getStartLine(), $reflect->getEndLine()); -} - -/** - * Command callback. List available tokens. - */ -function drush_devel_token() { - $rows[] = array(dt('Group'), dt('Token'), dt('Name')); - $all = token_info(); - foreach ($all['tokens'] as $group => $tokens) { - foreach ($tokens as $key => $token) { - $rows[] = array($group, $key, $token['name']); - } - } - drush_print_table($rows, TRUE); -} - - -/** - * Print the specified function, including any - * doxygen-style comments that come before it. - */ -function _drush_devel_print_function($file, $start_line, $end_line) { - $line_num = 0; - $doxygen = NULL; - $fp = fopen( $file, 'r' ); - - while (!feof($fp) && ($line_num < ($start_line - 1))) { - $line = fgets($fp); - ++$line_num; - - if (substr($line,0,3) == '/**') { - $doxygen = $line; - } - elseif (isset($doxygen)) { - $doxygen .= $line; - if ($line_num + 1 == $start_line) { - drush_print(rtrim($doxygen)); - } - if (strstr($line, '*/') !== FALSE) { - $doxygen = NULL; - } - } - } - while (!feof($fp) && ($line_num < $end_line)) { - $line = fgets($fp); - ++$line_num; - drush_print(rtrim($line)); - } -} diff --git a/devel.info b/devel.info deleted file mode 100644 index f6556091303d38f82497d7f7574632a87ab024e2..0000000000000000000000000000000000000000 --- a/devel.info +++ /dev/null @@ -1,6 +0,0 @@ -name = Devel -description = Various blocks, pages, and functions for developers. -package = Development -core = 7.x -configure = admin/config/development/devel -tags[] = developer diff --git a/devel.install b/devel.install deleted file mode 100644 index d454fc33c27c66c0e04c3332a1a07dd1f9597480..0000000000000000000000000000000000000000 --- a/devel.install +++ /dev/null @@ -1,88 +0,0 @@ -fields(array( - 'weight' => 88, - )) - ->condition('type', 'module') - ->condition('name', 'devel') - ->execute(); - - // Create a custom menu, if Menu module is enabled. - // @see devel_modules_installed() - if (module_exists('menu')) { - $menu = array( - 'menu_name' => 'devel', - 'title' => $t('Development'), - 'description' => $t('Development link'), - ); - menu_save($menu); - } -} - -/** - * Implements hook_uninstall(). - */ -function devel_uninstall() { - variable_del('devel_form_weights'); - variable_del('devel_execution'); - variable_del('dev_timer'); - variable_del('devel_query_display'); - variable_del('devel_redirect_page'); - variable_del('devel_api_url'); - variable_del('dev_mem'); - variable_del('devel_error_handler'); - variable_del('devel_switch_user_list_size'); - variable_del('devel_switch_user_include_anon'); - variable_del('devel_switch_user_show_form'); - - // Delete the development menu. - if (module_exists('menu')) { - if ($devel_menu = menu_load('devel')) { - menu_delete($devel_menu); - } - } -} - -/** - * Remove feature for storing queries. Cleanup deprecated tables and variables. - */ -function devel_update_7000() { - db_drop_table('devel_queries'); - db_drop_table('devel_times'); -} - -/** - * Rebuild the menus since everything is defined by devel_menu(). - */ -function devel_update_7001() { - db_delete('menu_links') - ->condition('module', 'devel') - ->execute(); - variable_set('menu_rebuild_needed', TRUE); - return t('Devel module menu links will be rebuilt.'); -} - -/** - * Remove deprecated variables - dev_query, devel_code_coverage - */ -function devel_update_7002() { - variable_del('dev_query'); // Sad trombone. http://drupalcode.org/viewvc/drupal/drupal/includes/database.mysql.inc?revision=1.2&view=markup - variable_del('devel_code_coverage'); -} - -/** - * As per issue #813132: change schablon.com to white for krumo. - */ -function devel_update_7003() { - if (variable_get('devel_krumo_skin', 'white') == 'schablon.com') { - variable_set('devel_krumo_skin', 'white'); - } -} diff --git a/devel.js b/devel.js deleted file mode 100644 index bbf4942b10c3ab8b82cddd9f3e7b3fce044eec2f..0000000000000000000000000000000000000000 --- a/devel.js +++ /dev/null @@ -1,45 +0,0 @@ -(function ($) { - -// Explain link in query log -Drupal.behaviors.devel_explain = { - attach: function() { - $('a.dev-explain').click(function () { - qid = $(this).attr("qid"); - cell = $('#devel-query-' + qid); - $('.dev-explain', cell).load(Drupal.settings.basePath + '?q=devel/explain/' + Drupal.settings.devel.request_id + '/' + qid).show(); - $('.dev-placeholders', cell).hide(); - $('.dev-arguments', cell).hide(); - return false; - }); - } -} - -// Arguments link in query log -Drupal.behaviors.devel_arguments = { - attach: function() { - $('a.dev-arguments').click(function () { - qid = $(this).attr("qid"); - cell = $('#devel-query-' + qid); - $('.dev-arguments', cell).load(Drupal.settings.basePath + '?q=devel/arguments/' + Drupal.settings.devel.request_id + '/' + qid).show(); - $('.dev-placeholders', cell).hide(); - $('.dev-explain', cell).hide(); - return false; - }); - } -} - -// Placeholders link in query log -Drupal.behaviors.devel_placeholders = { - attach: function() { - $('a.dev-placeholders').click(function () { - qid = $(this).attr("qid"); - cell = $('#devel-query-' + qid); - $('.dev-explain', cell).hide(); - $('.dev-arguments', cell).hide(); - $('.dev-placeholders', cell).show(); - return false; - }); - } -} - -})(jQuery); diff --git a/devel.module b/devel.module deleted file mode 100644 index 560306fc1a06e43bbe1d2fe22043442b8bab555f..0000000000000000000000000000000000000000 --- a/devel.module +++ /dev/null @@ -1,1764 +0,0 @@ -'. t('This is a list of defined user functions that generated this current request lifecycle. Click on a function name to view its documention.') .'

'; - case 'devel/session': - return '

'. t('Here are the contents of your $_SESSION variable.') .'

'; - case 'devel/variable': - $api = variable_get('devel_api_url', 'api.drupal.org'); - return '

'. t('This is a list of the variables and their values currently stored in variables table and the $conf array of your settings.php file. These variables are usually accessed with variable_get() and variable_set(). Variables that are too long can slow down your pages.', array('@variable-get-doc' => "http://$api/api/HEAD/function/variable_get", '@variable-set-doc' => "http://$api/api/HEAD/function/variable_set")) .'

'; - case 'devel/reinstall': - return t('Warning - will delete your module tables and variables.'); - } -} - -/** - * Implements hook_modules_installed(). - * - * @see devel_install() - */ -function devel_modules_installed($modules) { - if (in_array('menu', $modules)) { - $menu = array( - 'menu_name' => 'devel', - 'title' => t('Development'), - 'description' => t('Development link'), - ); - menu_save($menu); - } -} - -/** - * Implements hook_menu(). - */ -function devel_menu() { - // Note: we can't dynamically append destination to querystring. Do so at theme layer. Fix in D7? - $items['devel/cache/clear'] = array( - 'title' => 'Empty cache', - 'page callback' => 'devel_cache_clear', - 'description' => 'Clear the CSS cache and all database cache tables which store page, node, theme and variable caches.', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - - $items['devel/reference'] = array( - 'title' => 'Function reference', - 'description' => 'View a list of currently defined user functions with documentation links.', - 'page callback' => 'devel_function_reference', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/reinstall'] = array( - 'title' => 'Reinstall modules', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_reinstall'), - 'description' => 'Run hook_uninstall() and then hook_install() for a given module.', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/menu/reset'] = array( - 'title' => 'Rebuild menus', - 'description' => 'Rebuild menu based on hook_menu() and revert any custom changes. All menu items return to their default settings.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_menu_rebuild'), - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/menu/item'] = array( - 'title' => 'Menu item', - 'description' => 'Details about a given menu item.', - 'page callback' => 'devel_menu_item', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/variable'] = array( - 'title' => 'Variable editor', - 'description' => 'Edit and delete site variables.', - 'page callback' => 'devel_variable_page', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - // we don't want the abbreviated version provided by status report - $items['devel/phpinfo'] = array( - 'title' => 'PHPinfo()', - 'description' => 'View your server\'s PHP configuration', - 'page callback' => 'devel_phpinfo', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/php'] = array( - 'title' => 'Execute PHP Code', - 'description' => 'Execute some PHP code', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_execute_form'), - 'access arguments' => array('execute php code'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/theme/registry'] = array( - 'title' => 'Theme registry', - 'description' => 'View a list of available theme functions across the whole site.', - 'page callback' => 'devel_theme_registry', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/entity/info'] = array( - 'title' => 'Entity info', - 'description' => 'View entity information across the whole site.', - 'page callback' => 'devel_entity_info_page', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/field/info'] = array( - 'title' => 'Field info', - 'description' => 'View fields information across the whole site.', - 'page callback' => 'devel_field_info_page', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/elements'] = array( - 'title' => 'Hook_elements()', - 'description' => 'View the active form/render elements for this site.', - 'page callback' => 'devel_elements_page', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/variable/edit/%'] = array( - 'title' => 'Variable editor', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_variable_edit', 3), - 'access arguments' => array('access devel information'), - 'type' => MENU_CALLBACK, - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/session'] = array( - 'title' => 'Session viewer', - 'description' => 'List the contents of $_SESSION.', - 'page callback' => 'devel_session', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/switch'] = array( - 'title' => 'Switch user', - 'page callback' => 'devel_switch_user', - 'access arguments' => array('switch users'), - 'type' => MENU_CALLBACK, - 'file' => 'devel.pages.inc', - 'menu_name' => 'devel', - ); - $items['devel/explain'] = array( - 'title' => 'Explain query', - 'page callback' => 'devel_querylog_explain', - 'description' => 'Run an EXPLAIN on a given query. Used by query log', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'type' => MENU_CALLBACK - ); - $items['devel/arguments'] = array( - 'title' => 'Arguments query', - 'page callback' => 'devel_querylog_arguments', - 'description' => 'Return a given query, with arguments instead of placeholders. Used by query log', - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'type' => MENU_CALLBACK - ); - $items['devel/run-cron'] = array( - 'title' => 'Run cron', - 'page callback' => 'system_run_cron', - 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', - 'file path' => drupal_get_path('module', 'system'), - 'menu_name' => 'devel', - ); - - // Duplicate path in 2 different menus. See http://drupal.org/node/601788. - $items['devel/settings'] = array( - 'title' => 'Devel settings', - 'description' => 'Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the block administration page.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_admin_settings'), - 'access arguments' => array('administer site configuration'), - 'file' => 'devel.admin.inc', - 'menu_name' => 'devel', - ); - $items['admin/config/development/devel'] = array( - 'title' => 'Devel settings', - 'description' => 'Helper functions, pages, and blocks to assist Drupal developers. The devel blocks can be managed via the block administration page.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_admin_settings'), - 'file' => 'devel.admin.inc', - 'access arguments' => array('administer site configuration'), - ); - - $items['node/%node/devel'] = array( - 'title' => 'Devel', - 'page callback' => 'devel_load_object', - 'page arguments' => array('node', 1), - 'access arguments' => array('access devel information'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'devel.pages.inc', - 'weight' => 100, - ); - $items['node/%node/devel/load'] = array( - 'title' => 'Load', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['node/%node/devel/render'] = array( - 'title' => 'Render', - 'page callback' => 'devel_render_object', - 'page arguments' => array('node', 1), - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'type' => MENU_LOCAL_TASK, - 'weight' => 100, - ); - $items['comment/%comment/devel'] = array( - 'title' => 'Devel', - 'page callback' => 'devel_load_object', - 'page arguments' => array('comment', 1), - 'access arguments' => array('access devel information'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'devel.pages.inc', - 'weight' => 100, - ); - $items['comment/%comment/devel/load'] = array( - 'title' => 'Load', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['comment/%comment/devel/render'] = array( - 'title' => 'Render', - 'page callback' => 'devel_render_object', - 'page arguments' => array('comment', 1), - 'access arguments' => array('access devel information'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'devel.pages.inc', - 'weight' => 100, - ); - $items['user/%user/devel'] = array( - 'title' => 'Devel', - 'page callback' => 'devel_load_object', - 'page arguments' => array('user', 1), - 'access arguments' => array('access devel information'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'devel.pages.inc', - 'weight' => 100, - ); - $items['user/%user/devel/load'] = array( - 'title' => 'Load', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['user/%user/devel/render'] = array( - 'title' => 'Render', - 'page callback' => 'devel_render_object', - 'page arguments' => array('user', 1), - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'type' => MENU_LOCAL_TASK, - 'weight' => 100, - ); - $items['taxonomy/term/%taxonomy_term/devel'] = array( - 'title' => 'Devel', - 'page callback' => 'devel_load_object', - 'page arguments' => array('taxonomy_term', 2, 'term'), - 'access arguments' => array('access devel information'), - 'file' => 'devel.pages.inc', - 'type' => MENU_LOCAL_TASK, - 'weight' => 100, - ); - $items['taxonomy/term/%taxonomy_term/devel/load'] = array( - 'title' => 'Load', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['taxonomy/term/%taxonomy_term/devel/render'] = array( - 'title' => 'Render', - 'page callback' => 'devel_render_object', - 'page arguments' => array('taxonomy_term', 2, 'term'), - 'access arguments' => array('access devel information'), - 'type' => MENU_LOCAL_TASK, - 'file' => 'devel.pages.inc', - 'weight' => 100, - ); - - return $items; -} - -/** - * Implements hook_admin_paths(). - */ -function devel_admin_paths() { - $paths = array( - 'devel/*' => TRUE, - 'node/*/devel' => TRUE, - 'node/*/devel/*' => TRUE, - 'comment/*/devel' => TRUE, - 'comment/*/devel/*' => TRUE, - 'user/*/devel' => TRUE, - 'user/*/devel/*' => TRUE, - 'taxonomy/term/*/devel' => TRUE, - 'taxonomy/term/*/devel/*' => TRUE, - ); - return $paths; -} - -function devel_menu_need_destination() { - return array('devel/cache/clear', 'devel/reinstall', 'devel/menu/reset', 'devel/variable', 'admin/reports/status/run-cron'); -} - -/** - * An implementation of hook_menu_link_alter(). Flag this link as needing alter at display time. - * This is more robust than setting alter in hook_menu(). - * @see devel_translated_menu_link_alter(). - * - **/ -function devel_menu_link_alter(&$item) { - if (in_array($item['link_path'], devel_menu_need_destination()) || $item['link_path'] == 'devel/menu/item') { - $item['options']['alter'] = TRUE; - } -} - -/** - * An implementation of hook_translated_menu_item_alter(). Append dynamic - * querystring 'destination' to several of our own menu items. - * - **/ -function devel_translated_menu_link_alter(&$item) { - if (in_array($item['href'], devel_menu_need_destination())) { - $item['localized_options']['query'] = drupal_get_destination(); - } - elseif ($item['href'] == 'devel/menu/item') { - $item['localized_options']['query'] = array('path' => $_GET['q']); - } -} - -/** - * Implementation of hook_theme() - */ -function devel_theme() { - return array( - 'devel_querylog' => array( - 'variables' => array('header' => array(), 'rows' => array()), - ), - 'devel_querylog_row' => array( - 'variables' => array('row' => array()), - ), - ); -} - -/** - * Implementation of hook_init(). - */ -function devel_init() { - if (!devel_silent()) { - if (user_access('access devel information')) { - devel_set_handler(variable_get('devel_error_handler', DEVEL_ERROR_HANDLER_STANDARD)); - // We want to include the class early so that anyone may call krumo() as needed. See http://krumo.sourceforge.net/ - has_krumo(); - - // See http://www.firephp.org/HQ/Install.htm - $path = NULL; - if (@include_once('fb.php')) { - // FirePHPCore is in include_path. Probably a PEAR installation. - $path = ''; - } - elseif (module_exists('libraries')) { - // Support Libraries API - http://drupal.org/project/libraries - $firephp_path = libraries_get_path('FirePHPCore') . '/lib/FirePHPCore/'; - $chromephp_path = libraries_get_path('chromephp'); - } - else { - $firephp_path = './'. drupal_get_path('module', 'devel') .'/FirePHPCore/lib/FirePHPCore/'; - $chromephp_path = './' . drupal_get_path('module', 'devel') .'/chromephp'; - } - - // include FirePHP if exists... - if (file_exists($firephp_path .'fb.php')) { - include_once $firephp_path .'fb.php'; - include_once $firephp_path .'FirePHP.class.php'; - } - - // include ChromePHP if exists... - if (file_exists($chromephp_path . '/ChromePhp.php')) { - include_once $chromephp_path . '/ChromePhp.php'; - } - - - // Add CSS for query log if should be displayed. - if (variable_get('devel_query_display', 0)) { - drupal_add_css(drupal_get_path('module', 'devel') .'/devel.css'); - drupal_add_js(drupal_get_path('module', 'devel'). '/devel.js'); - } - } - } - if (variable_get('devel_rebuild_theme_registry', FALSE)) { - drupal_theme_rebuild(); - if (flood_is_allowed('devel_rebuild_registry_warning', 1)) { - flood_register_event('devel_rebuild_registry_warning'); - if (!devel_silent() && user_access('access devel information')) { - drupal_set_message(t('The theme registry is being rebuilt on every request. Remember to turn off this feature on production websites.', array("!url" => url('admin/config/development/devel')))); - } - } - } -} - -function devel_set_message($msg, $type = NULL) { - $function = function_exists('drush_log') ? 'drush_log' : 'drupal_set_message'; - $function($msg, $type); -} - -// Return boolean. No need for cache here. -function has_krumo() { - // see README.txt or just download from http://krumo.sourceforge.net/ - @include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'devel') .'/krumo/class.krumo.php'; - return function_exists('krumo') && !drupal_is_cli(); -} - -/** - * Decide whether or not to print a debug variable using krumo(). - * - * @param $input - * @return boolean - */ -function merits_krumo($input) { - return (is_object($input) || is_array($input)) && has_krumo() && variable_get('devel_krumo_skin', '') != 'disabled'; -} - -/** - * Calls the http://www.firephp.org/ fb() function if it is found. - * - * @return void - */ -function dfb() { - if (function_exists('fb') && user_access('access devel information') && !headers_sent()) { - $args = func_get_args(); - call_user_func_array('fb', $args); - } -} - -/** - * Calls dfb() to output a backtrace. - */ -function dfbt($label) { - dfb($label, FirePHP::TRACE); -} - -/** - * Wrapper for ChromePHP Class log method - */ -function dcp() { - if (class_exists('ChromePhp') && user_access('access devel information')) { - $args = func_get_args(); - call_user_func_array(array('ChromePhp', 'log'), $args); - } -} - -/** - * Implements hook_watchdog(). - */ -function devel_watchdog(array $log_entry) { - if (class_exists('FirePHP') && !drupal_is_cli()) { - switch ($log_entry['severity']) { - case WATCHDOG_EMERGENCY: - case WATCHDOG_ALERT: - case WATCHDOG_CRITICAL: - case WATCHDOG_ERROR: - $type = FirePHP::ERROR; - break; - case WATCHDOG_WARNING: - $type = FirePHP::WARN; - break; - case WATCHDOG_NOTICE: - case WATCHDOG_INFO: - $type = FirePHP::INFO; - break; - case WATCHDOG_DEBUG: - DEFAULT: - $type = FirePHP::LOG; - } - } - else { - $type = 'watchdog'; - } - $function = function_exists('decode_entities') ? 'decode_entities' : 'html_entity_decode'; - $watchdog = array( - 'type' => $log_entry['type'], - 'message' => $function(strtr($log_entry['message'], (array)$log_entry['variables'])), - ); - if (isset($log_entry['link'])) { - $watchdog['link'] = $log_entry['link']; - } - dfb($watchdog, $type); -} - -function devel_set_handler($handler) { - switch ($handler) { - case DEVEL_ERROR_HANDLER_STANDARD: - // do nothing - break; - case DEVEL_ERROR_HANDLER_BACKTRACE: - if (has_krumo()) { - set_error_handler('backtrace_error_handler'); - } - break; - case DEVEL_ERROR_HANDLER_NONE: - restore_error_handler(); - break; - } -} - -function devel_silent() { - // isset($_GET['q']) is needed when calling the front page. q is not set. - // Don't interfere with private files/images. - return - function_exists('drupal_is_cli') && drupal_is_cli() || - (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'ApacheBench') !== FALSE) || - !empty($_REQUEST['XDEBUG_PROFILE']) || - isset($GLOBALS['devel_shutdown']) || - strstr($_SERVER['PHP_SELF'], 'update.php') || - (isset($_GET['q']) && ( - in_array($_GET['q'], array( 'admin/content/node-settings/rebuild')) || - substr($_GET['q'], 0, strlen('system/files')) == 'system/files' || - substr($_GET['q'], 0, strlen('batch')) == 'batch' || - substr($_GET['q'], 0, strlen('file/ajax')) == 'file/ajax') - ); -} - -function devel_xhprof_enable() { - if (devel_xhprof_is_enabled()) { - if ($path = variable_get('devel_xhprof_directory', '')) { - include_once $path . '/xhprof_lib/utils/xhprof_lib.php'; - include_once $path . '/xhprof_lib/utils/xhprof_runs.php'; - // @todo: consider a variable per-flag instead. - xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); - } - } -} - -function devel_xhprof_is_enabled() { - return extension_loaded('xhprof') && variable_get('devel_xhprof_enabled', FALSE); -} - -/** - * Implementation of hook_boot(). Runs even for cached pages. - */ -function devel_boot() { - // Initialize XHProf. - devel_xhprof_enable(); - - if (!devel_silent()) { - if (variable_get('dev_mem', 0)) { - global $memory_init; - $memory_init = memory_get_usage(); - } - - if (devel_query_enabled()) { - @include_once DRUPAL_ROOT . '/includes/database/log.inc'; - Database::startLog('devel');; - } - } - - // We need user_access() in the shutdown function. make sure it gets loaded. - // Also prime the drupal_get_filename() static with user.module's location to - // avoid a stray query. - drupal_get_filename('module', 'user', 'modules/user/user.module'); - drupal_load('module', 'user'); - drupal_register_shutdown_function('devel_shutdown'); -} - -function backtrace_error_handler($error_level, $message, $filename, $line, $context) { - // Hide stack trace and parameters from unqualified users. - if (!user_access('access devel information')) { - return _drupal_error_handler($error_level, $message, $filename, $line, $context); - } - // Don't respond to the error if it was suppressed with a '@' - if (error_reporting() == 0) { - return; - } - // Don't respond to warning caused by ourselves. - if (preg_match('#Cannot modify header information - headers already sent by \\([^\\)]*[/\\\\]devel[/\\\\]#', $message)) { - return; - } - if ($error_level & error_reporting()) { - // Only write each distinct NOTICE message once, as repeats do not give any - // further information and can choke the page output. - if ($error_level == E_NOTICE) { - static $written = array(); - if (!empty($written[$line][$filename][$message])) { - return; - } - $written[$line][$filename][$message] = TRUE; - } - - require_once DRUPAL_ROOT . '/includes/errors.inc'; - $types = drupal_error_levels(); - $type = $types[$error_level]; - $backtrace = debug_backtrace(); - array_shift($backtrace); - $variables = array('%error' => $type[0], '%message' => $message, '%function' => $backtrace[0]['function'] .'()', '%file' => $filename, '%line' => $line); - $counter = 0; - - if (variable_get('error_level', 1) == 1) { - foreach ($backtrace as $call) { - $nicetrace[$call['function'] . ''] = $call; - } - print t('%error: %message in %function (line %line of %file).', $variables) ." =>\n"; - krumo($nicetrace); - } - - watchdog('php', '%error: %message in %function (line %line of %file).', $variables, $type[1]); - } -} - -/** - * Implement hook_permission(). - */ -function devel_permission() { - return array( - 'access devel information' => array( - 'description' => t('View developer output like variable printouts, query log, etc.'), - 'title' => t('Access developer information'), - 'restrict access' => TRUE, - ), - 'execute php code' => array( - 'title' => t('Execute PHP code'), - 'description' => t('Run arbitrary PHP from a block.'), - 'restrict access' => TRUE, - ), - 'switch users' => array( - 'title' => t('Switch users'), - 'description' => t('Become any user on the site with just a click.'), - 'restrict access' => TRUE, - ), - 'display source code' => array( - 'title' => t('Display source code'), - 'description' => t('View the site\'s php source code.'), - 'restrict access' => TRUE, - ), - ); -} - -function devel_block_info() { - $blocks['execute_php'] = array( - 'info' => t('Execute PHP'), - 'cache' => DRUPAL_NO_CACHE, - ); - $blocks['switch_user'] = array( - 'info' => t('Switch user'), - 'cache' => DRUPAL_NO_CACHE, - ); - return $blocks; -} - -/** - * Implementation of hook_block_configure(). - */ -function devel_block_configure($delta) { - if ($delta == 'switch_user') { - $form['list_size'] = array( - '#type' => 'textfield', - '#title' => t('Number of users to display in the list'), - '#default_value' => variable_get('devel_switch_user_list_size', 10), - '#size' => '3', - '#maxlength' => '4', - ); - $form['include_anon'] = array( - '#type' => 'checkbox', - '#title' => t('Include %anonymous', array('%anonymous' => format_username(drupal_anonymous_user()))), - '#default_value' => variable_get('devel_switch_user_include_anon', FALSE), - ); - $form['show_form'] = array( - '#type' => 'checkbox', - '#title' => t('Allow entering any user name'), - '#default_value' => variable_get('devel_switch_user_show_form', TRUE), - ); - return $form; - } -} - -function devel_block_save($delta, $edit = array()) { - if ($delta == 'switch_user') { - variable_set('devel_switch_user_list_size', $edit['list_size']); - variable_set('devel_switch_user_include_anon', $edit['include_anon']); - variable_set('devel_switch_user_show_form', $edit['show_form']); - } -} - -function devel_block_view($delta) { - $block = array(); - switch ($delta) { - case 'switch_user': - $block = devel_block_switch_user(); - break; - - case 'execute_php': - if (user_access('execute php code')) { - $block['content'] = drupal_get_form('devel_execute_block_form'); - } - break; - } - return $block; -} - -function devel_block_switch_user() { - $links = devel_switch_user_list(); - if (!empty($links) || user_access('switch users')) { - $block['subject'] = t('Switch user'); - $build['devel_links'] = array('#theme' => 'links', '#links' => $links); - if (variable_get('devel_switch_user_show_form', TRUE)) { - $build['devel_form'] = drupal_get_form('devel_switch_user_form'); - } - $block['content'] = $build; - return $block; - } -} - -function devel_switch_user_list() { - global $user; - - $links = array(); - if (user_access('switch users')) { - $list_size = variable_get('devel_switch_user_list_size', 10); - if ($include_anon = ($user->uid && variable_get('devel_switch_user_include_anon', FALSE))) { - --$list_size; - } - $dest = drupal_get_destination(); - // Try to find at least $list_size users that can switch. - // Inactive users are omitted from all of the following db selects. - $roles = user_roles(TRUE, 'switch users'); - $query = db_select('users', 'u'); - $query->addField('u', 'uid'); - $query->addField('u', 'access'); - $query->distinct(); - $query->condition('u.uid', 0, '>'); - $query->condition('u.status', 0, '>'); - $query->orderBy('u.access', 'DESC'); - $query->range(0, $list_size); - - if (!isset($roles[DRUPAL_AUTHENTICATED_RID])) { - $query->leftJoin('users_roles', 'r', 'u.uid = r.uid'); - $or_condition = db_or(); - $or_condition->condition('u.uid', 1); - if (!empty($roles)) { - $or_condition->condition('r.rid', array_keys($roles), 'IN'); - } - $query->condition($or_condition); - } - - $uids = $query->execute()->fetchCol(); - $accounts = user_load_multiple($uids); - - foreach ($accounts as $account) { - $links[$account->uid] = array( - 'title' => drupal_placeholder(format_username($account)), - 'href' => 'devel/switch/'. $account->name, - 'query' => $dest, - 'attributes' => array('title' => t('This user can switch back.')), - 'html' => TRUE, - 'last_access' => $account->access, - ); - } - $num_links = count($links); - if ($num_links < $list_size) { - // If we don't have enough, add distinct uids until we hit $list_size. - $uids = db_query_range('SELECT uid FROM {users} WHERE uid > 0 AND uid NOT IN (:uids) AND status > 0 ORDER BY access DESC', 0, $list_size - $num_links, array(':uids' => array_keys($links)))->fetchCol(); - $accounts = user_load_multiple($uids); - foreach ($accounts as $account) { - $links[$account->uid] = array( - 'title' => format_username($account), - 'href' => 'devel/switch/'. $account->name, - 'query' => $dest, - 'attributes' => array('title' => t('Caution: this user will be unable to switch back.')), - 'last_access' => $account->access, - ); - } - uasort($links, '_devel_switch_user_list_cmp'); - } - if ($include_anon) { - $link = array( - 'title' => format_username(drupal_anonymous_user()), - 'href' => 'devel/switch', - 'query' => $dest, - 'attributes' => array('title' => t('Caution: the anonymous user will be unable to switch back.')), - ); - if (user_access('switch users', drupal_anonymous_user())) { - $link['title'] = drupal_placeholder($link['title']); - $link['attributes'] = array('title' => t('This user can switch back.')); - $link['html'] = TRUE; - } - $links[] = $link; - } - } - return $links; -} - -/** - * Comparison helper function for uasort() in devel_switch_user_list(). - * - * Sorts the Switch User links by the user's last access timestamp. - */ -function _devel_switch_user_list_cmp($a, $b) { - return $b['last_access'] - $a['last_access']; -} - -function devel_switch_user_form() { - $form['username'] = array( - '#type' => 'textfield', - '#description' => t('Enter username'), - '#autocomplete_path' => 'user/autocomplete', - '#maxlength' => USERNAME_MAX_LENGTH, - '#size' => 16, - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Switch'), - ); - return $form; - -} - -function devel_doc_function_form() { - $version = devel_get_core_version(VERSION); - $form['function'] = array( - '#type' => 'textfield', - '#description' => t('Enter function name for api lookup'), - '#size' => 16, - '#maxlength' => 255, - ); - $form['version'] = array('#type' => 'value', '#value' => $version); - $form['submit_button'] = array( - '#type' => 'submit', - '#value' => t('Submit'), - ); - return $form; -} - -function devel_doc_function_form_submit($form, &$form_state) { - $version = $form_state['values']['version']; - $function = $form_state['values']['function']; - $api = variable_get('devel_api_url', 'api.drupal.org'); - $form_state['redirect'] = "http://$api/api/function/$function/$version"; -} - -function devel_switch_user_form_validate($form, &$form_state) { - if (!$account = user_load_by_name($form_state['values']['username'])) { - form_set_error('username', t('Username not found')); - } -} - -function devel_switch_user_form_submit($form, &$form_state) { - $form_state['redirect'] = 'devel/switch/'. $form_state['values']['username']; -} - -/** - * Implements hook_drupal_goto_alter(). - */ -function devel_drupal_goto_alter($path, $options, $http_response_code) { - global $user; - - if (isset($path) && !devel_silent()) { - // The page we are leaving is a drupal_goto(). Present a redirection page - // so that the developer can see the intermediate query log. - // We don't want to load user module here, so keep function_exists() call. - if (isset($user) && function_exists('user_access') && user_access('access devel information') && variable_get('devel_redirect_page', 0)) { - $destination = function_exists('url') ? url($path, $options) : $path; - $output = t_safe('

The user is being redirected to @destination.

', array('@destination' => $destination)); - drupal_deliver_page($output); - - // Don't allow the automatic redirect to happen. - exit(); - } - else { - $GLOBALS['devel_redirecting'] = TRUE; - } - } -} - -/** - * Implements hook_library_alter(). - */ -function devel_library_alter(&$libraries, $module) { - // Use an uncompressed version of jQuery for debugging. - if ($module === 'system' && variable_get('devel_use_uncompressed_jquery', FALSE) && isset($libraries['jquery'])) { - // Make sure we're not changing the jQuery version used on the site. - if (version_compare($libraries['jquery']['version'], '1.4.4', '=')) { - $libraries['jquery']['js'] = array( - drupal_get_path('module', 'devel') . '/jquery-1.4.4-uncompressed.js' => array('weight' => JS_LIBRARY - 20), - ); - } - else { - if (!devel_silent() && user_access('access devel information')) { - drupal_set_message(t('jQuery could not be replaced with an uncompressed version of 1.4.4, because jQuery @version is running on the site.', array('@version' => $libraries['jquery']['version']))); - } - - } - } -} - -/** - * See devel_start() which registers this function as a shutdown function. - */ -function devel_shutdown() { - // Register the real shutdown function so it runs later than other shutdown functions. - drupal_register_shutdown_function('devel_shutdown_real'); - - global $devel_run_id; - $devel_run_id = devel_xhprof_is_enabled() ? devel_shutdown_xhprof(): NULL; - if ($devel_run_id && function_exists('drush_log')) { - drush_log('xhprof link: ' . devel_xhprof_link($devel_run_id, 'url'), 'notice'); - } -} - -function devel_page_alter($page) { - if (variable_get('devel_page_alter', FALSE) && user_access('access devel information')) { - dpm($page, 'page'); - } -} - -// AJAX render reponses sometimers are sent as text/html so we have to catch them here -// and disable our footer stuff. -function devel_ajax_render_alter() { - $GLOBALS['devel_shutdown'] = FALSE; -} - -/** - * See devel_shutdown() which registers this function as a shutdown function. Displays developer information in the footer. - */ -function devel_shutdown_real() { - global $user; - $output = $txt = ''; - - // Set $GLOBALS['devel_shutdown'] = FALSE in order to supress the - // devel footer for a page. Not necessary if your page outputs any - // of the Content-type http headers tested below (e.g. text/xml, - // text/javascript, etc). This is is advised where applicable. - if (!devel_silent() && !isset($GLOBALS['devel_shutdown']) && !isset($GLOBALS['devel_redirecting'])) { - // Try not to break non html pages. - if (function_exists('drupal_get_http_header')) { - $header = drupal_get_http_header('content-type'); - if ($header) { - $formats = array('xml', 'javascript', 'json', 'plain', 'image', 'application', 'csv', 'x-comma-separated-values'); - foreach ($formats as $format) { - if (strstr($header, $format)) { - return; - } - } - } - } - - if (isset($user) && user_access('access devel information')) { - $queries = (devel_query_enabled() ? Database::getLog('devel', 'default') : NULL); - $output .= devel_shutdown_summary($queries); - $output .= devel_shutdown_query($queries); - } - - if ($output) { - // TODO: gzip this text if we are sending a gzip page. see drupal_page_header(). - // For some reason, this is not actually printing for cached pages even though it gets executed - // and $output looks good. - print $output; - } - } -} - -function devel_shutdown_summary($queries) { - $sum = 0; - $output = ''; - list($counts, $query_summary) = devel_query_summary($queries); - - if (variable_get('devel_query_display', FALSE)) { - // Query log on. - $output .= $query_summary; - $output .= t_safe(' Queries exceeding @threshold ms are highlighted.', array('@threshold' => variable_get('devel_execution', 5))); - } - - if (variable_get('dev_timer', 0)) { - $output .= devel_timer(); - } - - if (devel_xhprof_is_enabled()) { - $output .= ' ' . devel_xhprof_link($GLOBALS['devel_run_id']); - } - - $output .= devel_shutdown_memory(); - - if ($output) { - return '
' . $output . '
'; - } -} - -function devel_shutdown_xhprof() { - $namespace = variable_get('site_name', ''); // namespace for your application - $xhprof_data = xhprof_disable(); - $xhprof_runs = new XHProfRuns_Default(); - return $xhprof_runs->save_run($xhprof_data, $namespace); -} - -function devel_xhprof_link($run_id, $type = 'link') { - // @todo: render results from within Drupal. - $xhprof_url = variable_get('devel_xhprof_url', ''); - $namespace = variable_get('site_name', ''); // namespace for your application - if ($xhprof_url) { - $url = $xhprof_url . "/index.php?run=$run_id&source=$namespace"; - return $type == 'url' ? $url : t('XHProf output. ', array('@xhprof' => $url)); - } -} - -function devel_shutdown_memory() { - global $memory_init; - - if (variable_get('dev_mem', FALSE)) { - $memory_shutdown = memory_get_usage(); - $args = array('@memory_boot' => round($memory_init / 1024 / 1024, 2), '@memory_shutdown' => round($memory_shutdown / 1024 / 1024, 2), '@memory_peak' => round(memory_get_peak_usage(TRUE) / 1024 / 1024, 2)); - $msg = ' Memory used at: devel_boot()=@memory_boot MB, devel_shutdown()=@memory_shutdown MB, PHP peak=@memory_peak MB.'; - // theme() may not be available. not t() either. - return t_safe($msg, $args); - } -} - -function devel_shutdown_query($queries) { - if (!empty($queries)) { - if (function_exists('theme_get_registry') && theme_get_registry()) { - // Safe to call theme('table). - list($counts, $query_summary) = devel_query_summary($queries); - $output = devel_query_table($queries, $counts); - - // Save all queries to a file in temp dir. Retrieved via AJAX. - devel_query_put_contents($queries); - } - else { - $output = '' . dprint_r($queries, TRUE); - } - return $output; - } -} - -// Write the variables information to the a file. It will be retrieved on demand via AJAX. -function devel_query_put_contents($queries) { - $request_id = mt_rand(1, 1000000); - $path = "temporary://devel_querylog"; - - // Create the devel_querylog within the temp folder, if needed. - file_prepare_directory($path, FILE_CREATE_DIRECTORY); - - // Occassionally wipe the querylog dir so that files don't accumulate. - if (mt_rand(1, 1000) == 401) { - devel_empty_dir($path); - } - - $path .= "/$request_id.txt"; - $path = file_stream_wrapper_uri_normalize($path); - // Save queries as a json array. Suppress errors due to recursion () - file_put_contents($path, @json_encode($queries)); - $settings['devel'] = array( - // A random string that is sent to the browser. It enables the AJAX to retrieve queries from this request. - 'request_id' => $request_id, - ); - print '\n"; -} - -function devel_query_enabled() { - return method_exists('Database', 'getLog') && variable_get('devel_query_display', FALSE); -} - -function devel_query_summary($queries) { - if (variable_get('devel_query_display', FALSE) && is_array($queries)) { - $sum = 0; - foreach ($queries as $query) { - $text[] = $query['query']; - $sum += $query['time']; - } - $counts = array_count_values($text); - return array($counts, t_safe('Executed @queries queries in @time ms.', array('@queries' => count($queries), '@time' => round($sum * 1000, 2)))); - } -} - -function t_safe($string, $args) { - // get_t caused problems here with theme registry after changing on admin/build/modules. the theme_get_registry call is needed. - if (function_exists('t') && function_exists('theme_get_registry')) { - theme_get_registry(); - return t($string, $args); - } - else { - strtr($string, $args); - } -} - -function devel_get_core_version($version) { - $version_parts = explode('.', $version); - // Map from 4.7.10 -> 4.7 - if ($version_parts[0] < 5) { - return $version_parts[0] .'.'. $version_parts[1]; - } - // Map from 5.5 -> 5 or 6.0-beta2 -> 6 - else { - return $version_parts[0]; - } -} - -// See http://drupal.org/node/126098 -function devel_is_compatible_optimizer() { - ob_start(); - phpinfo(); - $info = ob_get_contents(); - ob_end_clean(); - - // Match the Zend Optimizer version in the phpinfo information - $found = preg_match('/Zend Optimizer v([0-9])\.([0-9])\.([0-9])/', $info, $matches); - - if ($matches) { - $major = $matches[1]; - $minor = $matches[2]; - $build = $matches[3]; - - if ($major >= 3) { - if ($minor >= 3) { - return TRUE; - } - elseif ($minor == 2 && $build >= 8) { - return TRUE; - } - else { - return FALSE; - } - } - else { - return FALSE; - } - } - else { - return TRUE; - } -} - -/** - * Generates the execute block form. - */ -function devel_execute_block_form() { - $form['execute'] = array( - '#type' => 'fieldset', - '#title' => t('Execute PHP Code'), - '#collapsible' => TRUE, - '#collapsed' => (!isset($_SESSION['devel_execute_code'])), - ); - $form['#submit'] = array('devel_execute_form_submit'); - return array_merge_recursive($form, devel_execute_form()); -} - -/** - * Generates the execute form. - */ -function devel_execute_form() { - $form['execute']['code'] = array( - '#type' => 'textarea', - '#title' => t('PHP code to execute'), - '#description' => t('Enter some code. Do not use <?php ?> tags.'), - '#default_value' => (isset($_SESSION['devel_execute_code']) ? $_SESSION['devel_execute_code'] : ''), - '#rows' => 20, - ); - $form['execute']['op'] = array('#type' => 'submit', '#value' => t('Execute')); - $form['#redirect'] = FALSE; - if (isset($_SESSION['devel_execute_code'])) { - unset($_SESSION['devel_execute_code']); - } - return $form; -} - -/** - * Process PHP execute form submissions. - */ -function devel_execute_form_submit($form, &$form_state) { - ob_start(); - print eval($form_state['values']['code']); - $_SESSION['devel_execute_code'] = $form_state['values']['code']; - dsm(ob_get_clean()); -} - -/** - * Switch from original user to another user and back. - * We don't call session_save_session() because we really want to change users. Usually unsafe! - * - * @param $name The username to switch to, or NULL to log out. - */ -function devel_switch_user($name = NULL) { - global $user; - - if ($user->uid) { - module_invoke_all('user_logout', $user); - } - if (isset($name) && $account = user_load_by_name($name)) { - $old_uid = $user->uid; - $user = $account; - $user->timestamp = time() - 9999; - if (!$old_uid) { - // Switch from anonymous to authorized. - drupal_session_regenerate(); - } - $edit = array(); - user_module_invoke('login', $edit, $user); - } - elseif ($user->uid) { - session_destroy(); - } - drupal_goto(); -} - -/** - * Print an object or array using either Krumo (if installed) or devel_print_object() - * - * @param $object - * array or object to print - * @param $prefix - * prefixing for output items - */ -function kdevel_print_object($object, $prefix = NULL) { - return has_krumo() ? krumo_ob($object) : devel_print_object($object, $prefix); -} - -// Save krumo htlm using output buffering. -function krumo_ob($object) { - ob_start(); - krumo($object); - $output = ob_get_contents(); - ob_end_clean(); - return $output; -} - -/** - * Display an object or array - * - * @param $object - * the object or array - * @param $prefix - * prefix for the output items (example "$node->", "$user->", "$") - * @param $header - * set to FALSE to suppress the output of the h3 - */ -function devel_print_object($object, $prefix = NULL, $header = TRUE) { - drupal_add_css(drupal_get_path('module', 'devel') .'/devel.css'); - $output = '
'; - if ($header) { - $output .= '

'. t('Display of !type !obj', array('!type' => str_replace(array('$', '->'), '', $prefix), '!obj' => gettype($object))) .'

'; - } - $output .= _devel_print_object($object, $prefix); - $output .= '
'; - return $output; -} - -/** - * Recursive (and therefore magical) function goes through an array or object and - * returns a nicely formatted listing of its contents. - * - * @param $obj - * array or object to recurse through - * @param $prefix - * prefix for the output items (example "$node->", "$user->", "$") - * @param $parents - * used by recursion - * @param $object - * used by recursion - * @return - * fomatted html - * - * @todo - * currently there are problems sending an array with a varname - */ -function _devel_print_object($obj, $prefix = NULL, $parents = NULL, $object = FALSE) { - static $root_type, $out_format; - - // TODO: support objects with references. See http://drupal.org/node/234581. - if (isset($obj->view)) { - return; - } - - if (!isset($root_type)) { - $root_type = gettype($obj); - if ($root_type == 'object') { - $object = TRUE; - } - } - - if (is_object($obj)) { - $obj = (array)$obj; - } - if (is_array($obj)) { - $output = "
\n"; - foreach ($obj as $field => $value) { - if ($field == 'devel_flag_reference') { - continue; - } - if (!is_null($parents)) { - if ($object) { - $field = $parents .'->'. $field; - } - else { - if (is_int($field)) { - $field = $parents .'['. $field .']'; - } - else { - $field = $parents .'[\''. $field .'\']'; - } - } - } - - $type = gettype($value); - - $show_summary = TRUE; - $summary = NULL; - if ($show_summary) { - switch ($type) { - case 'string' : - case 'float' : - case 'integer' : - if (strlen($value) == 0) { - $summary = t("{empty}"); - } - elseif (strlen($value) < 40) { - $summary = htmlspecialchars($value); - } - else { - $summary = format_plural(drupal_strlen($value), '1 character', '@count characters'); - } - break; - case 'array' : - case 'object' : - $summary = format_plural(count((array)$value), '1 element', '@count elements'); - break; - case 'boolean' : - $summary = $value ? t('TRUE') : t('FALSE'); - break; - } - } - if (!is_null($summary)) { - $typesum = '('. $type .', '. $summary .')'; - } - else { - $typesum = '('. $type .')'; - } - - $output .= ''; - $output .= "
{$prefix}{$field} $typesum
\n"; - $output .= "
\n"; - // Check for references. - if (is_array($value) && isset($value['devel_flag_reference'])) { - $value['devel_flag_reference'] = TRUE; - } - // Check for references to prevent errors from recursions. - if (is_array($value) && isset($value['devel_flag_reference']) && !$value['devel_flag_reference']) { - $value['devel_flag_reference'] = FALSE; - $output .= _devel_print_object($value, $prefix, $field); - } - elseif (is_object($value)) { - $value->devel_flag_reference = FALSE; - $output .= _devel_print_object((array)$value, $prefix, $field, TRUE); - } - else { - $value = is_bool($value) ? ($value ? 'TRUE' : 'FALSE') : $value; - $output .= htmlspecialchars(print_r($value, TRUE)) ."\n"; - } - $output .= "
\n"; - } - $output .= "
\n"; - } - return $output; -} - -/** - * Adds a table at the bottom of the page cataloguing data on all the database queries that were made to - * generate the page. - */ -function devel_query_table($queries, $counts) { - $version = devel_get_core_version(VERSION); - $header = array ('ms', '#', 'where', 'ops', 'query', 'target'); - $i = 0; - $api = variable_get('devel_api_url', 'api.drupal.org'); - foreach ($queries as $query) { - $function = !empty($query['caller']['class']) ? $query['caller']['class'] . '::' : ''; - $function .= $query['caller']['function']; - $count = isset($counts[$query['query']]) ? $counts[$query['query']] : 0; - - $diff = round($query['time'] * 1000, 2); - if ($diff > variable_get('devel_execution', 5)) { - $cell[$i][] = array ('data' => $diff, 'class' => 'marker'); - } - else { - $cell[$i][] = $diff; - } - $cell[$i][] = $count; - $cell[$i][] = l($function, "http://$api/api/function/$function/$version"); - $ops[] = l('P', '', array('attributes' => array('title' => 'Show placeholders', 'class' => 'dev-placeholders', 'qid' => $i))); - $ops[] = l('A', '', array('attributes' => array('title' => 'Show arguments', 'class' => 'dev-arguments', 'qid' => $i))); - // EXPLAIN only valid for select queries. - if (strpos($query['query'], 'UPDATE') === FALSE && strpos($query['query'], 'INSERT') === FALSE && strpos($query['query'], 'DELETE') === FALSE) { - $ops[] = l('E', '', array('attributes' => array('title' => 'Show EXPLAIN', 'class' => 'dev-explain', 'qid' => $i))); - } - $cell[$i][] = implode(' ', $ops); - // 3 divs for each variation of the query. Last 2 are hidden by default. - $placeholders = '
' . check_plain($query['query']) . "
\n"; - $args = '' . "\n"; - $explain = '' . "\n"; - $cell[$i][] = array( - 'id' => "devel-query-$i", - 'data' => $placeholders . $args . $explain, - ); - $cell[$i][] = $query['target']; - $i++; - unset($diff, $count, $ops); - } - if (variable_get('devel_query_sort', DEVEL_QUERY_SORT_BY_SOURCE)) { - usort($cell, '_devel_table_sort'); - } - return theme('devel_querylog', array('header' => $header, 'rows' => $cell)); -} - -function theme_devel_querylog_row($variables) { - $row = $variables['row']; - $i = 0; - $output = ''; - foreach ($row as $cell) { - $i++; - - if (is_array($cell)) { - $data = !empty($cell['data']) ? $cell['data'] : ''; - unset($cell['data']); - $attr = $cell; - } - else { - $data = $cell; - $attr = array(); - } - - if (!empty($attr['class'])) { - $attr['class'] .= " cell cell-$i"; - } - else { - $attr['class'] = "cell cell-$i"; - } - $attr = drupal_attributes($attr); - - $output .= "
$data
"; - } - return $output; -} - -function theme_devel_querylog($variables) { - $header = $variables['header']; - $rows = $variables['rows']; - $output = ''; - if (!empty($header)) { - $output .= "
"; - $output .= theme('devel_querylog_row', array('row' => $header)); - $output .= "
"; - } - if (!empty($rows)) { - $i = 0; - foreach ($rows as $row) { - $i++; - $zebra = ($i % 2) == 0 ? 'even' : 'odd'; - $output .= "
"; - $output .= theme('devel_querylog_row', array('row' => $row)); - $output .= "
"; - } - } - return $output; -} - -function _devel_table_sort($a, $b) { - $a = is_array($a[0]) ? $a[0]['data'] : $a[0]; - $b = is_array($b[0]) ? $b[0]['data'] : $b[0]; - if ($a < $b) { - return 1; - } - if ($a > $b) { - return -1; - } - return 0; -} - -/** - * Displays page execution time at the bottom of the page. - */ -function devel_timer() { - $time = timer_read('page'); - return t_safe(' Page execution time was @time ms.', array('@time' => $time)); -} - -// An alias for drupal_debug(). -function dd($data, $label = NULL) { - return drupal_debug($data, $label); -} - -// Log any variable to a drupal_debug.log in the site's temp directory. -// See http://drupal.org/node/314112 -function drupal_debug($data, $label = NULL) { - ob_start(); - print_r($data); - $string = ob_get_clean(); - if ($label) { - $out = $label .': '. $string; - } - else { - $out = $string; - } - $out .= "\n"; - - // The temp directory does vary across multiple simpletest instances. - $file = 'temporary://drupal_debug.txt'; - if (file_put_contents($file, $out, FILE_APPEND) === FALSE) { - drupal_set_message(t('The file could not be written.'), 'error'); - return FALSE; - } -} - -/** - * Prints the arguments passed into the current function - */ -function dargs($always = TRUE) { - static $printed; - if ($always || !$printed) { - $bt = debug_backtrace(); - print kdevel_print_object($bt[1]['args']); - $printed = TRUE; - } -} - -/** - * Print a SQL string from a DBTNG Query object. Includes quoted arguments. - * - * @param $query - * A Query object. - * @param $return - * Whether to return or print the string. Default to FALSE. - * @param $name - * Optional name for identifying the output. - */ -function dpq($query, $return = FALSE, $name = NULL) { - if (user_access('access devel information')) { - $query->preExecute(); - $sql = (string) $query; - $quoted = array(); - $connection = Database::getConnection(); - foreach ((array)$query->arguments() as $key => $val) { - $quoted[$key] = $connection->quote($val); - } - $sql = strtr($sql, $quoted); - if ($return) { - return $sql; - } - else { - dpm($sql, $name); - } - } -} - -/** - * Print a variable to the 'message' area of the page. Uses drupal_set_message() - */ -function dpm($input, $name = NULL) { - if (user_access('access devel information')) { - $export = kprint_r($input, TRUE, $name); - drupal_set_message($export); - } -} - -/** - * drupal_var_export() a variable to the 'message' area of the page. Uses drupal_set_message() - */ -function dvm($input, $name = NULL) { - if (user_access('access devel information')) { - $export = dprint_r($input, TRUE, $name, 'drupal_var_export', FALSE); - drupal_set_message($export); - } -} - -// legacy function that was poorly named. use dpm() instead, since the 'p' maps to 'print_r' -function dsm($input, $name = NULL) { - dpm($input, $name); -} - -/** - * An alias for dprint_r(). Saves carpal tunnel syndrome. - */ -function dpr($input, $return = FALSE, $name = NULL) { - return dprint_r($input, $return, $name); -} - -/** - * An alias for kprint_r(). Saves carpal tunnel syndrome. - */ -function kpr($input, $return = FALSE, $name = NULL) { - return kprint_r($input, $return, $name); -} - -/** - * Like dpr, but uses drupal_var_export() instead - */ -function dvr($input, $return = FALSE, $name = NULL) { - return dprint_r($input, $return, $name, 'drupal_var_export', FALSE); -} - -function kprint_r($input, $return = FALSE, $name = NULL, $function = 'print_r') { - // We do not want to krumo() strings and integers and such - if (merits_krumo($input)) { - if (user_access('access devel information')) { - return $return ? (isset($name) ? $name .' => ' : '') . krumo_ob($input) : krumo($input); - } - } - else { - return dprint_r($input, $return, $name, $function); - } -} - -/** - * Pretty-print a variable to the browser (no krumo). - * Displays only for users with proper permissions. If - * you want a string returned instead of a print, use the 2nd param. - */ -function dprint_r($input, $return = FALSE, $name = NULL, $function = 'print_r', $check= TRUE) { - if (user_access('access devel information')) { - if ($name) { - $name .= ' => '; - } - if ($function == 'drupal_var_export') { - include_once DRUPAL_ROOT . '/includes/utility.inc'; - $output = drupal_var_export($input); - } - else { - ob_start(); - $function($input); - $output = ob_get_clean(); - } - - if ($check) { - $output = check_plain($output); - } - if (count($input, COUNT_RECURSIVE) > DEVEL_MIN_TEXTAREA) { - // don't use fapi here because sometimes fapi will not be loaded - $printed_value = "'; - } - else { - $printed_value = '
'. $name . $output .'
'; - } - - if ($return) { - return $printed_value; - } - else { - print $printed_value; - } - } -} - -/** - * Prints a renderable array element to the screen using kprint_r(). - * - * #pre_render and/or #post_render pass-through callback for kprint_r(). - * - * @todo Investigate appending to #suffix. - * @todo Investigate label derived from #id, #title, #name, and #theme. - */ -function devel_render() { - $args = func_get_args(); - // #pre_render and #post_render pass the rendered $element as last argument. - kprint_r(end($args)); - // #pre_render and #post_render expect the first argument to be returned. - return reset($args); -} - -/** - * Print the function call stack. - */ -function ddebug_backtrace() { - if (user_access('access devel information')) { - $trace = debug_backtrace(); - array_shift($trace); - $count = count($trace); - foreach ($trace as $i => $call) { - $key = ($count - $i) . ': ' . $call['function']; - $rich_trace[$key] = $call; - } - if (has_krumo()) { - print krumo($rich_trace); - } - else { - dprint_r($rich_trace); - } - } -} - -// Delete all files in a dir. http://www.plus2net.com/php_tutorial/php-files-delete.php -function devel_empty_dir($dir) { - foreach (new DirectoryIterator($dir) as $fileInfo) { - unlink($fileInfo->getPathname()); - } -} - -/* - * migration related functions - */ - -/** - * Regenerate the data in node_comment_statistics table. Technique comes from - * http://www.artfulsoftware.com/infotree/queries.php?&bw=1280#101 - * - * @return void - **/ -function devel_rebuild_node_comment_statistics() { - // Empty table - db_truncate('node_comment_statistics')->execute(); - - // TODO: DBTNG. Ignore keyword is Mysql only? Is only used in the rare case when - // two comments on the same node share same timestamp. - $sql = " - INSERT IGNORE INTO {node_comment_statistics} (nid, cid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) ( - SELECT c.nid, c.cid, c.created, c.name, c.uid, c2.comment_count FROM {comment} c - JOIN ( - SELECT c.nid, MAX(c.created) AS created, COUNT(*) AS comment_count FROM {comment} c WHERE status = 1 GROUP BY c.nid - ) AS c2 ON c.nid = c2.nid AND c.created = c2.created - )"; - db_query($sql, array(':published' => COMMENT_PUBLISHED)); - - // Insert records into the node_comment_statistics for nodes that are missing. - $query = db_select('node', 'n'); - $query->leftJoin('node_comment_statistics', 'ncs', 'ncs.nid = n.nid'); - $query->addField('n', 'changed', 'last_comment_timestamp'); - $query->addField('n', 'uid', 'last_comment_uid'); - $query->addField('n', 'nid'); - $query->addExpression('0', 'comment_count'); - $query->addExpression('NULL', 'last_comment_name'); - $query->isNull('ncs.comment_count'); - - db_insert('node_comment_statistics') - ->from($query) - ->execute(); -} diff --git a/devel.pages.inc b/devel.pages.inc deleted file mode 100644 index 134a59fc596fad55a7fb96929dcfae2042e00eb3..0000000000000000000000000000000000000000 --- a/devel.pages.inc +++ /dev/null @@ -1,304 +0,0 @@ - $links)); -} - -/** - * Menu callback; clears all caches, then redirects to the previous page. - */ -function devel_cache_clear() { - drupal_flush_all_caches(); - - drupal_set_message('Cache cleared.'); - - drupal_goto(); -} - -// A menu callback. Called by the AJAX link in query log. -function devel_querylog_explain($request_id, $qid) { - if (!is_numeric($request_id)) { - return MENU_ACCESS_DENIED; - } - - $path = "temporary://devel_querylog/$request_id.txt"; - $path = file_stream_wrapper_uri_normalize($path); - $queries = json_decode(file_get_contents($path)); - $query = $queries[$qid]; - $result = db_query('EXPLAIN ' . $query->query, (array)$query->args)->fetchAllAssoc('table'); - $i = 1; - foreach ($result as $row) { - $row = (array)$row; - if ($i == 1) { - $header = array_keys($row); - } - $rows[] = array_values($row); - $i++; - } - // Print and return nothing thus avoiding page wrapper. - $output = theme('table', array('header' => $header, 'rows' => $rows)); - print $output; - $GLOBALS['devel_shutdown'] = FALSE; -} - -// A menu callback. Called by the AJAX link in query log. -function devel_querylog_arguments($request_id, $qid) { - if (!is_numeric($request_id)) { - return MENU_ACCESS_DENIED; - } - - $path = "temporary://devel_querylog/$request_id.txt"; - $path = file_stream_wrapper_uri_normalize($path); - $queries = json_decode(file_get_contents($path)); - $query = $queries[$qid]; - $conn = Database::getConnection(); - $quoted = array(); - foreach ((array)$query->args as $key => $val) { - $quoted[$key] = $conn->quote($val); - } - $output = strtr($query->query, $quoted); - - // print and return nothing thus avoiding page wrapper. - print $output; - $GLOBALS['devel_shutdown'] = FALSE; -} - -/** - * Menu callback; clear the database, resetting the menu to factory defaults. - */ -function devel_menu_rebuild() { - menu_rebuild(); - drupal_set_message(t('The menu router has been rebuilt.')); - drupal_goto(); -} - -/** - * Display a dropdown of installed modules with the option to reinstall them. - */ -function devel_reinstall($form, &$form_state) { - $output = ''; - $modules = module_list(); - sort($modules); - $options = drupal_map_assoc($modules); - $form['list'] = array( - '#type' => 'checkboxes', - '#options' => $options, - '#description' => t('Uninstall and then install the selected modules. hook_uninstall() and hook_install() will be executed and the schema version number will be set to the most recent update number. You may have to manually clear out any existing tables first if the module doesn\'t implement hook_uninstall().'), - ); - $form['submit'] = array( - '#value' => t('Reinstall'), - '#type' => 'submit', - ); - return $form; -} - -/** - * Process reinstall menu form submissions. - */ -function devel_reinstall_submit($form, &$form_state) { - // require_once './includes/install.inc'; - $modules = array_filter($form_state['values']['list']); - module_disable($modules, FALSE); - drupal_uninstall_modules($modules); - module_enable($modules, FALSE); - drupal_set_message(t('Uninstalled and installed: %names.', array('%names' => implode(', ', $modules)))); -} - -// Menu callback. -function devel_theme_registry() { - drupal_theme_initialize(); - $hooks = theme_get_registry(); - ksort($hooks); - return kprint_r($hooks, TRUE); -} - -// Menu callback. $entity_type argument not currently used in the UI. -function devel_entity_info_page($entity_type = NULL) { - $info = entity_get_info($entity_type); - ksort($info); - return kprint_r($info, TRUE); -} - -// Menu callback. -function devel_field_info_page() { - $info = field_info_fields(); - $output = kprint_r($info, TRUE, t('Fields')); - $info = field_info_instances(); - $output .= kprint_r($info, TRUE, t('Instances')); - $info = field_info_bundles(); - $output .= kprint_r($info, TRUE, t('Bundles')); - return $output; -} - -/** - * Menu callback; display all variables. - */ -function devel_variable_page() { - // We return our own $page so as to avoid blocks. - $output = drupal_get_form('devel_variable_form'); - drupal_set_page_content($output); - $page = element_info('page'); - return $page; -} - -function devel_variable_form() { - $header = array( - 'name' => array('data' => t('Name'), 'field' => 'name', 'sort' => 'asc'), - 'value' => array('data' => t('Value'), 'field' => 'value'), - 'length' => array('data' => t('Length'), 'field' => 'length'), - 'edit' => array('data' => t('Operations')), - ); - // TODO: we could get variables out of $conf but that would include hard coded ones too. ideally i would highlight overrridden/hard coded variables - $query = db_select('variable', 'v')->extend('TableSort'); - $query->fields('v', array('name', 'value')); - switch (db_driver()) { - case 'mssql': - $query->addExpression("COL_LENGTH('{variable}', 'value')", 'length'); - break; - case 'pgsql': - $query->addExpression("CONVERT(LENGTH(v.value), INTEGER)", 'length'); - break; - default: - $query->addExpression("CONVERT(LENGTH(v.value), UNSIGNED INTEGER)", 'length'); - break; - } - $result = $query - ->orderByHeader($header) - ->execute(); - - foreach ($result as $row) { - // $variables[$row->name] = ''; - $options[$row->name]['name'] = check_plain($row->name); - if (merits_krumo($row->value)) { - $value = krumo_ob(variable_get($row->name, NULL)); - } - else { - if (drupal_strlen($row->value) > 70) { - $value = check_plain(drupal_substr($row->value, 0, 65)) .'...'; - } - else { - $value = check_plain($row->value); - } - } - $options[$row->name]['value'] = $value; - $options[$row->name]['length'] = $row->length; - $options[$row->name]['edit'] = l(t('Edit'), "devel/variable/edit/$row->name"); - } - $form['variables'] = array( - '#type' => 'tableselect', - '#header' => $header, - '#options' => $options, - '#empty' => t('No variables.'), - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Delete'), - ); - - // krumo($form); - return $form; -} - -function devel_variable_form_submit($form, &$form_state) { - $deletes = array_filter($form_state['values']['variables']); - array_walk($deletes, 'variable_del'); - if (count($deletes)) { - drupal_set_message(format_plural(count($deletes), 'One variable deleted.', '@count variables deleted.')); - } -} - -function devel_variable_edit($form, &$form_state, $name) { - $value = variable_get($name, 'not found'); - $form['name'] = array( - '#type' => 'value', - '#value' => $name - ); - $form['value'] = array( - '#type' => 'item', - '#title' => t('Old value'), - '#markup' => dpr($value, TRUE), - ); - if (is_string($value) || is_numeric($value)) { - $form['new'] = array( - '#type' => 'textarea', - '#title' => t('New value'), - '#default_value' => $value - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Submit'), - ); - } - else { - $api = variable_get('devel_api_url', 'api.drupal.org'); - $form['new'] = array( - '#type' => 'item', - '#title' => t('New value'), - '#value' => t('Sorry, complex variable types may not be edited yet. Use the Execute PHP block and the variable_set() function.', array('@variable-set-doc' => "http://$api/api/HEAD/function/variable_set")) - ); - } - drupal_set_title($name); - return $form; -} - -function devel_variable_edit_submit($form, &$form_state) { - variable_set($form_state['values']['name'], $form_state['values']['new']); - drupal_set_message(t('Saved new value for %name.', array('%name' => $form_state['values']['name']))); - 'devel/variable'; -} - -/** - * Menu callback: display the session. - */ -function devel_session() { - global $user; - $output = kprint_r($_SESSION, TRUE); - $headers = array(t('Session name'), t('Session ID')); - $output .= theme('table', array('headers' => $headers, 'rows' => array(array(session_name(), session_id())))); - return $output; -} - -/** - * Menu callback; prints the loaded structure of the current node/user. - */ -function devel_load_object($type, $object, $name = NULL) { - $name = isset($name) ? $name : $type; - return kdevel_print_object($object, '$'. $name .'->'); -} - -/** - * Menu callback; prints the render structure of the current object (currently node or user). - */ -function devel_render_object($type, $object, $name = NULL) { - $name = isset($name) ? $name : $type; - $function = $type . '_view'; - $build = $function($object); - return kdevel_print_object($build, '$'. $name .'->'); -} - -function devel_elements_page() { - return kdevel_print_object(module_invoke_all('element_info')); -} - -function devel_phpinfo() { - print phpinfo(); - drupal_exit(); -} diff --git a/devel.rules.inc b/devel.rules.inc deleted file mode 100644 index 0a7a078085980147474f261f9b4921cdfda93eed..0000000000000000000000000000000000000000 --- a/devel.rules.inc +++ /dev/null @@ -1,24 +0,0 @@ - array( - 'base' => 'devel_rules_debug_action', - 'label' => t('Debug value'), - 'group' => t('Devel'), - 'parameter' => array( - 'value' => array('type' => 'unknown', 'label' => t('Value to debug')), - ), - ), - ); -} - -/** - * Rules action for debugging values. - */ -function devel_rules_debug_action($value) { - dpm($value); -} diff --git a/devel_generate/devel_generate.drush.inc b/devel_generate/devel_generate.drush.inc deleted file mode 100644 index 67ca8f6e9fe35f1d3c8ac3333b9a9b61bdf3044f..0000000000000000000000000000000000000000 --- a/devel_generate/devel_generate.drush.inc +++ /dev/null @@ -1,202 +0,0 @@ - 'Create users.', - 'arguments' => array( - 'number_users' => 'Number of users to generate.', - ), - 'options' => array( - 'kill' => 'Delete all users before generating new ones.', - 'roles' => 'A comma delimited list of role IDs which should be granted to the new users. No need to specify authenticated user role.', - ), - 'aliases' => array('genu'), - ); - $items['generate-terms'] = array( - 'description' => 'Create terms in specified vocabulary.', - 'arguments' => array( - 'machine_name' => 'Vocabulary machine name into which new terms will be inserted.', - 'number_terms' => 'Number of terms to insert. Defaults to 10.', - ), - 'options' => array( - 'kill' => 'Delete all terms in specified vocabulary before generating.', - 'feedback' => 'An integer representing interval for insertion rate logging. Defaults to 500', - ), - 'aliases' => array('gent'), - - ); - $items['generate-vocabs'] = array( - 'description' => 'Create vocabularies.', - 'arguments' => array( - 'num_vocabs' => 'Number of vocabularies to create. Defaults to 1.', - ), - 'options' => array( - 'kill' => 'Delete all vocabularies before generating.', - ), - 'aliases' => array('genv'), - ); - $items['generate-content'] = array( - 'description' => 'Create content.', - 'drupal dependencies' => array('devel_generate'), - 'arguments' => array( - 'number_nodes' => 'Number of nodes to generate.', - 'maximum_comments' => 'Maximum number of comments to generate.', - ), - 'options' => array( - 'kill' => 'Delete all content before generating new content.', - 'types' => 'A comma delimited list of content types to create. Defaults to page,article.', - 'feedback' => 'An integer representing interval for insertion rate logging. Defaults to 500', - 'skip-fields' => 'A comma delimited list of fields to omit when generating random values', - 'languages' => 'A comma-separated list of language codes', - ), - 'aliases' => array('genc'), - ); - $items['generate-menus'] = array( - 'description' => 'Create menus and menu items.', - 'drupal dependencies' => array('devel_generate'), // Remove these once devel.module is moved down a directory. http://drupal.org/node/925246 - 'arguments' => array( - 'number_menus' => 'Number of menus to generate. Defaults to 2.', - 'number_links' => 'Number of links to generate. Defaults to 50.', - 'max_depth' => 'Max link depth. Defaults to 3', - 'max_width' => 'Max width of first level of links. Defaults to 8.', - ), - 'options' => array( - 'kill' => 'Delete all previously generated menus and links before generating new menus and links.', - ), - 'aliases' => array('genm'), - ); - return $items; -} - - -/** - * Command callback. Generate a number of users. - */ -function drush_devel_generate_users($num_users = NULL) { - if (drush_generate_is_number($num_users) == FALSE) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', t('Invalid number of users.')); - } - drush_generate_include_devel(); - $roles = drush_get_option('roles') ? explode(',', drush_get_option('roles')) : array(); - devel_create_users($num_users, drush_get_option('kill'), 0, $roles); - drush_log(t('Generated @number users.', array('@number' => $num_users)), 'success'); -} - -/** - * Command callback. Generate a number of terms in given vocabs. - */ -function drush_devel_generate_terms($vname = NULL, $num_terms = 10) { - // Try to convert machine name to a vocab ID - if (!$vocab = taxonomy_vocabulary_machine_name_load($vname)) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid vocabulary name: !name', array('!name' => $vname))); - } - if (drush_generate_is_number($num_terms) == FALSE) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of terms: !num', array('!num' => $num_terms))); - } - - drush_generate_include_devel(); - $vocabs[$vocab->vid] = $vocab; - devel_generate_term_data($vocabs, $num_terms, '12', drush_get_option('kill')); - drush_log(dt('Generated @num_terms terms.', array('@num_terms' => $num_terms)), 'success'); -} - -/** - * Command callback. Generate a number of vocabularies. - */ -function drush_devel_generate_vocabs($num_vocab = 1) { - if (drush_generate_is_number($num_vocab) == FALSE) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of vocabularies: !num.', array('!num' => $num_vocab))); - } - drush_generate_include_devel(); - devel_generate_vocab_data($num_vocab, '12', drush_get_option('kill')); - drush_log(dt('Generated @num_vocab vocabularies.', array('@num_vocab' => $num_vocab)), 'success'); -} - -/** - * Command callback. Generate a number of nodes and comments. - */ -function drush_devel_generate_content($num_nodes = NULL, $max_comments = NULL) { - if (drush_generate_is_number($num_nodes) == FALSE) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of nodes')); - } - if (!empty($max_comments) && drush_generate_is_number($max_comments) == FALSE) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of comments.')); - } - - $add_language = drush_get_option('languages'); - if (!empty($add_language)) { - $add_language = explode(',', str_replace(' ', '', $add_language)); - // Intersect with the enabled languages to make sure the language args - // passed are actually enabled. - $values['values']['add_language'] = array_flip(array_intersect($add_language, array_keys(locale_language_list()))); - } - - // Load user 1; is needed for creating *published* comments. - if ($max_comments) { - global $user; - $user_one = user_load(1); - $user = $user_one; - drupal_save_session(FALSE); - } - - $values['values']['kill_content'] = drush_get_option('kill'); - $values['values']['title_length'] = 6; - $values['values']['num_nodes'] = $num_nodes; - $values['values']['max_comments'] = $max_comments; - $values['values']['node_types'] = drupal_map_assoc(explode(',', drush_get_option('types', 'page,article'))); - drush_generate_include_devel(); - devel_generate_content($values); - drush_log(t('Generated @num_nodes nodes, @max_comments comments (or less) per node.', array('@num_nodes' => (int)$num_nodes, '@max_comments' => (int)$max_comments)), 'success'); -} - -/** - * Command callback. Generate a number of menus and menu links. - */ -function drush_devel_generate_menus($number_menus = 2, $number_links = 50, $max_depth = 3, $max_width = 8) { - if (drush_generate_is_number($number_menus) == FALSE) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of menus')); - } - if (drush_generate_is_number($number_links) == FALSE) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of links')); - } - if (drush_generate_is_number($max_depth) == FALSE || $max_depth > 9 || $max_depth < 1) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid maximum link depth. Use a value between 1 and 9')); - } - if (drush_generate_is_number($max_width) == FALSE || $max_width < 1) { - return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid maximum menu width. Use a positive numeric value.')); - } - - global $user; - $user_one = user_load(1); - $user = $user_one; - drupal_save_session(FALSE); - - $kill = drush_get_option('kill'); - drush_generate_include_devel(); - $link_types = drupal_map_assoc(array('node', 'front', 'external')); - devel_generate_menu_data($number_menus, array(), $number_links, 12, $link_types, $max_depth, $max_width, $kill); - drush_log(t('Generated @number_menus menus, @number_links links.', array('@number_menus' => (int)$number_menus, '@number_links' => (int)$number_links)), 'success'); -} -////////////////////////////////////////////////////////////////////////////// -// Helper functions - -// Verify if param is a number. -function drush_generate_is_number($number) { - if ($number == NULL) return FALSE; - if (!is_numeric($number)) return FALSE; - return TRUE; -} - -// Include devel_generate.inc. -function drush_generate_include_devel() { - $path = drupal_get_path('module', 'devel_generate'); - require_once($path .'/devel_generate.inc'); -} diff --git a/devel_generate/devel_generate.fields.inc b/devel_generate/devel_generate.fields.inc deleted file mode 100644 index 147fe9f1357e7cd224fd848be531cb2a51b0377d..0000000000000000000000000000000000000000 --- a/devel_generate/devel_generate.fields.inc +++ /dev/null @@ -1,98 +0,0 @@ -{$field['field_name']} - // is necessary here because the forum module has a bug where it - // initializes the property with incorrect data. - // @see http://drupal.org/node/652176 - $object->{$field['field_name']} = array( - $object->language => $object_field, - ); - } -} - -/** - * A simple function to return multiple values for fields that use - * custom multiple value widgets but don't need any other special multiple - * values handling. This will call the field generation function - * a random number of times and compile the results into a node array. - */ -function devel_generate_multiple($function, $object, $field, $instance, $bundle) { - $object_field = array(); - if (function_exists($function)) { - switch ($field['cardinality']) { - case FIELD_CARDINALITY_UNLIMITED: - $max = rand(0, 3); //just an arbitrary number for 'unlimited' - break; - default: - $max = $field['cardinality'] - 1; - break; - } - for ($i = 0; $i <= $max; $i++) { - $result = $function($object, $field, $instance, $bundle); - if (!empty($result)) { - $object_field[$i] = $result; - } - } - } - return $object_field; -} diff --git a/devel_generate/devel_generate.inc b/devel_generate/devel_generate.inc deleted file mode 100644 index bb0358ed901f99ae9336bd0d7817f551719e14aa..0000000000000000000000000000000000000000 --- a/devel_generate/devel_generate.inc +++ /dev/null @@ -1,709 +0,0 @@ -fields('u', array('uid')) - ->condition('uid', 1, '>') - ->execute() - ->fetchAllAssoc('uid'); - user_delete_multiple(array_keys($uids)); - drupal_set_message(format_plural(count($uids), '1 user deleted', '@count users deleted.')); - } - // Determine if we should create user pictures. - $pic_config = FALSE; - module_load_include('inc', 'system', 'image.gd'); - if (variable_get('user_pictures', 0) && function_exists('image_gd_check_settings') && image_gd_check_settings()) { - $pic_config['path'] = variable_get('user_picture_path', 'pictures'); - list($pic_config['width'], $pic_config['height']) = explode('x', variable_get('user_picture_dimensions', '85x85')); - } - - if ($num > 0) { - $names = array(); - while (count($names) < $num) { - $name = devel_generate_word(mt_rand(6, 12)); - $names[$name] = ''; - } - - if (empty($roles)) { - $roles = array(DRUPAL_AUTHENTICATED_RID); - } - foreach ($names as $name => $value) { - $edit = array( - 'uid' => NULL, - 'name' => $name, - 'pass' => NULL, // No password avoids user_hash_password() which is expensive. - 'mail' => $name . '@' . $url['host'], - 'status' => 1, - 'created' => REQUEST_TIME - mt_rand(0, $age), - 'roles' => drupal_map_assoc($roles), - ); - - // Populate all core fields on behalf of field.module - module_load_include('inc', 'devel_generate', 'devel_generate.fields'); - $edit = (object) $edit; - $edit->language = LANGUAGE_NONE; - devel_generate_fields($edit, 'user', 'user'); - $edit = (array) $edit; - - $account = user_save(drupal_anonymous_user(), $edit); - - if ($pic_config) { - // Since the image.module should scale the picture just pick an - // arbitrary size that it's too big for our font. - $im = imagecreatetruecolor(200, 200); - - // Randomize the foreground using the md5 of the user id, then invert it - // for the background color so there's enough contrast to read the text. - $parts = array_map('hexdec', str_split(md5($account->uid), 2)); - $fg = imagecolorallocate($im, $parts[1], $parts[3], $parts[5]); - $bg = imagecolorallocate($im, 255 - $parts[0], 255 - $parts[1], 255 - $parts[2]); - - // Fill the background then print their user info. - imagefill($im, 0, 0, $bg); - imagestring($im, 5, 5, 5, "#" . $account->uid, $fg); - imagestring($im, 5, 5, 25, $account->name, $fg); - - - // Create an empty, managed file where we want the user's picture to - // be so we can have GD overwrite it with the image. - $picture_directory = variable_get('file_default_scheme', 'public') . '://' . variable_get('user_picture_path', 'pictures'); - file_prepare_directory($picture_directory, FILE_CREATE_DIRECTORY); - $destination = file_stream_wrapper_uri_normalize($picture_directory . '/picture-' . $account->uid . '.png'); - $file = file_save_data('', $destination); - - // GD doesn't like stream wrapped paths so convert the URI to a normal - // file system path. - if (isset($file) && $wrapper = file_stream_wrapper_get_instance_by_uri($file->uri)) { - imagepng($im, $wrapper->realpath()); - } - imagedestroy($im); - - // Clear the cached filesize, set the owner and MIME-type then re-save - // the file. - clearstatcache(); - $file->uid = $account->uid; - $file->filemime = 'image/png'; - $file = file_save($file); - - // Save the user record with the new picture. - $edit = (array) $account; - $edit['picture'] = $file; - user_save($account, $edit); - } - } - } - drupal_set_message(t('!num_users created.', array('!num_users' => format_plural($num, '1 user', '@count users')))); -} - - -/** - * The main API function for creating content. - * - * See devel_generate_content_form() for the supported keys in $form_state['values']. - * Other modules may participate by form_alter() on that form and then handling their data during hook_nodeapi('pre_save') or in own submit handler for the form. - * - * @param string $form_state - * @return void - */ -function devel_generate_content($form_state) { - if (!empty($form_state['values']['kill_content'])) { - devel_generate_content_kill($form_state['values']); - } - - if (count($form_state['values']['node_types'])) { - // Generate nodes. - devel_generate_content_pre_node($form_state['values']); - $start = time(); - for ($i = 1; $i <= $form_state['values']['num_nodes']; $i++) { - devel_generate_content_add_node($form_state['values']); - if (function_exists('drush_log') && $i % drush_get_option('feedback', 1000) == 0) { - $now = time(); - drush_log(dt('Completed !feedback nodes (!rate nodes/min)', array('!feedback' => drush_get_option('feedback', 1000), '!rate' => (drush_get_option('feedback', 1000)*60)/($now-$start))), 'ok'); - $start = $now; - } - } - } - - devel_generate_set_message(format_plural($form_state['values']['num_nodes'], '1 node created.', 'Finished creating @count nodes')); -} - -function devel_generate_add_comments($node, $users, $max_comments, $title_length = 8) { - $num_comments = mt_rand(1, $max_comments); - for ($i = 1; $i <= $num_comments; $i++) { - $comment = new stdClass; - $comment->nid = $node->nid; - $comment->cid = NULL; - $comment->name = 'devel generate'; - $comment->mail = 'devel_generate@example.com'; - $comment->timestamp = mt_rand($node->created, REQUEST_TIME); - - switch ($i % 3) { - case 1: - $comment->pid = db_query_range("SELECT cid FROM {comment} WHERE pid = 0 AND nid = :nid ORDER BY RAND()", 0, 1, array(':nid' => $comment->nid))->fetchField(); - break; - case 2: - $comment->pid = db_query_range("SELECT cid FROM {comment} WHERE pid > 0 AND nid = :nid ORDER BY RAND()", 0, 1, array(':nid' => $comment->nid))->fetchField(); - break; - default: - $comment->pid = 0; - } - - // The subject column has a max character length of 64 - // See bug: http://drupal.org/node/1024340 - $comment->subject = substr(devel_create_greeking(mt_rand(2, $title_length), TRUE), 0, 63); - $comment->uid = $users[array_rand($users)]; - $comment->language = LANGUAGE_NONE; - // Populate all core fields on behalf of field.module - module_load_include('inc', 'devel_generate', 'devel_generate.fields'); - devel_generate_fields($comment, 'comment', 'comment_node_' . $node->type); - comment_save($comment); - } -} - -function devel_generate_vocabs($records, $maxlength = 12, $types = array('page', 'article')) { - $vocs = array(); - - // Insert new data: - for ($i = 1; $i <= $records; $i++) { - $voc = new stdClass(); - $voc->name = devel_generate_word(mt_rand(2, $maxlength)); - $voc->machine_name = drupal_strtolower($voc->name); - $voc->description = "description of ". $voc->name; - // TODO: not working - $voc->nodes = array_flip(array($types[array_rand($types)])); - foreach ($voc->nodes as $key => $value) { - $voc->nodes[$key] = $key; - } - - $voc->multiple = 1; - $voc->required = 0; - $voc->relations = 1; - $voc->hierarchy = 1; - $voc->weight = mt_rand(0,10); - $voc->language = LANGUAGE_NONE; - - taxonomy_vocabulary_save($voc); - $vocs[] = $voc->name; - - unset($voc); - } - return $vocs; -} - -function devel_generate_terms($records, $vocabs, $maxlength = 12) { - $terms = array(); - - // Insert new data: - $max = db_query('SELECT MAX(tid) FROM {taxonomy_term_data}')->fetchField(); - $start = time(); - for ($i = 1; $i <= $records; $i++) { - switch ($i % 2) { - case 1: - // Set vid and vocabulary_machine_name properties. - $vocab = $vocabs[array_rand($vocabs)]; - $term->vid = $vocab->vid; - $term->vocabulary_machine_name = $vocab->machine_name; - // Don't set a parent. Handled by taxonomy_save_term() - // $term->parent = 0; - break; - default: - while (TRUE) { - // Keep trying to find a random parent. - $candidate = mt_rand(1, $max); - $query = db_select('taxonomy_term_data', 't'); - $query->innerJoin('taxonomy_vocabulary', 'v', 't.vid = v.vid'); - $parent = $query - ->fields('t', array('tid', 'vid')) - ->fields('v', array('machine_name')) - ->condition('v.vid', array_keys($vocabs), 'IN') - ->condition('t.tid', $candidate, '>=') - ->range(0,1) - ->execute() - ->fetchAssoc(); - if ($parent['tid']) { - break; - } - } - $term->parent = $parent['tid']; - // Slight speedup due to this property being set. - $term->vocabulary_machine_name = $parent['machine_name']; - $term->vid = $parent['vid']; - break; - } - - $term->name = devel_generate_word(mt_rand(2, $maxlength)); - $term->description = "description of ". $term->name; - $term->format = filter_fallback_format(); - $term->weight = mt_rand(0, 10); - $term->language = LANGUAGE_NONE; - - // Populate all core fields on behalf of field.module - module_load_include('inc', 'devel_generate', 'devel_generate.fields'); - devel_generate_fields($term, 'term', $term->vocabulary_machine_name); - - if ($status = taxonomy_term_save($term)) { - $max += 1; - if (function_exists('drush_log')) { - $feedback = drush_get_option('feedback', 1000); - if ($i % $feedback == 0) { - $now = time(); - drush_log(dt('Completed !feedback terms (!rate terms/min)', array('!feedback' => $feedback, '!rate' => $feedback*60 / ($now-$start) )), 'ok'); - $start = $now; - } - } - - // Limit memory usage. Only report first 20 created terms. - if ($i < 20) { - $terms[] = $term->name; - } - - unset($term); - } - } - return $terms; -} - -// TODO: use taxonomy_get_entries once that exists. -function devel_generate_get_terms($vids) { - return db_select('taxonomy_term_data', 'td') - ->fields('td', array('tid')) - ->condition('vid', $vids, 'IN') - ->orderBy('tid', 'ASC') - ->execute() - ->fetchCol('tid'); -} - -function devel_generate_term_data($vocabs, $num_terms, $title_length, $kill) { - if ($kill) { - foreach (devel_generate_get_terms(array_keys($vocabs)) as $tid) { - taxonomy_term_delete($tid); - } - drupal_set_message(t('Deleted existing terms.')); - } - - $new_terms = devel_generate_terms($num_terms, $vocabs, $title_length); - if (!empty($new_terms)) { - drupal_set_message(t('Created the following new terms: !terms', array('!terms' => theme('item_list', array('items' => $new_terms))))); - } -} - -function devel_generate_vocab_data($num_vocab, $title_length, $kill) { - - if ($kill) { - foreach (taxonomy_get_vocabularies() as $vid => $vocab) { - taxonomy_vocabulary_delete($vid); - } - drupal_set_message(t('Deleted existing vocabularies.')); - } - - $new_vocs = devel_generate_vocabs($num_vocab, $title_length); - if (!empty($new_vocs)) { - drupal_set_message(t('Created the following new vocabularies: !vocs', array('!vocs' => theme('item_list', array('items' => $new_vocs))))); - } -} - -function devel_generate_menu_data($num_menus, $existing_menus, $num_links, $title_length, $link_types, $max_depth, $max_width, $kill) { - // Delete menus and menu links. - if ($kill) { - if (module_exists('menu')) { - foreach (menu_get_menus(FALSE) as $menu => $menu_title) { - if (strpos($menu, 'devel-') === 0) { - $menu = menu_load($menu); - menu_delete($menu); - } - } - } - // Delete menu links generated by devel. - $result = db_select('menu_links', 'm') - ->fields('m', array('mlid')) - ->condition('m.menu_name', 'devel', '<>') - // Look for the serialized version of 'devel' => TRUE. - ->condition('m.options', '%' . db_like('s:5:"devel";b:1') . '%', 'LIKE') - ->execute(); - foreach ($result as $link) { - menu_link_delete($link->mlid); - } - drupal_set_message(t('Deleted existing menus and links.')); - } - - // Generate new menus. - $new_menus = devel_generate_menus($num_menus, $title_length); - if (!empty($new_menus)) { - drupal_set_message(t('Created the following new menus: !menus', array('!menus' => theme('item_list', array('items' => $new_menus))))); - } - - // Generate new menu links. - $menus = $new_menus + $existing_menus; - $new_links = devel_generate_links($num_links, $menus, $title_length, $link_types, $max_depth, $max_width); - drupal_set_message(t('Created @count new menu links.', array('@count' => count($new_links)))); -} - -/** - * Generates new menus. - */ -function devel_generate_menus($num_menus, $title_length = 12) { - $menus = array(); - - if (!module_exists('menu')) { - $num_menus = 0; - } - - for ($i = 1; $i <= $num_menus; $i++) { - $menu = array(); - $menu['title'] = devel_generate_word(mt_rand(2, $title_length)); - $menu['menu_name'] = 'devel-' . drupal_strtolower($menu['title']); - $menu['description'] = t('Description of @name', array('@name' => $menu['title'])); - menu_save($menu); - $menus[$menu['menu_name']] = $menu['title']; - } - - return $menus; -} - -/** - * Generates menu links in a tree structure. - */ -function devel_generate_links($num_links, $menus, $title_length, $link_types, $max_depth, $max_width) { - $links = array(); - $menus = array_keys(array_filter($menus)); - $link_types = array_keys(array_filter($link_types)); - - $nids = array(); - for ($i = 1; $i <= $num_links; $i++) { - // Pick a random menu. - $menu_name = $menus[array_rand($menus)]; - // Build up our link. - $link = array( - 'menu_name' => $menu_name, - 'options' => array('devel' => TRUE), - 'weight' => mt_rand(-50, 50), - 'mlid' => 0, - 'link_title' => devel_generate_word(mt_rand(2, $title_length)), - ); - $link['options']['attributes']['title'] = t('Description of @title.', array('@title' => $link['link_title'])); - - // For the first $max_width items, make first level links. - if ($i <= $max_width) { - $depth = 0; - } - else { - // Otherwise, get a random parent menu depth. - $depth = mt_rand(1, $max_depth - 1); - } - // Get a random parent link from the proper depth. - do { - $link['plid'] = db_select('menu_links', 'm') - ->fields('m', array('mlid')) - ->condition('m.menu_name', $menus, 'IN') - ->condition('m.depth', $depth) - ->range(0, 1) - ->orderRandom() - ->execute() - ->fetchField(); - $depth--; - } while (!$link['plid'] && $depth > 0); - if (!$link['plid']) { - $link['plid'] = 0; - } - - $link_type = array_rand($link_types); - switch ($link_types[$link_type]) { - case 'node': - // Grab a random node ID. - $select = db_select('node', 'n') - ->fields('n', array('nid', 'title')) - ->condition('n.status', 1) - ->range(0, 1) - ->orderRandom(); - // Don't put a node into the menu twice. - if (!empty($nids[$menu_name])) { - $select->condition('n.nid', $nids[$menu_name], 'NOT IN'); - } - $node = $select->execute()->fetchAssoc(); - if (isset($node['nid'])) { - $nids[$menu_name][] = $node['nid']; - $link['link_path'] = $link['router_path'] = 'node/' . $node['nid']; - $link['link_title'] = $node['title']; - break; - } - case 'external': - $link['link_path'] = 'http://www.example.com/'; - break; - case 'front': - $link['link_path'] = $link['router_path'] = ''; - break; - default: - $link['devel_link_type'] = $link_type; - break; - } - - menu_link_save($link); - - $links[$link['mlid']] = $link['link_title']; - } - - return $links; -} - -function devel_generate_word($length){ - mt_srand((double)microtime()*1000000); - - $vowels = array("a", "e", "i", "o", "u"); - $cons = array("b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "u", "v", "w", "tr", - "cr", "br", "fr", "th", "dr", "ch", "ph", "wr", "st", "sp", "sw", "pr", "sl", "cl", "sh"); - - $num_vowels = count($vowels); - $num_cons = count($cons); - $word = ''; - - while(strlen($word) < $length){ - $word .= $cons[mt_rand(0, $num_cons - 1)] . $vowels[mt_rand(0, $num_vowels - 1)]; - } - - return substr($word, 0, $length); -} - -function devel_create_content($type = NULL) { - $nparas = mt_rand(1,12); - $type = empty($type) ? mt_rand(0,3) : $type; - - $output = ""; - switch($type % 3) { - // MW: This appears undesireable. Was giving

in text fields - // case 1: // html - // for ($i = 1; $i <= $nparas; $i++) { - // $output .= devel_create_para(mt_rand(10,60),1); - // } - // break; - // - // case 2: // brs only - // for ($i = 1; $i <= $nparas; $i++) { - // $output .= devel_create_para(mt_rand(10,60),2); - // } - // break; - - default: // plain text - for ($i = 1; $i <= $nparas; $i++) { - $output .= devel_create_para(mt_rand(10,60)) ."\n\n"; - } - } - - return $output; -} - -function devel_create_para($words, $type = 0) { - $output = ''; - switch ($type) { - case 1: - $output .= "

" . devel_create_greeking($words) . "

"; - break; - - case 2: - $output .= devel_create_greeking($words) . "
"; - break; - - default: - $output .= devel_create_greeking($words); - } - return $output; -} - -function devel_create_greeking($word_count, $title = FALSE) { - $dictionary = array("abbas", "abdo", "abico", "abigo", "abluo", "accumsan", - "acsi", "ad", "adipiscing", "aliquam", "aliquip", "amet", "antehabeo", - "appellatio", "aptent", "at", "augue", "autem", "bene", "blandit", - "brevitas", "caecus", "camur", "capto", "causa", "cogo", "comis", - "commodo", "commoveo", "consectetuer", "consequat", "conventio", "cui", - "damnum", "decet", "defui", "diam", "dignissim", "distineo", "dolor", - "dolore", "dolus", "duis", "ea", "eligo", "elit", "enim", "erat", - "eros", "esca", "esse", "et", "eu", "euismod", "eum", "ex", "exerci", - "exputo", "facilisi", "facilisis", "fere", "feugiat", "gemino", - "genitus", "gilvus", "gravis", "haero", "hendrerit", "hos", "huic", - "humo", "iaceo", "ibidem", "ideo", "ille", "illum", "immitto", - "importunus", "imputo", "in", "incassum", "inhibeo", "interdico", - "iriure", "iusto", "iustum", "jugis", "jumentum", "jus", "laoreet", - "lenis", "letalis", "lobortis", "loquor", "lucidus", "luctus", "ludus", - "luptatum", "macto", "magna", "mauris", "melior", "metuo", "meus", - "minim", "modo", "molior", "mos", "natu", "neo", "neque", "nibh", - "nimis", "nisl", "nobis", "nostrud", "nulla", "nunc", "nutus", "obruo", - "occuro", "odio", "olim", "oppeto", "os", "pagus", "pala", "paratus", - "patria", "paulatim", "pecus", "persto", "pertineo", "plaga", "pneum", - "populus", "praemitto", "praesent", "premo", "probo", "proprius", - "quadrum", "quae", "qui", "quia", "quibus", "quidem", "quidne", "quis", - "ratis", "refero", "refoveo", "roto", "rusticus", "saepius", - "sagaciter", "saluto", "scisco", "secundum", "sed", "si", "similis", - "singularis", "sino", "sit", "sudo", "suscipere", "suscipit", "tamen", - "tation", "te", "tego", "tincidunt", "torqueo", "tum", "turpis", - "typicus", "ulciscor", "ullamcorper", "usitas", "ut", "utinam", - "utrum", "uxor", "valde", "valetudo", "validus", "vel", "velit", - "veniam", "venio", "vereor", "vero", "verto", "vicis", "vindico", - "virtus", "voco", "volutpat", "vulpes", "vulputate", "wisi", "ymo", - "zelus"); - $dictionary_flipped = array_flip($dictionary); - - $greeking = ''; - - if (!$title) { - $words_remaining = $word_count; - while ($words_remaining > 0) { - $sentence_length = mt_rand(3, 10); - $words = array_rand($dictionary_flipped, $sentence_length); - $sentence = implode(' ', $words); - $greeking .= ucfirst($sentence) . '. '; - $words_remaining -= $sentence_length; - } - } - else { - // Use slightly different method for titles. - $words = array_rand($dictionary_flipped, $word_count); - $greeking = ucwords(implode(' ', $words)); - } - - // Work around possible php garbage collection bug. Without an unset(), this - // function gets very expensive over many calls (php 5.2.11). - unset($dictionary, $dictionary_flipped); - return trim($greeking); -} - -function devel_generate_add_terms(&$node) { - $vocabs = taxonomy_get_vocabularies($node->type); - foreach ($vocabs as $vocab) { - $sql = "SELECT tid FROM {taxonomy_term_data} WHERE vid = :vid ORDER BY RAND()"; - $result = db_query_range($sql, 0, 5 , array(':vid' => $vocab->vid)); - foreach($result as $row) { - $node->taxonomy[] = $row->tid; - if (!$vocab->multiple) { - break; - } - } - } -} - -function devel_get_users() { - $users = array(); - $result = db_query_range("SELECT uid FROM {users}", 0, 50); - foreach ($result as $record) { - $users[] = $record->uid; - } - return $users; -} - -/** - * Generate statistics information for a node. - * - * @param $node - * A node object. - */ -function devel_generate_add_statistics($node) { - $statistic = array( - 'nid' => $node->nid, - 'totalcount' => mt_rand(0, 500), - 'timestamp' => REQUEST_TIME - mt_rand(0, $node->created), - ); - $statistic['daycount'] = mt_rand(0, $statistic['totalcount']); - db_insert('node_counter')->fields($statistic)->execute(); -} - -/** - * Handle the devel_generate_content_form request to kill all of the content. - * This is used by both the batch and non-batch branches of the code. - * - * @param $num - * array of options obtained from devel_generate_content_form. - */ -function devel_generate_content_kill($values) { - $results = db_select('node', 'n') - ->fields('n', array('nid')) - ->condition('type', $values['node_types'], 'IN') - ->execute(); - foreach ($results as $result) { - $nids[] = $result->nid; - } - - if (!empty($nids)) { - node_delete_multiple($nids); - drupal_set_message(t('Deleted %count nodes.', array('%count' => count($nids)))); - } -} - -/** - * Pre-process the devel_generate_content_form request. This is needed so - * batch api can get the list of users once. This is used by both the batch - * and non-batch branches of the code. - * - * @param $num - * array of options obtained from devel_generate_content_form. - */ -function devel_generate_content_pre_node(&$results) { - // Get user id. - $users = devel_get_users(); - $users = array_merge($users, array('0')); - $results['users'] = $users; -} - -/** - * Create one node. Used by both batch and non-batch code branches. - * - * @param $num - * array of options obtained from devel_generate_content_form. - */ -function devel_generate_content_add_node(&$results) { - $node = new stdClass(); - $node->nid = NULL; - - // Insert new data: - $node->type = array_rand($results['node_types']); - node_object_prepare($node); - $users = $results['users']; - $node->uid = $users[array_rand($users)]; - $type = node_type_get_type($node); - $node->title = $type->has_title ? devel_create_greeking(mt_rand(2, $results['title_length']), TRUE) : ''; - $node->revision = mt_rand(0,1); - $node->promote = mt_rand(0, 1); - // Avoid NOTICE. - if (!isset($results['time_range'])) { - $results['time_range'] = 0; - } - - devel_generate_set_language($results, $node); - - $node->created = REQUEST_TIME - mt_rand(0, $results['time_range']); - - // A flag to let hook_nodeapi() implementations know that this is a generated node. - $node->devel_generate = $results; - - // Populate all core fields on behalf of field.module - module_load_include('inc', 'devel_generate', 'devel_generate.fields'); - devel_generate_fields($node, 'node', $node->type); - - // See devel_generate_nodeapi() for actions that happen before and after this save. - node_save($node); -} - -/* - * Populate $object->language based on $results - */ -function devel_generate_set_language($results, $object) { - if (isset($results['add_language'])) { - $languages = array_keys($results['add_language']); - $object->language = $languages[array_rand($languages)]; - } - else { - $default = language_default('language'); - $object->language = $default == 'en' ? LANGUAGE_NONE : $default; - } -} diff --git a/devel_generate/devel_generate.info b/devel_generate/devel_generate.info deleted file mode 100644 index a04f8456673a7129f089a4d69af9763c61e1e137..0000000000000000000000000000000000000000 --- a/devel_generate/devel_generate.info +++ /dev/null @@ -1,6 +0,0 @@ -name = Devel generate -description = Generate dummy users, nodes, and taxonomy terms. -package = Development -core = 7.x -dependencies[] = devel -tags[] = developer diff --git a/devel_generate/devel_generate.module b/devel_generate/devel_generate.module deleted file mode 100644 index 07e1844fba7b87d4f7cc316fce2a9018b29c39d9..0000000000000000000000000000000000000000 --- a/devel_generate/devel_generate.module +++ /dev/null @@ -1,416 +0,0 @@ - 'Generate users', - 'description' => 'Generate a given number of users. Optionally delete current users.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_generate_users_form'), - 'access arguments' => array('administer users'), - ); - $items['admin/config/development/generate/content'] = array( - 'title' => 'Generate content', - 'description' => 'Generate a given number of nodes and comments. Optionally delete current items.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_generate_content_form'), - 'access arguments' => array('administer nodes'), - ); - if (module_exists('taxonomy')) { - $items['admin/config/development/generate/taxonomy'] = array( - 'title' => 'Generate terms', - 'description' => 'Generate a given number of terms. Optionally delete current terms.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_generate_term_form'), - 'access arguments' => array('administer taxonomy'), - ); - $items['admin/config/development/generate/vocabs'] = array( - 'title' => 'Generate vocabularies', - 'description' => 'Generate a given number of vocabularies. Optionally delete current vocabularies.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_generate_vocab_form'), - 'access arguments' => array('administer taxonomy'), - ); - } - $items['admin/config/development/generate/menu'] = array( - 'title' => 'Generate menus', - 'description' => 'Generate a given number of menus and menu links. Optionally delete current menus.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_generate_menu_form'), - 'access arguments' => array('administer menu'), - ); - - return $items; -} - -function devel_generate_users_form() { - $form['num'] = array( - '#type' => 'textfield', - '#title' => t('How many users would you like to generate?'), - '#default_value' => 50, - '#size' => 10, - ); - $form['kill_users'] = array( - '#type' => 'checkbox', - '#title' => t('Delete all users (except user id 1) before generating new users.'), - '#default_value' => FALSE, - ); - $options = user_roles(TRUE); - unset($options[DRUPAL_AUTHENTICATED_RID]); - $form['roles'] = array( - '#type' => 'checkboxes', - '#title' => t('Which roles should the users receive?'), - '#description' => t('Users always receive the authenticated user role.'), - '#options' => $options, - ); - - $options = array(1 => t('Now')); - foreach (array(3600, 86400, 604800, 2592000, 31536000) as $interval) { - $options[$interval] = format_interval($interval, 1) . ' ' . t('ago'); - } - $form['time_range'] = array( - '#type' => 'select', - '#title' => t('How old should user accounts be?'), - '#description' => t('User ages will be distributed randomly from the current time, back to the selected time.'), - '#options' => $options, - '#default_value' => 604800, - ); - - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Generate'), - ); - return $form; -} - -function devel_generate_users_form_submit($form_id, &$form_state) { - module_load_include('inc', 'devel_generate'); - $values = $form_state['values']; - devel_create_users($values['num'], $values['kill_users'], $values['time_range'], $values['roles']); -} - -function devel_generate_content_form() { - $options = array(); - - if (module_exists('content')) { - $types = content_types(); - foreach ($types as $type) { - $warn = ''; - if (count($type['fields'])) { - $warn = t('. This type contains CCK fields which will only be populated by fields that implement the content_generate hook.'); - } - $options[$type['type']] = t($type['name']). $warn; - } - } - else { - $types = node_type_get_types(); - $suffix = ''; - foreach ($types as $type) { - if (module_exists('comment')) { - $default = variable_get('comment_' . $type->type, COMMENT_NODE_OPEN); - $map = array(t('Hidden'), t('Closed'), t('Open')); - $suffix = '. ' . t('Comments: ') . $map[$default]. ''; - } - $options[$type->type] = t($type->name) . $suffix; - } - } - // we cannot currently generate valid polls. - unset($options['poll']); - - if (empty($options)) { - drupal_set_message(t('You do not have any content types that can be generated. Go create a new content type already!', array('@create-type' => url('admin/structure/types/add'))), 'error', FALSE); - return; - } - - $form['node_types'] = array( - '#type' => 'checkboxes', - '#title' => t('Content types'), - '#options' => $options, - '#default_value' => array_keys($options), - ); - if (module_exists('checkall')) $form['node_types']['#checkall'] = TRUE; - $form['kill_content'] = array( - '#type' => 'checkbox', - '#title' => t('Delete all content in these content types before generating new content.'), - '#default_value' => FALSE, - ); - $form['num_nodes'] = array( - '#type' => 'textfield', - '#title' => t('How many nodes would you like to generate?'), - '#default_value' => 50, - '#size' => 10, - ); - - $options = array(1 => t('Now')); - foreach (array(3600, 86400, 604800, 2592000, 31536000) as $interval) { - $options[$interval] = format_interval($interval, 1) . ' ' . t('ago'); - } - $form['time_range'] = array( - '#type' => 'select', - '#title' => t('How far back in time should the nodes be dated?'), - '#description' => t('Node creation dates will be distributed randomly from the current time, back to the selected time.'), - '#options' => $options, - '#default_value' => 604800, - ); - - $form['max_comments'] = array( - '#type' => module_exists('comment') ? 'textfield' : 'value', - '#title' => t('Maximum number of comments per node.'), - '#description' => t('You must also enable comments for the content types you are generating. Note that some nodes will randomly receive zero comments. Some will receive the max.'), - '#default_value' => 0, - '#size' => 3, - '#access' => module_exists('comment'), - ); - $form['title_length'] = array( - '#type' => 'textfield', - '#title' => t('Max word length of titles'), - '#default_value' => 4, - '#size' => 10, - ); - $form['add_alias'] = array( - '#type' => 'checkbox', - '#disabled' => !module_exists('path'), - '#description' => t('Requires path.module'), - '#title' => t('Add an url alias for each node.'), - '#default_value' => FALSE, - ); - $form['add_statistics'] = array( - '#type' => 'checkbox', - '#title' => t('Add statistics for each node (node_counter table).'), - '#default_value' => TRUE, - '#access' => module_exists('statistics'), - ); - - unset($options); - $options[LANGUAGE_NONE] = t('Language neutral'); - if (module_exists('locale')) { - $options += locale_language_list(); - } - $form['add_language'] = array( - '#type' => 'select', - '#title' => t('Set language on nodes'), - '#multiple' => TRUE, - '#disabled' => !module_exists('locale'), - '#description' => t('Requires locale.module'), - '#options' => $options, - '#default_value' => array(LANGUAGE_NONE => LANGUAGE_NONE), - ); - - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Generate'), - ); - $form['#redirect'] = FALSE; - - return $form; -} - -function devel_generate_content_form_submit($form_id, &$form_state) { - module_load_include('inc', 'devel_generate', 'devel_generate'); - $form_state['values']['node_types'] = array_filter($form_state['values']['node_types']); - if ($form_state['values']['num_nodes'] <= 50 && $form_state['values']['max_comments'] <= 10) { - module_load_include('inc', 'devel_generate'); - devel_generate_content($form_state); - } - else { - module_load_include('inc', 'devel_generate', 'devel_generate_batch'); - devel_generate_batch_content($form_state); - } -} - -function devel_generate_term_form() { - $options = array(); - foreach (taxonomy_get_vocabularies() as $vid => $vocab) { - $options[$vid] = $vocab->machine_name; - } - $form['vids'] = array( - '#type' => 'select', - '#multiple' => TRUE, - '#title' => t('Vocabularies'), - '#required' => TRUE, - '#options' => $options, - '#description' => t('Restrict terms to these vocabularies.'), - ); - $form['num_terms'] = array( - '#type' => 'textfield', - '#title' => t('Number of terms?'), - '#default_value' => 10, - '#size' => 10, - ); - $form['title_length'] = array( - '#type' => 'textfield', - '#title' => t('Max word length of term names'), - '#default_value' => 12, - '#size' => 10, - ); - $form['kill_taxonomy'] = array( - '#type' => 'checkbox', - '#title' => t('Delete existing terms in specified vocabularies before generating new terms.'), - '#default_value' => FALSE, - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Generate'), - ); - return $form; -} - -function devel_generate_vocab_form() { - $form['num_vocabs'] = array( - '#type' => 'textfield', - '#title' => t('Number of vocabularies?'), - '#default_value' => 1, - '#size' => 10, - ); - $form['title_length'] = array( - '#type' => 'textfield', - '#title' => t('Max word length of vocabulary names'), - '#default_value' => 12, - '#size' => 10, - ); - $form['kill_taxonomy'] = array( - '#type' => 'checkbox', - '#title' => t('Delete existing vocabularies before generating new ones.'), - '#default_value' => FALSE, - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Generate'), - ); - return $form; -} - -function devel_generate_term_form_submit($form_id, &$form_state) { - module_load_include('inc', 'devel_generate'); - $vocabs = taxonomy_vocabulary_load_multiple($form_state['values']['vids']); - devel_generate_term_data($vocabs, $form_state['values']['num_terms'], $form_state['values']['title_length'], $form_state['values']['kill_taxonomy']); -} - -function devel_generate_vocab_form_submit($form_id, &$form_state) { - module_load_include('inc', 'devel_generate'); - devel_generate_vocab_data($form_state['values']['num_vocabs'], $form_state['values']['title_length'], $form_state['values']['kill_taxonomy']); -} - -function devel_generate_node_insert($node) { - if (isset($node->devel_generate)) { - $results = $node->devel_generate; - - if (!empty($results['max_comments']) && $node->comment >= COMMENT_NODE_OPEN) { - devel_generate_add_comments($node, $results['users'], $results['max_comments'], $results['title_length']); - } - - - // Add an url alias. Cannot happen before save because we don't know the nid. - if (!empty($results['add_alias'])) { - $path = array( - 'source' => 'node/' . $node->nid, - 'alias' => 'node-' . $node->nid . '-' . $node->type, - ); - path_save($path); - } - - // Add node statistics. - if (!empty($results['add_statistics']) && module_exists('statistics')) { - devel_generate_add_statistics($node); - } - } -} - -function devel_generate_set_message($msg, $type = 'status') { - $function = function_exists('drush_log') ? 'drush_log' : 'drupal_set_message'; - $function($msg, $type); -} - -function devel_generate_menu_form() { - $menu_enabled = module_exists('menu'); - if ($menu_enabled) { - $menus = array('__new-menu__' => t('Create new menu(s)')) + menu_get_menus(); - } - else { - $menus = menu_list_system_menus(); - } - $form['existing_menus'] = array( - '#type' => 'checkboxes', - '#title' => t('Generate links for these menus'), - '#options' => $menus, - '#default_value' => array('__new-menu__'), - '#required' => TRUE, - ); - if ($menu_enabled) { - $form['num_menus'] = array( - '#type' => 'textfield', - '#title' => t('Number of new menus to create'), - '#default_value' => 2, - '#size' => 10, - '#states' => array( - 'visible' => array( - ':input[name=existing_menus[__new-menu__]]' => array('checked' => TRUE), - ), - ), - ); - } - $form['num_links'] = array( - '#type' => 'textfield', - '#title' => t('Number of links to generate'), - '#default_value' => 50, - '#size' => 10, - '#required' => TRUE, - ); - $form['title_length'] = array( - '#type' => 'textfield', - '#title' => t('Max word length of menu and menu link names'), - '#default_value' => 12, - '#size' => 10, - '#required' => TRUE, - ); - $form['link_types'] = array( - '#type' => 'checkboxes', - '#title' => t('Types of links to generate'), - '#options' => array( - 'node' => t('Nodes'), - 'front' => t('Front page'), - 'external' => t('External'), - ), - '#default_value' => array('node', 'front', 'external'), - '#required' => TRUE, - ); - $form['max_depth'] = array( - '#type' => 'select', - '#title' => t('Maximum link depth'), - '#options' => range(0, MENU_MAX_DEPTH), - '#default_value' => floor(MENU_MAX_DEPTH / 2), - '#required' => TRUE, - ); - unset($form['max_depth']['#options'][0]); - $form['max_width'] = array( - '#type' => 'textfield', - '#title' => t('Maximum menu width'), - '#default_value' => 6, - '#size' => 10, - '#description' => t("Limit the width of the generated menu's first level of links to a certain number of items."), - '#required' => TRUE, - ); - $form['kill'] = array( - '#type' => 'checkbox', - '#title' => t('Delete existing custom generated menus and menu links before generating new ones.'), - '#default_value' => FALSE, - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Generate'), - ); - return $form; -} - -function devel_generate_menu_form_submit($form_id, &$form_state) { - // If the create new menus checkbox is off, set the number of new menus to 0. - if (!isset($form_state['values']['existing_menus']['__new-menu__']) || !$form_state['values']['existing_menus']['__new-menu__']) { - $form_state['values']['num_menus'] = 0; - } - module_load_include('inc', 'devel_generate'); - devel_generate_menu_data($form_state['values']['num_menus'], $form_state['values']['existing_menus'], $form_state['values']['num_links'], $form_state['values']['title_length'], $form_state['values']['link_types'], $form_state['values']['max_depth'], $form_state['values']['max_width'], $form_state['values']['kill']); -} diff --git a/devel_generate/devel_generate_batch.inc b/devel_generate/devel_generate_batch.inc deleted file mode 100644 index 2e903570b27abe2689fc1b9a01aeef6ade611f4a..0000000000000000000000000000000000000000 --- a/devel_generate/devel_generate_batch.inc +++ /dev/null @@ -1,68 +0,0 @@ - t('Generating Content'), - 'operations' => $operations, - 'finished' => 'devel_generate_batch_finished', - 'file' => drupal_get_path('module', 'devel_generate') . '/devel_generate_batch.inc', - ); - batch_set($batch); -} - -/** - * Create Content Batch Functions: - */ - -function devel_generate_batch_content_kill(&$context) { - module_load_include('inc', 'devel_generate', 'devel_generate'); - devel_generate_content_kill($context['results']); -} - -function devel_generate_batch_content_pre_node($vars, &$context) { - $context['results'] = $vars; - $context['results']['num_nids'] = 0; - module_load_include('inc', 'devel_generate', 'devel_generate'); - devel_generate_content_pre_node($context['results']); -} - -function devel_generate_batch_content_add_node(&$context) { - module_load_include('inc', 'devel_generate', 'devel_generate'); - devel_generate_content_add_node($context['results']); - $context['results']['num_nids'] ++; -} - -function devel_generate_batch_finished($success, $results, $operations) { - if ($success) { - $message = t('Finished @num_nids nodes created successfully.', array('@num_nids' => $results['num_nids'])); - } - else { - $message = t('Finished with an error.'); - } - drupal_set_message($message); -} - diff --git a/devel_generate/file.devel_generate.inc b/devel_generate/file.devel_generate.inc deleted file mode 100644 index 9fb145f1bfadd1610fea8586d26e7d939c65ebff..0000000000000000000000000000000000000000 --- a/devel_generate/file.devel_generate.inc +++ /dev/null @@ -1,48 +0,0 @@ -uri = $path; - $source->uid = 1; // TODO: randomize? use case specific. - $source->filemime = 'text/plain'; - $destination = $field['settings']['uri_scheme'] . '://' . $instance['settings']['file_directory'] . '/' . basename($path); - $file = file_move($source, $destination); - } - else { - return FALSE; - } - } - $object_field['fid'] = $file->fid; - $object_field['display'] = $field['settings']['display_default']; - $object_field['description'] = devel_create_greeking(10); - - return $object_field; -} - -/** - * Private function for generating a random text file. - */ -function devel_generate_textfile($filesize = 1024) { - if ($tmp_file = drupal_tempnam('temporary://', 'filefield_')) { - $destination = $tmp_file . '.txt'; - file_unmanaged_move($tmp_file, $destination); - - $fp = fopen($destination, 'w'); - fwrite($fp, str_repeat('01', $filesize/2)); - fclose($fp); - - return $destination; - } -} diff --git a/devel_generate/image.devel_generate.inc b/devel_generate/image.devel_generate.inc deleted file mode 100644 index c2cc1a7c9992616bc6afb55c730fb8538a17a061..0000000000000000000000000000000000000000 --- a/devel_generate/image.devel_generate.inc +++ /dev/null @@ -1,91 +0,0 @@ -uri = $path; - $source->uid = 1; // TODO: randomize? Use case specific. - $source->filemime = 'image/' . pathinfo($path, PATHINFO_EXTENSION); - $destination_dir = $field['settings']['uri_scheme'] . '://' . $instance['settings']['file_directory']; - file_prepare_directory($destination_dir, FILE_CREATE_DIRECTORY); - $destination = $destination_dir . '/' . basename($path); - $file = file_move($source, $destination, FILE_CREATE_DIRECTORY); - $images[$extension][$min_resolution][$max_resolution][$file->fid] = $file; - } - else { - return FALSE; - } - } - else { - // Select one of the images we've already generated for this field. - $file = new stdClass(); - $file->fid = array_rand($images[$extension][$min_resolution][$max_resolution]); - } - - $object_field['fid'] = $file->fid; - $object_field['alt'] = devel_create_greeking(4); - $object_field['title'] = devel_create_greeking(4); - return $object_field; -} - -/** - * Private function for creating a random image. - * - * This function only works with the GD toolkit. ImageMagick is not supported. - */ -function devel_generate_image($extension = 'png', $min_resolution, $max_resolution) { - if ($tmp_file = drupal_tempnam('temporary://', 'imagefield_')) { - $destination = $tmp_file . '.' . $extension; - file_unmanaged_move($tmp_file, $destination, FILE_CREATE_DIRECTORY); - - $min = explode('x', $min_resolution); - $max = explode('x', $max_resolution); - - $width = rand((int)$min[0], (int)$max[0]); - $height = rand((int)$min[0], (int)$max[0]); - - // Make a image split into 4 sections with random colors. - $im = imagecreate($width, $height); - for ($n = 0; $n < 4; $n++) { - $color = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255)); - $x = $width/2 * ($n % 2); - $y = $height/2 * (int) ($n >= 2); - imagefilledrectangle($im, $x, $y, $x + $width/2, $y + $height/2, $color); - } - - // Make a perfect circle in the image middle. - $color = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255)); - $smaller_dimension = min($width, $height); - $smaller_dimension = ($smaller_dimension % 2) ? $smaller_dimension : $smaller_dimension; - imageellipse($im, $width/2, $height/2, $smaller_dimension, $smaller_dimension, $color); - - $save_function = 'image'. ($extension == 'jpg' ? 'jpeg' : $extension); - $save_function($im, drupal_realpath($destination)); - - $images[$extension][$min_resolution][$max_resolution][$destination] = $destination; - } - return $destination; -} diff --git a/devel_generate/list.devel_generate.inc b/devel_generate/list.devel_generate.inc deleted file mode 100644 index d8101c7f2e31af6ce51ced966697581e845f5e32..0000000000000000000000000000000000000000 --- a/devel_generate/list.devel_generate.inc +++ /dev/null @@ -1,20 +0,0 @@ - $vocabulary->vid))->fetchField()) { - $candidate = mt_rand(1, $max); - $query = db_select('taxonomy_term_data', 't'); - $tid = $query - ->fields('t', array('tid')) - ->condition('t.vid', $vocabulary->vid, '=') - ->condition('t.tid', $candidate, '>=') - ->range(0,1) - ->execute() - ->fetchField(); - // If there are no terms for the taxonomy, the query will fail, in which - // case we return NULL. - if ($tid === FALSE) { - return NULL; - } - $object_field['tid'] = (int) $tid; - return $object_field; - } -} diff --git a/devel_generate/text.devel_generate.inc b/devel_generate/text.devel_generate.inc deleted file mode 100644 index 1f4691d255f5ce6e7c8967a81334fc2bb1d5f7fd..0000000000000000000000000000000000000000 --- a/devel_generate/text.devel_generate.inc +++ /dev/null @@ -1,39 +0,0 @@ -realm == 'mymodule_myrealm') { - if ($row->grant_view) { - $role = user_role_load($row->gid); - return 'Role ' . drupal_placeholder($role->name) . ' may view this node.'; - } - else { - return 'No access.'; - } - } -} - -/** - * Acknowledge ownership of 'alien' grant records. - * - * Some node access modules store grant records directly into the {node_access} - * table rather than returning them through hook_node_access_records(). This - * practice is not recommended and DNA will flag all such records as 'alien'. - * - * If this is unavoidable, a module can confess to being the owner of these - * grant records, so that DNA can properly attribute them. - * - * @see hook_node_access_records() - * - * @ingroup node_access - */ -function hook_node_access_acknowledge($grant) { - if ($grant['realm'] == 'mymodule_all' && $grant['nid'] == 0) { - return TRUE; - } -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/devel_node_access.info b/devel_node_access.info deleted file mode 100644 index e747c1544027db9eb1b1b9823d8ed129adb36db5..0000000000000000000000000000000000000000 --- a/devel_node_access.info +++ /dev/null @@ -1,7 +0,0 @@ -name = Devel node access -description = Developer blocks and page illustrating relevant node_access records. -package = Development -dependencies[] = menu -core = 7.x -configure = admin/config/development/devel -tags[] = developer diff --git a/devel_node_access.install b/devel_node_access.install deleted file mode 100644 index 0088d78c7a473acda578d8d19d1d83e31aa3d625..0000000000000000000000000000000000000000 --- a/devel_node_access.install +++ /dev/null @@ -1,13 +0,0 @@ - array( - 'description' => t('View the node access information blocks on node pages and the summary page.'), - 'title' => t('Access DNA information'), - 'restrict access' => TRUE, - ), - ); -} - -/** - * Implementation of hook_help(). - */ -function devel_node_access_help($path, $arg) { - switch ($path) { - case 'admin/settings/modules#description': - return t('Development helper for node_access table'); - break; - case 'admin/help#devel_node_access': - $output = '

' . t('This module helps in site development. Specifically, when an access control module is used to limit access to some or all nodes, this module provides some feedback showing the node_access table in the database.') . "

\n"; - $output .= '

' . t('The node_access table is one method Drupal provides to hide content from some users while displaying it to others. By default, Drupal shows all nodes to all users. There are a number of optional modules which may be installed to hide content from some users.') . "

\n"; - $output .= '

' . t('If you have not installed any of these modules, you really have no need for the devel_node_access module. This module is intended for use during development, so that developers and admins can confirm that the node_access table is working as expected. You probably do not want this module enabled on a production site.') . "

\n"; - $output .= '

' . t('This module provides two blocks. One called Devel Node Access by User is visible when a single node is shown on a page. This block shows which users can view, update or delete the node shown. Note that this block uses an inefficient algorithm to produce its output. You should only enable this block on sites with very few user accounts.') . "

\n"; - $output .= '

' . t('The second block provided by this module shows the entries in the node_access table for any nodes shown on the current page. You can enable the debug mode on the settings page to display much more information, but this can cause considerable overhead. Because the tables shown are wide, it is recommended to enable the blocks in the page footer rather than a sidebar.', - array('@settings_page' => url('admin/config/development/devel', array('fragment' => 'edit-devel-node-access'))) - ) . "

\n"; - $output .= '

' . t('This module also provides a summary page which shows general information about your node_access table. If you have installed the Views module, you may browse node_access by realm.', - array('@summary_page' => url('devel/node_access/summary')) - ) . "

\n"; - return $output; - } -} - -function devel_node_access_menu() { - $items = array(); - - if (!module_exists('devel')) { - if (!menu_load('devel')) { - // we have to create the 'devel' menu ourselves - $menu = array( - 'menu_name' => 'devel', - 'title' => 'Development', - 'description' => 'Development link', - ); - menu_save($menu); - } - - // we have to create the 'Devel settings' menu item ourselves - $items['admin/config/development/devel'] = array( - 'title' => 'Devel settings', - 'description' => 'Helper pages and blocks to assist Drupal developers and admins with node_access. The devel blocks can be managed via the block administration page.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('devel_node_access_admin_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['devel/settings'] = $items['admin/config/development/devel'] + array( - 'menu_name' => 'devel', - ); - } - - // add this to the custom menu 'devel' created by the devel module. - $items['devel/node_access/summary'] = array( - 'title' => 'Node_access summary', - 'page callback' => 'dna_summary', - 'access arguments' => array(DNA_ACCESS_VIEW), - 'menu_name' => 'devel', - ); - - return $items; -} - -function devel_node_access_admin_settings() { - $form = array(); - return system_settings_form($form); -} - -function devel_node_access_form_alter(&$form, $form_state, $form_id) { - $tr = 't'; - if ($form_id == 'devel_admin_settings' || $form_id == 'devel_node_access_admin_settings') { - $form['devel_node_access'] = array( - '#type' => 'fieldset', - '#title' => t('Devel Node Access'), - '#collapsible' => TRUE, - ); - $form['devel_node_access']['devel_node_access_debug_mode'] = array( - '#type' => 'checkbox', - '#title' => t('Debug mode'), - '#default_value' => variable_get('devel_node_access_debug_mode', FALSE), - '#description' => t('Debug mode verifies the grant records in the node_access table against those that would be set by running !Rebuild_permissions, and displays them all; this can cause considerable overhead.
For even more information enable the %DNAbU block, too.', array( - '!Rebuild_permissions' => l('[' . $tr('Rebuild permissions') . ']', 'admin/reports/status/rebuild'), - '%DNAbU' => t('Devel Node Access by User'), - '@link' => url('admin/structure/block/list'), - )), - ); - // push the Save button down - $form['actions']['#weight'] = 10; - } -} - -function dna_summary() { - // warn user if they have any entries that could grant access to all nodes - $output = ''; - $result = db_query('SELECT DISTINCT realm FROM {node_access} WHERE nid = 0 AND gid = 0'); - $rows = array(); - foreach ($result as $row) { - $rows[] = array($row->realm); - } - if (!empty($rows)) { - $output .= '

' . t('Access Granted to All Nodes (All Users)') . "

\n"; - $output .= '

' . t('Your node_access table contains entries that may be granting all users access to all nodes. Depending on which access control module(s) you use, you may want to delete these entries. If you are not using an access control module, you should probably leave these entries as is.') . "

\n"; - $headers = array(t('realm')); - $output .= theme('table', array('header' => $headers, 'rows' => $rows)); - $access_granted_to_all_nodes = TRUE; - } - - // how many nodes are not represented in the node_access table - $num = db_query('SELECT COUNT(n.nid) AS num_nodes FROM {node} n LEFT JOIN {node_access} na ON n.nid = na.nid WHERE na.nid IS NULL')->fetchField(); - if ($num) { - $output .= '

' . t('Legacy Nodes') . "

\n"; - $output .= '

' . - t('You have !num nodes in your node table which are not represented in your node_access table. If you have an access control module installed, these nodes may be hidden from all users. This could be caused by publishing nodes before enabling the access control module. If this is the case, manually updating each node should add it to the node_access table and fix the problem.', array('!num' => l($num, 'devel/node_access/view/NULL'))) - . "

\n"; - if (!empty($access_granted_to_all_nodes)) { - $output .= '

' . - t('This issue may be masked by the one above, so look into the former first.') - . "

\n"; - } - } - else { - $output .= '

' . t('All Nodes Represented') . "

\n"; - $output .= '

' . t('All nodes are represented in the node_access table.') . "

\n"; - } - - - // a similar warning to the one above, but slightly more specific - $result = db_query('SELECT DISTINCT realm FROM {node_access} WHERE nid = 0 AND gid <> 0'); - $rows = array(); - foreach ($result as $row) { - $rows[] = array($row->realm); - } - if (!empty($rows)) { - $output .= '

' . t('Access Granted to All Nodes (Some Users)') . "

\n"; - $output .= '

' . t('Your node_access table contains entries that may be granting some users access to all nodes. This may be perfectly normal, depending on which access control module(s) you use.') . "

\n"; - $headers = array(t('realm')); - $output .= theme('table', array('header' => $headers, 'rows' => $rows)); - } - - - // find specific nodes which may be visible to all users - $result = db_query('SELECT DISTINCT realm, COUNT(DISTINCT nid) as node_count FROM {node_access} WHERE gid = 0 AND nid > 0 GROUP BY realm'); - $rows = array(); - foreach ($result as $row) { - $rows[] = array( - $row->realm, - array( - 'data' => $row->node_count, - 'align' => 'center', - ), - ); - } - if (!empty($rows)) { - $output .= '

' . t('Access Granted to Some Nodes') . "

\n"; - $output .= '

' . - t('The following realms appear to grant all users access to some specific nodes. This may be perfectly normal, if some of your content is available to the public.') - . "

\n"; - $headers = array(t('realm'), t('public nodes')); - $output .= theme('table', array('header' => $headers, 'rows' => $rows, 'caption' => t('Public Nodes'))); - } - - - // find specific nodes protected by node_access table - $result = db_query('SELECT DISTINCT realm, COUNT(DISTINCT nid) as node_count FROM {node_access} WHERE gid <> 0 AND nid > 0 GROUP BY realm'); - $rows = array(); - foreach ($result as $row) { - // no Views yet: - //$rows[] = array(l($row->realm, "devel/node_access/view/$row->realm"), - $rows[] = array( - $row->realm, - array( - 'data' => $row->node_count, - 'align' => 'center', - ), - ); - } - if (!empty($rows)) { - $output .= '

' . t('Summary by Realm') . "

\n"; - $output .= '

' . t('The following realms grant limited access to some specific nodes.') . "

\n"; - $headers = array(t('realm'), t('private nodes')); - $output .= theme('table', array('header' => $headers, 'rows' => $rows, 'caption' => t('Protected Nodes'))); - } - - return $output; -} - -function dna_visible_nodes($nid = NULL) { - static $nids = array(); - if ($nid) { - $nids[$nid] = $nid; - } - elseif (empty($nids) && arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == NULL) { - // show DNA information on node/NID even if access is denied (IF the user has the 'view devel_node_access information' permission)! - return array(arg(1)); - } - return $nids; -} - -function devel_node_access_node_view($node, $build_mode) { - // remember this node, for display in our block - dna_visible_nodes($node->nid); -} - -function _devel_node_access_module_invoke_all() { // array and scalar returns - $args = func_get_args(); - $hook = $args[0]; - unset($args[0]); - $return = array(); - foreach (module_implements($hook) as $module) { - $function = $module . '_' . $hook; - if (function_exists($function)) { - $result = call_user_func_array($function, $args); - if (isset($result)) { - if (is_array($result)) { - foreach ($result as $key => $value) { - // add name of module that returned the value: - $result[$key]['#module'] = $module; - } - } - else { - // build array with result keyed by $module: - $result = array($module => $result); - } - $return = array_merge_recursive($return, $result); - } - } - } - return $return; -} - -/** - * Helper function to build an associative array of grant records and their - * history. If there are duplicate records, display an error message. - * - * @param $grants - * An indexed array of grant records, augmented by the '#module' key, - * as created by _devel_node_access_module_invoke_all('node_access_records'). - * - * @param $node - * The node that the grant records belong to. - * - * @param $function - * The name of the hook that produced the grants array, in case we need to - * display an error message. - * - * @return - * See _devel_node_access_nar_alter() for the description of the result. - */ -function _devel_node_access_build_nar_data($grants, $node, $function) { - $data = array(); - $duplicates = array(); - foreach ($grants as $grant) { - if (empty($data[$grant['realm']][$grant['gid']])) { - $data[$grant['realm']][$grant['gid']] = array('original' => $grant, 'current' => $grant, 'changes' => array()); - } - else { - if (empty($duplicates[$grant['realm']][$grant['gid']])) { - $duplicates[$grant['realm']][$grant['gid']][] = $data[$grant['realm']][$grant['gid']]['original']; - } - $duplicates[$grant['realm']][$grant['gid']][] = $grant; - } - } - if (!empty($duplicates)) { - // generate an error message - $msg = t('Devel Node Access has detected duplicate records returned from %function:', array('%function' => $function)); - $msg .= '
    '; - foreach ($duplicates as $realm => $data_by_realm) { - foreach ($data_by_realm as $gid => $data_by_realm_gid) { - $msg .= '
    • '; - foreach ($data_by_realm_gid as $grant) { - $msg .= "
    • $node->nid/$realm/$gid/" . ($grant['grant_view'] ? 1 : 0) . ($grant['grant_update'] ? 1 : 0) . ($grant['grant_delete'] ? 1 : 0) . ' by ' . $grant['#module'] . '
    • '; - } - $msg .= '
  • '; - } - } - $msg .= '
'; - drupal_set_message($msg, 'error', FALSE); - } - return $data; -} - -/** - * Helper function to mimic hook_node_access_records_alter() and trace what - * each module does with it. - * - * @param object $grants - * An indexed array of grant records, augmented by the '#module' key, - * as created by _devel_node_access_module_invoke_all('node_access_records'). - * This array is updated by the hook_node_access_records_alter() - * implementations. - * - * @param $node - * The node that the grant records belong to. - * - * @return - * A tree representation of the grant records in $grants including their - * history: - * $data[$realm][$gid] - * ['original'] - grant record before processing - * ['current'] - grant record after processing (if still present) - * ['changes'][]['op'] - change message (add/change/delete by $module) - * ['grant'] - grant record after change (unless deleted) - */ -function _devel_node_access_nar_alter(&$grants, $node) { - //dpm($grants, '_devel_node_access_nar_alter(): grants IN'); - $dummy = array(); - drupal_alter('node_access_records', $dummy, $node); - static $drupal_static = array(); - isset($drupal_static['drupal_alter']) || ($drupal_static['drupal_alter'] = &drupal_static('drupal_alter')); - $functions = $drupal_static['drupal_alter']; - - // build the initial tree (and check for duplicates) - $data = _devel_node_access_build_nar_data($grants, $node, 'hook_node_access_records()'); - - // simulate drupal_alter('node_access_records', $grants, $node); - foreach ($functions['node_access_records'] as $function) { - // call hook_node_access_records_alter() for one module at a time and analyze - $function($grants, $node); // <== - $module = substr($function, 0, strlen($function) - 26); - - foreach ($grants as $i => $grant) { - if (empty($data[$grant['realm']][$grant['gid']]['current'])) { - // it's an added grant - $data[$grant['realm']][$grant['gid']]['current'] = $grant; - $data[$grant['realm']][$grant['gid']]['current']['#module'] = $module; - $data[$grant['realm']][$grant['gid']]['changes'][] = array( - 'op' => 'added by ' . $module, - 'grant' => $grant, - ); - $grants[$i]['#module'] = $module; - } - else { - // it's an existing grant, check for changes - foreach (array('view', 'update', 'delete') as $op) { - $$op = $grant["grant_$op"] - $data[$grant['realm']][$grant['gid']]['current']["grant_$op"]; - } - $priority = $grant['priority'] - $data[$grant['realm']][$grant['gid']]['current']['priority']; - if ($view || $update || $delete || $priority) { - // it was changed - $data[$grant['realm']][$grant['gid']]['current'] = $grant; - $data[$grant['realm']][$grant['gid']]['current']['#module'] = $module; - $data[$grant['realm']][$grant['gid']]['changes'][] = array( - 'op' => 'altered by ' . $module, - 'grant' => $grant, - ); - $grants[$i]['#module'] = $module; - } - } - $data[$grant['realm']][$grant['gid']]['found'] = TRUE; - } - - // check for newly introduced duplicates - _devel_node_access_build_nar_data($grants, $node, 'hook_node_access_records_alter()'); - - // look for grant records that have disappeared - foreach ($data as $realm => $data2) { - foreach ($data2 as $gid => $data3) { - if (empty($data[$realm][$gid]['found']) && isset($data[$realm][$gid]['current'])) { - unset($data[$realm][$gid]['current']); - $data[$realm][$gid]['changes'][] = array('op' => 'removed by ' . $module); - } - else { - unset($data[$realm][$gid]['found']); - } - } - } - } - //dpm($data, '_devel_node_access_nar_alter() returns'); - //dpm($grants, '_devel_node_access_nar_alter(): grants OUT'); - return $data; -} - -/** - * Helper function to mimic hook_node_grants_alter() and trace what - * each module does with it. - * - * @param object $grants - * An indexed array of grant records, augmented by the '#module' key, - * as created by _devel_node_access_module_invoke_all('node_grants'). - * This array is updated by the hook_node_grants_alter() - * implementations. - * - * @param $node - * The node that the grant records belong to. - * - * @return - * A tree representation of the grant records in $grants including their - * history: - * $data[$realm][$gid] - * ['cur'] - TRUE or FALSE whether the gid is present or not - * ['ori'][] - array of module names that contributed this grant (if any) - * ['chg'][] - array of changes, such as - * - 'added' if module name is a prefix if the $realm, - * - 'added by module' otherwise, or - * - 'removed by module' - */ -function _devel_node_access_ng_alter(&$grants, $account, $op) { - //dpm($grants, '_devel_node_access_ng_alter(): grants IN'); - $dummy = array(); - drupal_alter('node_grants', $dummy, $account, $op); - static $drupal_static = array(); - isset($drupal_static['drupal_alter']) || ($drupal_static['drupal_alter'] = &drupal_static('drupal_alter')); - $functions = $drupal_static['drupal_alter']; - - // build the initial structure - $data = array(); - foreach ($grants as $realm => $gids) { - foreach ($gids as $i => $gid) { - if ($i !== '#module') { - $data[$realm][$gid]['cur'] = TRUE; - $data[$realm][$gid]['ori'][] = $gids['#module']; - } - } - unset($grants[$realm]['#module']); - } - - // simulate drupal_alter('node_grants', $grants, $account, $op); - foreach ($functions['node_grants'] as $function) { - // call hook_node_grants_alter() for one module at a time and analyze - $function($grants, $account, $op); // <== - $module = substr($function, 0, strlen($function) - 18); - - // check for new gids - foreach ($grants as $realm => $gids) { - foreach ($gids as $i => $gid) { - if (empty($data[$realm][$gid]['cur'])) { - $data[$realm][$gid]['cur'] = TRUE; - $data[$realm][$gid]['chg'][] = 'added by ' . $module; - } - } - } - - // check for removed gids - foreach ($data as $realm => $gids) { - foreach ($gids as $gid => $history) { - if ($history['cur'] && array_search($gid, $grants[$realm]) === FALSE) { - $data[$realm][$gid]['cur'] = FALSE; - $data[$realm][$gid]['chg'][] = 'removed by ' . $module; - } - } - } - } - - //dpm($data, '_devel_node_access_ng_alter() returns'); - //dpm($grants, '_devel_node_access_ng_alter(): grants OUT'); - return $data; -} - -/** - * Implements hook_block_info(). - */ -function devel_node_access_block_info() { - $blocks['dna_node'] = array( - 'info' => t('Devel Node Access'), - 'region' => 'footer', - 'status' => 1, - 'cache' => DRUPAL_NO_CACHE, - ); - $blocks['dna_user'] = array( - 'info' => t('Devel Node Access by User'), - 'region' => 'footer', - 'cache' => DRUPAL_NO_CACHE, - ); - return $blocks; -} - -/** - * Implements hook_block_view(). - */ -function devel_node_access_block_view($delta) { - global $user; - global $theme_key; - static $block1_visible, $hint = ''; - if (!isset($block1_visible)) { - $block1_visible = db_query("SELECT status FROM {block} WHERE module = 'devel_node_access' AND delta = 'dna_user' AND theme = :theme", array( - ':theme' => $theme_key, - ))->fetchField(); - if (!$block1_visible) { - $hint = t('For per-user access permissions enable the %DNAbU block.', array('@link' => url('admin/structure/block'), '%DNAbU' => t('Devel Node Access by User'))); - } - } - - if (!user_access(DNA_ACCESS_VIEW)) { - return; - } - - $output = array(); - - switch ($delta) { - case 'dna_node': - if (!count(dna_visible_nodes())) { - return; - } - - // include rows where nid == 0 - $nids = array_merge(array(0 => 0), dna_visible_nodes()); - $query = db_select('node_access', 'na'); - $query - ->fields('na') - ->condition('na.nid', $nids, 'IN') - ->orderBy('na.nid') - ->orderBy('na.realm') - ->orderBy('na.gid'); - $nodes = node_load_multiple($nids); - - if (!variable_get('devel_node_access_debug_mode', FALSE)) { - $headers = array(t('node'), t('realm'), t('gid'), t('view'), t('update'), t('delete'), t('explained')); - $rows = array(); - foreach ($query->execute() as $row) { - $explained = module_invoke_all('node_access_explain', $row); - $rows[] = array( - (empty($row->nid) ? '0' : '' . _devel_node_access_get_node_title($nodes[$row->nid], TRUE) . ''), - $row->realm, - $row->gid, - $row->grant_view, - $row->grant_update, - $row->grant_delete, - implode('
', $explained), - ); - } - $output[] = array( - '#theme' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#attributes' => array('style' => 'text-align: left') - ); - - $hint = t('To see more details enable debug mode.', array('@debug_mode' => url('admin/config/development/devel', array('fragment' => 'edit-devel-node-access')))) . (empty($hint) ? '' : ' ' . $hint); - } - else { - $tr = 't'; - $variables = array('!na' => '{node_access}'); - $states = array( - 'default' => array(t('default'), 'ok', t('Default grant supplied by core in the absence of any other non-empty grants; in !na.', $variables)), - 'ok' => array(t('ok'), 'ok', t('Highest priority grant; in !na.', $variables)), - 'removed' => array(t('removed'), '', t('Was removed in @func; not in !na.', $variables + array('@func' => 'hook_node_access_records_alter()'))), - 'static' => array(t('static'), 'ok', t('Non-standard grant in !na.', $variables)), - 'unexpected' => array(t('unexpected'), 'warning', t('The 0/all/0/... grant applies to all nodes and all users -- usually it should not be present in !na if any node access module is active!')), - 'ignored' => array(t('ignored'), 'warning', t('Lower priority grant; not in !na and thus ignored.', $variables)), - 'empty' => array(t('empty'), 'warning', t('Does not grant any access, but could block lower priority grants; not in !na.', $variables)), - 'wrong' => array(t('wrong'), 'error', t('Is rightfully in !na but at least one access flag is wrong!', $variables)), - 'missing' => array(t('missing'), 'error', t("Should be in !na but isn't!", $variables)), - 'removed!' => array(t('removed!'), 'error', t('Was removed in @func; should NOT be in !na!', $variables + array('@func' => 'hook_node_access_records_alter()'))), - 'illegitimate' => array(t('illegitimate'), 'error', t('Should NOT be in !na because of lower priority!', $variables)), - 'alien' => array(t('alien'), 'error', t('Should NOT be in !na because of unknown origin!', $variables)), - ); - $active_states = array('default', 'ok', 'static', 'unexpected', 'wrong', 'illegitimate', 'alien'); - $headers = array(t('node'), t('prio'), t('status'), t('realm'), t('gid'), t('view'), t('update'), t('delete'), t('explained')); - $headers = _devel_node_access_format_row($headers); - $active_grants = array(); - foreach ($query->execute() as $active_grant) { - $active_grants[$active_grant->nid][$active_grant->realm][$active_grant->gid] = $active_grant; - } - $all_grants = $checked_grants = $published_nid = array(); - foreach ($nids as $nid) { - $acquired_grants_nid = array(); - if ($node = node_load($nid)) { - // check node_access_acquire_grants() - $grants = _devel_node_access_module_invoke_all('node_access_records', $node); - // check drupal_alter('node_access_records') - $data = _devel_node_access_nar_alter($grants, $node); - /* (This was the D6 implementation that didn't analyze the hook_node_access_records_alter() details.) - if (!empty($grants)) { - $top_priority = NULL; - foreach ($grants as $grant) { - $priority = intval($grant['priority']); - $top_priority = (isset($top_priority) ? max($top_priority, $priority) : $priority); - $grant['priority'] = (isset($grant['priority']) ? $priority : '– '); - $acquired_grants_nid[$priority][$grant['realm']][$grant['gid']] = $grant + array( - '#title' => _devel_node_access_get_node_title($node, TRUE), - '#module' => (isset($grant['#module']) ? $grant['#module'] : ''), - ); - } - krsort($acquired_grants_nid); - } - /*/ - // (This is the new D7 implementation; it retains backward compatibility.) - if (!empty($data)) { - foreach ($data as $data_by_realm) { - foreach ($data_by_realm as $data_by_realm_gid) { // by gid - if (isset($data_by_realm_gid['current'])) { - $grant = $data_by_realm_gid['current']; - } - elseif (isset($data_by_realm_gid['original'])) { - $grant = $data_by_realm_gid['original']; - $grant['#removed'] = 1; - } - else { - continue; - } - $priority = intval($grant['priority']); - $top_priority = (isset($top_priority) ? max($top_priority, $priority) : $priority); - $grant['priority'] = (isset($grant['priority']) ? $priority : '– '); - $grant['history'] = $data_by_realm_gid; - $acquired_grants_nid[$priority][$grant['realm']][$grant['gid']] = $grant + array( - '#title' => _devel_node_access_get_node_title($node), - '#module' => (isset($grant['#module']) ? $grant['#module'] : ''), - ); - } - } - krsort($acquired_grants_nid); - } - /**/ - //dpm($acquired_grants_nid, "acquired_grants_nid ="); - // check node_access_grants() - $published_nid[$nid] = $node->status; - if ($node->nid) { - foreach (array('view', 'update', 'delete') as $op) { - $grants = _devel_node_access_module_invoke_all('node_grants', $user, $op); - // call all hook_node_grants_alter() implementations - $ng_alter_data = _devel_node_access_ng_alter($grants, $user, $op); - $checked_grants[$nid][$op] = array_merge(array('all' => array(0)), $grants); - } - } - } - - // check for grants in the node_access table that aren't returned by node_access_acquire_grants() - - if (isset($active_grants[$nid])) { - foreach ($active_grants[$nid] as $realm => $active_grants_realm) { - foreach ($active_grants_realm as $gid => $active_grant) { - $found = FALSE; - $count_nonempty_grants = 0; - foreach ($acquired_grants_nid as $priority => $acquired_grants_nid_priority) { - if (isset($acquired_grants_nid_priority[$realm][$gid])) { - $found = TRUE; - } - } - if ($acquired_grants_nid_priority = reset($acquired_grants_nid)) { // highest priority only - foreach ($acquired_grants_nid_priority as $acquired_grants_nid_priority_realm) { - foreach ($acquired_grants_nid_priority_realm as $acquired_grants_nid_priority_realm_gid) { - $count_nonempty_grants += (!empty($acquired_grants_nid_priority_realm_gid['grant_view']) || !empty($acquired_grants_nid_priority_realm_gid['grant_update']) || !empty($acquired_grants_nid_priority_realm_gid['grant_delete'])); - } - } - } - $fixed_grant = (array) $active_grant; - if ($count_nonempty_grants == 0 && $realm == 'all' && $gid == 0) { - $fixed_grant += array( - 'priority' => '–', - 'state' => 'default', - ); - } - elseif (!$found) { - $acknowledged = _devel_node_access_module_invoke_all('node_access_acknowledge', $fixed_grant); - if (empty($acknowledged)) { - // no module acknowledged this record, mark it as alien - $fixed_grant += array( - 'priority' => '?', - 'state' => 'alien', - ); - } - else { - // at least one module acknowledged the record, attribute it to the first one - $fixed_grant += array( - 'priority' => '–', - 'state' => 'static', - '#module' => reset(array_keys($acknowledged)), - ); - } - } - else { - continue; - } - $fixed_grant += array( - 'nid' => $nid, - '#title' => _devel_node_access_get_node_title($node), - ); - $all_grants[] = $fixed_grant; - } - } - } - - // order grants and evaluate their status - foreach ($acquired_grants_nid as $priority => $acquired_grants_priority) { - ksort($acquired_grants_priority); - foreach ($acquired_grants_priority as $realm => $acquired_grants_realm) { - ksort($acquired_grants_realm); - foreach ($acquired_grants_realm as $gid => $acquired_grant) { - if ($priority == $top_priority) { - if (empty($acquired_grant['grant_view']) && empty($acquired_grant['grant_update']) && empty($acquired_grant['grant_delete'])) { - $acquired_grant['state'] = 'empty'; - } - else { - if (isset($active_grants[$nid][$realm][$gid])) { - $acquired_grant['state'] = (isset($acquired_grant['#removed']) ? 'removed!' : 'ok'); - } - else { - $acquired_grant['state'] = (isset($acquired_grant['#removed']) ? 'removed' : 'missing'); - } - if ($acquired_grant['state'] == 'ok') { - foreach (array('view', 'update', 'delete') as $op) { - $active_grant = (array) $active_grants[$nid][$realm][$gid]; - if (empty($acquired_grant["grant_$op"]) != empty($active_grant["grant_$op"])) { - $acquired_grant["grant_$op!"] = $active_grant["grant_$op"]; - } - } - } - } - } - else { - $acquired_grant['state'] = (isset($active_grants[$nid][$realm][$gid]) ? 'illegitimate' : 'ignored'); - } - $all_grants[] = $acquired_grant + array('nid' => $nid); - } - } - } - } - - // fill in the table rows - $rows = array(); - $error_count = 0; - foreach ($all_grants as $grant) { - $row = new stdClass(); - $row->nid = $grant['nid']; - $row->title = $grant['#title']; - $row->priority = $grant['priority']; - $row->state = array('data' => $states[$grant['state']][0], 'title' => $states[$grant['state']][2]); - $row->realm = $grant['realm']; - $row->gid = $grant['gid']; - $row->grant_view = $grant['grant_view']; - $row->grant_update = $grant['grant_update']; - $row->grant_delete = $grant['grant_delete']; - $row->explained = implode('
', module_invoke_all('node_access_explain', $row)); - unset($row->title); // possibly needed above - if ($row->nid == 0 && $row->gid == 0 && $row->realm == 'all' && count($all_grants) > 1) { - $row->state = array('data' => $states['unexpected'][0], 'title' => $states['unexpected'][2]); - $class = $states['unexpected'][1]; - } - else { - $class = $states[$grant['state']][1]; - } - $row = (array) $row; - foreach (array('view', 'update', 'delete') as $op) { - $row["grant_$op"] = array('data' => $row["grant_$op"]); - if ((isset($checked_grants[$grant['nid']][$op][$grant['realm']]) && in_array($grant['gid'], $checked_grants[$grant['nid']][$op][$grant['realm']]) || ($row['nid'] == 0 && $row['gid'] == 0 && $row['realm'] == 'all')) && !empty($row["grant_$op"]['data']) && in_array($grant['state'], $active_states)) { - $row["grant_$op"]['data'] .= '′'; - $row["grant_$op"]['title'] = t('This entry grants access to this node to this user.'); - } - if (isset($grant["grant_$op!"])) { - $row["grant_$op"]['data'] = $grant["grant_$op!"] . '>' . (!$row["grant_$op"]['data'] ? 0 : $row["grant_$op"]['data']); - $row["grant_$op"]['class'][] = 'error'; - if ($class == 'ok') { - $row['state'] = array('data' => $states['wrong'][0], 'title' => $states['wrong'][2]); - $class = $states['wrong'][1]; - } - } - } - $error_count += ($class == 'error'); - $row['nid'] = array( - 'data' => '' . $row['nid'] . '', - 'title' => $grant['#title'], - ); - $row['realm'] = (empty($grant['#module']) || strpos($grant['realm'], $grant['#module']) === 0 ? '' : $grant['#module'] . ':
') . $grant['realm']; - - // prepend information from the D7 hook_node_access_records_alter() - $next_style = array(); - if (isset($grant['history'])) { - $history = $grant['history']; - if (($num_changes = count($history['changes']) - empty($history['current'])) > 0) { - $first_row = TRUE; - while (isset($history['original']) || $num_changes--) { - if (isset($history['original'])) { - $this_grant = $history['original']; - $this_action = '[ Original by ' . $this_grant['#module'] . ':'; - unset($history['original']); - } - else { - $change = $history['changes'][0]; - $this_grant = $change['grant']; - $this_action = ($first_row ? '[ ' : '') . $change['op'] . ':'; - array_shift($history['changes']); - } - $rows[] = array( - 'data' => array( - 'data' => array( - 'data' => $this_action, - 'style' => array('padding-bottom: 0;'), - ), - ), - 'style' => array_merge(($first_row ? array() : array('border-top-style: dashed;', 'border-top-width: 1px;')), array('border-bottom-style: none;')), - ); - $next_style = array('border-top-style: none;'); - if (count($history['changes'])) { - $g = $this_grant; - $rows[] = array( - 'data' => array('v', $g['priority'], '', $g['realm'], $g['gid'], $g['grant_view'], $g['grant_update'], $g['grant_delete'], 'v'), - 'style' => array('border-top-style: none;', 'border-bottom-style: dashed;'), - ); - $next_style = array('border-top-style: dashed;'); - } - $first_row = FALSE; - } - } - } - - // fix up the main row cells with the proper class (needed for Bartik) - foreach ($row as $key => $value) { - if (!is_array($value)) { - $row[$key] = array('data' => $value); - } - $row[$key]['class'] = array($class); - } - // add the main row - $will_append = empty($history['current']) && !empty($history['changes']); - $rows[] = array( - 'data' => array_values($row), - 'class' => array($class), - 'style' => array_merge($next_style, ($will_append ? array('border-bottom-style: none;') : array())), - ); - - // append information from the D7 hook_node_access_records_alter() - if ($will_append) { - $last_change = end($history['changes']); - $rows[] = array( - 'data' => array( - 'data' => array( - 'data' => $last_change['op'] . ' ]', - 'style' => array('padding-top: 0;'), - ), - ), - 'style' => array('border-top-style: none;'), - ); - } - } - - foreach ($rows as $i => $row) { - $rows[$i] = _devel_node_access_format_row($row); - } - - $output[] = array( - '#theme' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#attributes' => array( - 'class' => array('system-status-report'), - 'style' => 'text-align: left;', - ), - ); - - $output[] = array( - '#theme' => 'form_element', - '#description' => t('(Some of the table elements provide additional information if you hover your mouse over them.)'), - ); - - if ($error_count > 0) { - $variables['!Rebuild_permissions'] = '' . $tr('Rebuild permissions') . ''; - $output[] = array( - '#prefix' => "\n
", - '#markup' => t("You have errors in your !na table! You may be able to fix these for now by running !Rebuild_permissions, but this is likely to destroy the evidence and make it impossible to identify the underlying issues. If you don't fix those, the errors will probably come back again.
DON'T do this just yet if you intend to ask for help with this situation.", $variables), - '#suffix' => "

\n", - ); - } - - // Explain whether access is granted or denied, and why (using code from node_access()). - $tr = 't'; - array_shift($nids); // remove the 0 - $accounts = array(); - $variables += array( - '!username' => '' . theme('username', array('account' => $user)) . '', - '%uid' => $user->uid, - ); - - if (user_access('bypass node access')) { - $variables['%bypass_node_access'] = $tr('bypass node access'); - $output[] = array( - '#markup' => t('!username has the %bypass_node_access permission and thus full access to all nodes.', $variables), - '#suffix' => '
 ', - ); - } - else { - $variables['!list'] = '
' . _devel_node_access_get_grant_list($nid, $ng_alter_data) . '
'; - $variables['%access'] = 'view'; - $output[] = array( - '#prefix' => "\n
", - '#markup' => t('!username (user %uid) can use these grants (if they are present above) for %access access: !list', $variables), - '#suffix' => "
\n", - ); - $accounts[] = $user; - } - if (arg(0) == 'node' && is_numeric(arg(1)) && !$block1_visible) { // only for single nodes - if (user_is_logged_in()) { - $accounts[] = user_load(0); // Anonymous, too - } - foreach ($accounts as $account) { - $account_items = array(); - $nid_items = array(); - foreach ($nids as $nid) { - $op_items = array(); - foreach (array('create', 'view', 'update', 'delete') as $op) { - $explain = _devel_node_access_explain_access($op, $nid, $account); - $op_items[] = "
" . t('%op:', array('%op' => $op)) . '
' . $explain[2]; - } - $nid_items[] = array( - '#theme' => 'item_list', - '#items' => $op_items, - '#type' => 'ul', - '#prefix' => t('to node !nid:', array('!nid' => l($nid, 'node/' . $nid))) . "\n
", - '#suffix' => '
', - ); - } - if (count($nid_items) == 1) { - $account_items = $nid_items[0]; - } - else { - $account_items = array( - '#theme' => 'item_list', - '#items' => $nid_items, - '#type' => 'ul', - '#prefix' => "\n
", - '#suffix' => '
', - ); - } - $variables['!username'] = theme('username', array('account' => $account)); - $output[] = array( - '#prefix' => "\n
", - '#markup' => t("!username has the following access", $variables), - 'items' => $account_items, - '#suffix' => "\n
\n", - ); - } - } - } - - if (!empty($hint)) { - $output[] = array( - '#theme' => 'form_element', - '#description' => '(' . $hint . ')', - ); - } - $output[]['#markup'] = '

'; - $subject = t('node_access entries for nodes shown on this page'); - return array('subject' => $subject, 'content' => $output); - - case 'dna_user': - // show which users can access this node - if (arg(0) == 'node' && is_numeric($nid = arg(1)) && arg(2) == NULL && $node = node_load($nid)) { - $node_type = node_type_get_type($node); - $headers = array(t('username'), ' $node_type->name)) . '">' . t('create') . '', t('view'), t('update'), t('delete')); - $rows = array(); - // Find all users. The following operations are very inefficient, so we - // limit the number of users returned. It would be better to make a - // pager query, or at least make the number of users configurable. If - // anyone is up for that please submit a patch. - $query = db_select('users', 'u') - ->fields('u', array('uid')) - ->orderBy('access', 'DESC') - ->range(0, 9); - $uids = $query->execute()->fetchCol(); - array_unshift($uids, 0); - $accounts = user_load_multiple($uids); - foreach ($accounts as $account) { - $username = theme('username', array('account' => $account)); - if ($account->uid == $user->uid) { - $username = '' . $username . ''; - } - $rows[] = array( - $username, - theme('dna_permission', _devel_node_access_explain_access('create', $nid, $account)), - theme('dna_permission', _devel_node_access_explain_access('view', $nid, $account)), - theme('dna_permission', _devel_node_access_explain_access('update', $nid, $account)), - theme('dna_permission', _devel_node_access_explain_access('delete', $nid, $account)), - ); - } - if (count($rows)) { - $output[] = array( - '#theme' => 'table', - '#header' => $headers, - '#rows' => $rows, - '#attributes' => array('style' => 'text-align: left'), - ); - $output[] = array( - '#theme' => 'form_element', - '#description' => t('(This table lists the most-recently active users. Hover your mouse over each result for more details.)'), - ); - - return array( - 'subject' => t('Access permissions by user'), - 'content' => $output, - ); - } - } - break; - } -} - -/** - * Helper function that mimicks node.module's node_access() function. - * - * Unfortunately, this needs to be updated manually whenever node.module changes! - * - * @return - * An array suitable for theming with theme_dna_permission(). - */ -function _devel_node_access_explain_access($op, $node, $account = NULL) { - global $user; - - if (is_numeric($node) && !($node = node_load($node))) { - return array( - FALSE, - '???', - t('Unable to load the node – this should never happen!'), - ); - } - if (!in_array($op, array('view', 'update', 'delete', 'create'), TRUE)) { - return array( - FALSE, - t('!NO: invalid $op', array('!NO' => t('NO'))), - t("'@op' is an invalid operation!", array('@op' => $op)), - ); - } - - if ($op == 'create' && is_object($node)) { - $node = $node->type; - } - - if (!empty($account)) { - // To try to get the most authentic result we impersonate the given user! - // This may reveal bugs in other modules, leading to contradictory results. - $saved_user = $user; - drupal_save_session(FALSE); - $user = $account; - $result = _devel_node_access_explain_access($op, $node, NULL); - $user = $saved_user; - drupal_save_session(TRUE); - $second_opinion = node_access($op, $node, $account); - if ($second_opinion != $result[0]) { - $result[1] .= '*'; - } - return $result; - } - - $variables = array( - '!NO' => t('NO'), - '!YES' => t('YES'), - '!bypass_node_access' => t('bypass node access'), - '!access_content' => t('access content'), - ); - - if (user_access('bypass node access')) { - return array( - TRUE, - t('!YES: bypass node access', $variables), - t("!YES: This user has the '!bypass_node_access' permission and may do everything with nodes.", $variables), - ); - } - - if (!user_access('access content')) { - return array( - FALSE, - t('!NO: access content', $variables), - t("!NO: This user does not have the '!access_content' permission and is denied doing anything with content.", $variables), - ); - } - - foreach (module_implements('node_access') as $module) { - $function = $module . '_node_access'; - if (function_exists($function)) { - $result = $function($node, $op, $user); - if ($module == 'node') { - $module = 'node (permissions)'; - } - if (isset($result)) { - if ($result === NODE_ACCESS_DENY) { - $denied_by[] = $module; - } - elseif ($result === NODE_ACCESS_ALLOW) { - $allowed_by[] = $module; - } - $access[] = $result; - } - } - } - $variables += array( - '@deniers' => (empty($denied_by) ? NULL : implode(', ', $denied_by)), - '@allowers' => (empty($allowed_by) ? NULL : implode(', ', $allowed_by)), - ); - if (!empty($denied_by)) { - $variables += array( - '%module' => $denied_by[0] . (count($denied_by) > 1 ? '+' : ''), - ); - return array( - FALSE, - t('!NO: by %module', $variables), - empty($allowed_by) - ? t("!NO: hook_node_access() of the following module(s) denies this: @deniers.", $variables) - : t("!NO: hook_node_access() of the following module(s) denies this: @deniers – even though the following module(s) would allow it: @allowers.", $variables), - ); - } - if (!empty($allowed_by)) { - $variables += array( - '%module' => $allowed_by[0] . (count($allowed_by) > 1 ? '+' : ''), - '!view_own_unpublished_content' => t('view own unpublished content'), - ); - return array( - TRUE, - t('!YES: by %module', $variables), - t("!YES: hook_node_access() of the following module(s) allows this: @allowers.", $variables), - ); - } - - if ($op == 'view' && !$node->status && user_access('view own unpublished content') && $user->uid == $node->uid && $user->uid != 0) { - return array( - TRUE, - t('!YES: view own unpublished content', $variables), - t("!YES: The node is unpublished, but the user has the '!view_own_unpublished_content' permission.", $variables), - ); - } - - if ($op != 'create' && $node->nid) { - if (node_access($op, $node)) { // delegate this part - $variables['@node_access_table'] = '{node_access}'; - return array( - TRUE, - t('!YES: @node_access_table', $variables), - t('!YES: Node access allows this based on one or more records in the @node_access_table table (see the other DNA block!).', $variables), - ); - } - } - - return array( - FALSE, - t('!NO: no reason', $variables), - t("!NO: None of the checks resulted in allowing this, so it's denied.", $variables) - . ($op == 'create' ? ' ' . t('This is most likely due to a withheld permission.') : ''), - ); -} - -/** - * Helper function to create a list of the grants returned by hook_node_grants(). - */ -function _devel_node_access_get_grant_list($nid, $ng_alter_data) { - //dpm($ng_alter_data, "_devel_node_access_get_grant_list($nid,"); - $ng_alter_data = array_merge(array('all' => array(0 => array('cur' => TRUE, 'ori' => array('all')))), $ng_alter_data); - $items = array(); - if (count($ng_alter_data)) { - foreach ($ng_alter_data as $realm => $gids) { - ksort($gids); - $gs = array(); - foreach ($gids as $gid => $history) { - if ($history['cur']) { - if (isset($history['ori'])) { - $g = $gid; // original grant, still active - } - else { - $g = '' . $gid . ''; // new grant, still active - } - } - else { - $g = '' . $gid . ''; // deleted grant - } - - $ghs = array(); - if (isset($history['ori']) && strpos($realm, $history['ori'][0]) !== 0) { - $ghs[] = 'by ' . $history['ori'][0]; - } - if (isset($history['chg'])) { - foreach ($history['chg'] as $h) { - $ghs[] = $h; - } - } - if (!empty($ghs)) { - $g .= ' (' . implode(', ', $ghs) . ')'; - } - $gs[] = $g; - } - $items[] = $realm . ': ' . implode(', ', $gs); - } - if (!empty($items)) { - return theme('item_list', array('items' => $items, 'type' => 'ul')); - } - } -} - -/** - * Implements hook_node_access_explain(). - */ -function devel_node_access_node_access_explain($row) { - if ($row->gid == 0 && $row->realm == 'all') { - foreach (array('view', 'update', 'delete') as $op) { - $gop = 'grant_' . $op; - if (!empty($row->$gop)) { - $ops[] = $op; - } - } - if (empty($ops)) { - return '(No access granted to ' . ($row->nid == 0 ? 'any nodes.)' : 'this node.)'); - } - else { - return 'All users may ' . implode('/', $ops) . ($row->nid == 0 ? ' all nodes.' : ' this node.'); - } - } -} - -/** - * Helper function to return a sanitized node title. - */ -function _devel_node_access_get_node_title($node, $clip_and_decorate = FALSE) { - if (isset($node)) { - if (isset($node->title)) { - $node_title = check_plain(!is_array($node->title) ? $node->title : $node->title[LANGUAGE_NONE][0]['value']); - if ($clip_and_decorate) { - if (drupal_strlen($node_title) > 20) { - $node_title = "" . drupal_substr($node_title, 0, 15) . '...'; - } - $node_title = '' . $node_title . ''; - } - return $node_title; - } - elseif (isset($node->nid)) { - return $node->nid; - } - } - return '—'; -} - -/** - * Helper function to apply common formatting to a debug-mode table row. - */ -function _devel_node_access_format_row($row, $may_unpack = TRUE) { - if ($may_unpack && isset($row['data'])) { - $row['data'] = _devel_node_access_format_row($row['data'], FALSE); - $row['class'][] = 'even'; - return $row; - } - if (count($row) == 1) { - if (is_scalar($row['data'])) { - $row['data'] = array('data' => $row['data']); - } - $row['data']['colspan'] = 9; - } - else { - $row = array_values($row); - foreach (array(0, 1, 4) as $j) { // node, prio, gid - if (is_scalar($row[$j])) { - $row[$j] = array('data' => $row[$j]); - } - $row[$j]['style'][] = 'text-align: right;'; - } - } - return $row; -} - -/** - * Implementation of hook_theme(). - */ -function devel_node_access_theme() { - return array( - 'dna_permission' => array( - 'arguments' => array('permission' => NULL), - ), - ); -} - -/** - * Indicate whether user has a permission or not. - */ -function theme_dna_permission($permission) { - return '' . $permission[1] . ''; -} diff --git a/jquery-1.4.4-uncompressed.js b/jquery-1.4.4-uncompressed.js deleted file mode 100644 index 2ddcf9936e8ddda877131f8133c051dbab057020..0000000000000000000000000000000000000000 --- a/jquery-1.4.4-uncompressed.js +++ /dev/null @@ -1,7179 +0,0 @@ -/*! - * jQuery JavaScript Library v1.4.4 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Nov 11 19:04:53 2010 -0500 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, - - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - rwhite = /\s/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Check for non-word characters - rnonword = /\W/, - - // Check for digits - rdigit = /\d/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // Has the ready events already been bound? - readyBound = false, - - // The functions to execute on DOM ready - readyList = [], - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - init: function( selector, context ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = "body"; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - match = quickExpr.exec( selector ); - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - doc = (context ? context.ownerDocument || context : document); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $("TAG") - } else if ( !context && !rnonword.test( selector ) ) { - this.selector = selector; - this.context = document; - selector = document.getElementsByTagName( selector ); - return jQuery.merge( this, selector ); - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return (context || rootjQuery).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return jQuery( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if (selector.selector !== undefined) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.4.4", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = jQuery(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + (this.selector ? " " : "") + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // If the DOM is already ready - if ( jQuery.isReady ) { - // Execute the function immediately - fn.call( document, jQuery ); - - // Otherwise, remember the function for later - } else if ( readyList ) { - // Add the function to the wait list - readyList.push( fn ); - } - - return this; - }, - - eq: function( i ) { - return i === -1 ? - this.slice( i ) : - this.slice( i, +i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || jQuery(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - window.$ = _$; - - if ( deep ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - // A third-party is pushing the ready event forwards - if ( wait === true ) { - jQuery.readyWait--; - } - - // Make sure that the DOM is not already loaded - if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - if ( readyList ) { - // Execute all of them - var fn, - i = 0, - ready = readyList; - - // Reset the list of functions - readyList = null; - - while ( (fn = ready[ i++ ]) ) { - fn.call( document, jQuery ); - } - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).unbind( "ready" ); - } - } - } - }, - - bindReady: function() { - if ( readyBound ) { - return; - } - - readyBound = true; - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent("onreadystatechange", DOMContentLoaded); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - // A crude way of determining if an object is a window - isWindow: function( obj ) { - return obj && typeof obj === "object" && "setInterval" in obj; - }, - - isNaN: function( obj ) { - return obj == null || !rdigit.test( obj ) || isNaN( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw msg; - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test(data.replace(rvalidescape, "@") - .replace(rvalidtokens, "]") - .replace(rvalidbraces, "")) ) { - - // Try to use the native JSON parser first - return window.JSON && window.JSON.parse ? - window.JSON.parse( data ) : - (new Function("return " + data))(); - - } else { - jQuery.error( "Invalid JSON: " + data ); - } - }, - - noop: function() {}, - - // Evalulates a script in a global context - globalEval: function( data ) { - if ( data && rnotwhite.test(data) ) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - - if ( jQuery.support.scriptEval ) { - script.appendChild( document.createTextNode( data ) ); - } else { - script.text = data; - } - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore( script, head.firstChild ); - head.removeChild( script ); - } - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction(object); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( var value = object[0]; - i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // The extra typeof function check is to prevent crashes - // in Safari 2 (See: #3039) - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type(array); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array ) { - if ( array.indexOf ) { - return array.indexOf( elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var ret = [], value; - - // Go through the array, translating each of the items to their - // new value (or values). - for ( var i = 0, length = elems.length; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - proxy: function( fn, proxy, thisObject ) { - if ( arguments.length === 2 ) { - if ( typeof proxy === "string" ) { - thisObject = fn; - fn = thisObject[ proxy ]; - proxy = undefined; - - } else if ( proxy && !jQuery.isFunction( proxy ) ) { - thisObject = proxy; - proxy = undefined; - } - } - - if ( !proxy && fn ) { - proxy = function() { - return fn.apply( thisObject || this, arguments ); - }; - } - - // Set the guid of unique handler to the same of original handler, so it can be removed - if ( fn ) { - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - } - - // So proxy can be declared as an argument - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can be optionally by executed if its a function - access: function( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - jQuery.access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : undefined; - }, - - now: function() { - return (new Date()).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -if ( indexOf ) { - jQuery.inArray = function( elem, array ) { - return indexOf.call( array, elem ); - }; -} - -// Verify that \s matches non-breaking spaces -// (IE fails on this test) -if ( !rwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -// Expose jQuery to the global object -return (window.jQuery = window.$ = jQuery); - -})(); - - -(function() { - - jQuery.support = {}; - - var root = document.documentElement, - script = document.createElement("script"), - div = document.createElement("div"), - id = "script" + jQuery.now(); - - div.style.display = "none"; - div.innerHTML = "
a"; - - var all = div.getElementsByTagName("*"), - a = div.getElementsByTagName("a")[0], - select = document.createElement("select"), - opt = select.appendChild( document.createElement("option") ); - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return; - } - - jQuery.support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: div.firstChild.nodeType === 3, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName("tbody").length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName("link").length, - - // Get the style information from getAttribute - // (IE uses .cssText insted) - style: /red/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: a.getAttribute("href") === "/a", - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55$/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: div.getElementsByTagName("input")[0].value === "on", - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Will be defined later - deleteExpando: true, - optDisabled: false, - checkClone: false, - scriptEval: false, - noCloneEvent: true, - boxModel: null, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableHiddenOffsets: true - }; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as diabled) - select.disabled = true; - jQuery.support.optDisabled = !opt.disabled; - - script.type = "text/javascript"; - try { - script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); - } catch(e) {} - - root.insertBefore( script, root.firstChild ); - - // Make sure that the execution of code works by injecting a script - // tag with appendChild/createTextNode - // (IE doesn't support this, fails, and uses .text instead) - if ( window[ id ] ) { - jQuery.support.scriptEval = true; - delete window[ id ]; - } - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete script.test; - - } catch(e) { - jQuery.support.deleteExpando = false; - } - - root.removeChild( script ); - - if ( div.attachEvent && div.fireEvent ) { - div.attachEvent("onclick", function click() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - jQuery.support.noCloneEvent = false; - div.detachEvent("onclick", click); - }); - div.cloneNode(true).fireEvent("onclick"); - } - - div = document.createElement("div"); - div.innerHTML = ""; - - var fragment = document.createDocumentFragment(); - fragment.appendChild( div.firstChild ); - - // WebKit doesn't clone checked state correctly in fragments - jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; - - // Figure out if the W3C box model works as expected - // document.body must exist before we can do this - jQuery(function() { - var div = document.createElement("div"); - div.style.width = div.style.paddingLeft = "1px"; - - document.body.appendChild( div ); - jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; - - if ( "zoom" in div.style ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.style.display = "inline"; - div.style.zoom = 1; - jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = ""; - div.innerHTML = "
"; - jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; - } - - div.innerHTML = "
t
"; - var tds = div.getElementsByTagName("td"); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; - - tds[0].style.display = ""; - tds[1].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE < 8 fail this test) - jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; - div.innerHTML = ""; - - document.body.removeChild( div ).style.display = "none"; - div = tds = null; - }); - - // Technique from Juriy Zaytsev - // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ - var eventSupported = function( eventName ) { - var el = document.createElement("div"); - eventName = "on" + eventName; - - var isSupported = (eventName in el); - if ( !isSupported ) { - el.setAttribute(eventName, "return;"); - isSupported = typeof el[eventName] === "function"; - } - el = null; - - return isSupported; - }; - - jQuery.support.submitBubbles = eventSupported("submit"); - jQuery.support.changeBubbles = eventSupported("change"); - - // release memory in IE - root = script = div = all = a = null; -})(); - - - -var windowData = {}, - rbrace = /^(?:\{.*\}|\[.*\])$/; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - expando: "jQuery" + jQuery.now(), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - data: function( elem, name, data ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - elem = elem == window ? - windowData : - elem; - - var isNode = elem.nodeType, - id = isNode ? elem[ jQuery.expando ] : null, - cache = jQuery.cache, thisCache; - - if ( isNode && !id && typeof name === "string" && data === undefined ) { - return; - } - - // Get the data from the object directly - if ( !isNode ) { - cache = elem; - - // Compute a unique ID for the element - } else if ( !id ) { - elem[ jQuery.expando ] = id = ++jQuery.uuid; - } - - // Avoid generating a new cache unless none exists and we - // want to manipulate it. - if ( typeof name === "object" ) { - if ( isNode ) { - cache[ id ] = jQuery.extend(cache[ id ], name); - - } else { - jQuery.extend( cache, name ); - } - - } else if ( isNode && !cache[ id ] ) { - cache[ id ] = {}; - } - - thisCache = isNode ? cache[ id ] : cache; - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) { - thisCache[ name ] = data; - } - - return typeof name === "string" ? thisCache[ name ] : thisCache; - }, - - removeData: function( elem, name ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - elem = elem == window ? - windowData : - elem; - - var isNode = elem.nodeType, - id = isNode ? elem[ jQuery.expando ] : elem, - cache = jQuery.cache, - thisCache = isNode ? cache[ id ] : id; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( thisCache ) { - // Remove the section of cache data - delete thisCache[ name ]; - - // If we've removed all the data, remove the element's cache - if ( isNode && jQuery.isEmptyObject(thisCache) ) { - jQuery.removeData( elem ); - } - } - - // Otherwise, we want to remove all of the element's data - } else { - if ( isNode && jQuery.support.deleteExpando ) { - delete elem[ jQuery.expando ]; - - } else if ( elem.removeAttribute ) { - elem.removeAttribute( jQuery.expando ); - - // Completely remove the data cache - } else if ( isNode ) { - delete cache[ id ]; - - // Remove all fields from the object - } else { - for ( var n in elem ) { - delete elem[ n ]; - } - } - } - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var data = null; - - if ( typeof key === "undefined" ) { - if ( this.length ) { - var attr = this[0].attributes, name; - data = jQuery.data( this[0] ); - - for ( var i = 0, l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = name.substr( 5 ); - dataAttr( this[0], name, data[ name ] ); - } - } - } - - return data; - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - // Try to fetch any internally stored data first - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - data = dataAttr( this[0], key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - - } else { - return this.each(function() { - var $this = jQuery( this ), - args = [ parts[0], value ]; - - $this.triggerHandler( "setData" + parts[1] + "!", args ); - jQuery.data( this, key, value ); - $this.triggerHandler( "changeData" + parts[1] + "!", args ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - data = elem.getAttribute( "data-" + key ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - !jQuery.isNaN( data ) ? parseFloat( data ) : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - - - - -jQuery.extend({ - queue: function( elem, type, data ) { - if ( !elem ) { - return; - } - - type = (type || "fx") + "queue"; - var q = jQuery.data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( !data ) { - return q || []; - } - - if ( !q || jQuery.isArray(data) ) { - q = jQuery.data( elem, type, jQuery.makeArray(data) ); - - } else { - q.push( data ); - } - - return q; - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(); - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift("inprogress"); - } - - fn.call(elem, function() { - jQuery.dequeue(elem, type); - }); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function( i ) { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; - type = type || "fx"; - - return this.queue( type, function() { - var elem = this; - setTimeout(function() { - jQuery.dequeue( elem, type ); - }, time ); - }); - }, - - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - } -}); - - - - -var rclass = /[\n\t]/g, - rspaces = /\s+/, - rreturn = /\r/g, - rspecialurl = /^(?:href|src|style)$/, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rradiocheck = /^(?:radio|checkbox)$/i; - -jQuery.props = { - "for": "htmlFor", - "class": "className", - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - colspan: "colSpan", - tabindex: "tabIndex", - usemap: "useMap", - frameborder: "frameBorder" -}; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name, fn ) { - return this.each(function(){ - jQuery.attr( this, name, "" ); - if ( this.nodeType === 1 ) { - this.removeAttribute( name ); - } - }); - }, - - addClass: function( value ) { - if ( jQuery.isFunction(value) ) { - return this.each(function(i) { - var self = jQuery(this); - self.addClass( value.call(this, i, self.attr("class")) ); - }); - } - - if ( value && typeof value === "string" ) { - var classNames = (value || "").split( rspaces ); - - for ( var i = 0, l = this.length; i < l; i++ ) { - var elem = this[i]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className ) { - elem.className = value; - - } else { - var className = " " + elem.className + " ", - setClass = elem.className; - - for ( var c = 0, cl = classNames.length; c < cl; c++ ) { - if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { - setClass += " " + classNames[c]; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - if ( jQuery.isFunction(value) ) { - return this.each(function(i) { - var self = jQuery(this); - self.removeClass( value.call(this, i, self.attr("class")) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - var classNames = (value || "").split( rspaces ); - - for ( var i = 0, l = this.length; i < l; i++ ) { - var elem = this[i]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - var className = (" " + elem.className + " ").replace(rclass, " "); - for ( var c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[c] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function(i) { - var self = jQuery(this); - self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspaces ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery.data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " "; - for ( var i = 0, l = this.length; i < l; i++ ) { - if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - if ( !arguments.length ) { - var elem = this[0]; - - if ( elem ) { - if ( jQuery.nodeName( elem, "option" ) ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - - // We need to handle select boxes special - if ( jQuery.nodeName( elem, "select" ) ) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - } - - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { - return elem.getAttribute("value") === null ? "on" : elem.value; - } - - - // Everything else, we just grab the value - return (elem.value || "").replace(rreturn, ""); - - } - - return undefined; - } - - var isFunction = jQuery.isFunction(value); - - return this.each(function(i) { - var self = jQuery(this), val = value; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call(this, i, self.val()); - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray(val) ) { - val = jQuery.map(val, function (value) { - return value == null ? "" : value + ""; - }); - } - - if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { - this.checked = jQuery.inArray( self.val(), val ) >= 0; - - } else if ( jQuery.nodeName( this, "select" ) ) { - var values = jQuery.makeArray(val); - - jQuery( "option", this ).each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - this.selectedIndex = -1; - } - - } else { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - // don't set attributes on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { - return undefined; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery(elem)[name](value); - } - - var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), - // Whether we are setting (or getting) - set = value !== undefined; - - // Try to normalize/fix the name - name = notxml && jQuery.props[ name ] || name; - - // These attributes require special treatment - var special = rspecialurl.test( name ); - - // Safari mis-reports the default selected property of an option - // Accessing the parent's selectedIndex property fixes it - if ( name === "selected" && !jQuery.support.optSelected ) { - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - - // If applicable, access the attribute via the DOM 0 way - // 'in' checks fail in Blackberry 4.7 #6931 - if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { - if ( set ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } - - if ( value === null ) { - if ( elem.nodeType === 1 ) { - elem.removeAttribute( name ); - } - - } else { - elem[ name ] = value; - } - } - - // browsers index elements by id/name on forms, give priority to attributes. - if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { - return elem.getAttributeNode( name ).nodeValue; - } - - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name === "tabIndex" ) { - var attributeNode = elem.getAttributeNode( "tabIndex" ); - - return attributeNode && attributeNode.specified ? - attributeNode.value : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - - return elem[ name ]; - } - - if ( !jQuery.support.style && notxml && name === "style" ) { - if ( set ) { - elem.style.cssText = "" + value; - } - - return elem.style.cssText; - } - - if ( set ) { - // convert the value to a string (all browsers do this but IE) see #1070 - elem.setAttribute( name, "" + value ); - } - - // Ensure that missing attributes return undefined - // Blackberry 4.7 returns "" from getAttribute #6938 - if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { - return undefined; - } - - var attr = !jQuery.support.hrefNormalized && notxml && special ? - // Some attributes require a special call on IE - elem.getAttribute( name, 2 ) : - elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return attr === null ? undefined : attr; - } -}); - - - - -var rnamespaces = /\.(.*)$/, - rformElems = /^(?:textarea|input|select)$/i, - rperiod = /\./g, - rspace = / /g, - rescape = /[^\w\s.|`]/g, - fcleanup = function( nm ) { - return nm.replace(rescape, "\\$&"); - }, - focusCounts = { focusin: 0, focusout: 0 }; - -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function( elem, types, handler, data ) { - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // For whatever reason, IE has trouble passing the window object - // around, causing it to be cloned in the process - if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { - elem = window; - } - - if ( handler === false ) { - handler = returnFalse; - } else if ( !handler ) { - // Fixes bug #7229. Fix recommended by jdalton - return; - } - - var handleObjIn, handleObj; - - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - } - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure - var elemData = jQuery.data( elem ); - - // If no elemData is found then we must be trying to bind to one of the - // banned noData elements - if ( !elemData ) { - return; - } - - // Use a key less likely to result in collisions for plain JS objects. - // Fixes bug #7150. - var eventKey = elem.nodeType ? "events" : "__events__", - events = elemData[ eventKey ], - eventHandle = elemData.handle; - - if ( typeof events === "function" ) { - // On plain objects events is a fn that holds the the data - // which prevents this data from being JSON serialized - // the function does not need to be called, it just contains the data - eventHandle = events.handle; - events = events.events; - - } else if ( !events ) { - if ( !elem.nodeType ) { - // On plain objects, create a fn that acts as the holder - // of the values to avoid JSON serialization of event data - elemData[ eventKey ] = elemData = function(){}; - } - - elemData.events = events = {}; - } - - if ( !eventHandle ) { - elemData.handle = eventHandle = function() { - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - return typeof jQuery !== "undefined" && !jQuery.event.triggered ? - jQuery.event.handle.apply( eventHandle.elem, arguments ) : - undefined; - }; - } - - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native events in IE. - eventHandle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = types.split(" "); - - var type, i = 0, namespaces; - - while ( (type = types[ i++ ]) ) { - handleObj = handleObjIn ? - jQuery.extend({}, handleObjIn) : - { handler: handler, data: data }; - - // Namespaced event handlers - if ( type.indexOf(".") > -1 ) { - namespaces = type.split("."); - type = namespaces.shift(); - handleObj.namespace = namespaces.slice(0).sort().join("."); - - } else { - namespaces = []; - handleObj.namespace = ""; - } - - handleObj.type = type; - if ( !handleObj.guid ) { - handleObj.guid = handler.guid; - } - - // Get the current list of functions bound to this event - var handlers = events[ type ], - special = jQuery.event.special[ type ] || {}; - - // Init the event handler queue - if ( !handlers ) { - handlers = events[ type ] = []; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add the function to the element's handler list - handlers.push( handleObj ); - - // Keep track of which events have been used, for global triggering - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, pos ) { - // don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - if ( handler === false ) { - handler = returnFalse; - } - - var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, - eventKey = elem.nodeType ? "events" : "__events__", - elemData = jQuery.data( elem ), - events = elemData && elemData[ eventKey ]; - - if ( !elemData || !events ) { - return; - } - - if ( typeof events === "function" ) { - elemData = events; - events = events.events; - } - - // types is actually an event object here - if ( types && types.type ) { - handler = types.handler; - types = types.type; - } - - // Unbind all events for the element - if ( !types || typeof types === "string" && types.charAt(0) === "." ) { - types = types || ""; - - for ( type in events ) { - jQuery.event.remove( elem, type + types ); - } - - return; - } - - // Handle multiple events separated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - types = types.split(" "); - - while ( (type = types[ i++ ]) ) { - origType = type; - handleObj = null; - all = type.indexOf(".") < 0; - namespaces = []; - - if ( !all ) { - // Namespaced event handlers - namespaces = type.split("."); - type = namespaces.shift(); - - namespace = new RegExp("(^|\\.)" + - jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - eventType = events[ type ]; - - if ( !eventType ) { - continue; - } - - if ( !handler ) { - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( all || namespace.test( handleObj.namespace ) ) { - jQuery.event.remove( elem, origType, handleObj.handler, j ); - eventType.splice( j--, 1 ); - } - } - - continue; - } - - special = jQuery.event.special[ type ] || {}; - - for ( j = pos || 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( handler.guid === handleObj.guid ) { - // remove the given handler for the given type - if ( all || namespace.test( handleObj.namespace ) ) { - if ( pos == null ) { - eventType.splice( j--, 1 ); - } - - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - - if ( pos != null ) { - break; - } - } - } - - // remove generic event handler if no more handlers exist - if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - ret = null; - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - var handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - delete elemData.events; - delete elemData.handle; - - if ( typeof elemData === "function" ) { - jQuery.removeData( elem, eventKey ); - - } else if ( jQuery.isEmptyObject( elemData ) ) { - jQuery.removeData( elem ); - } - } - }, - - // bubbling is internal - trigger: function( event, data, elem /*, bubbling */ ) { - // Event object or event type - var type = event.type || event, - bubbling = arguments[3]; - - if ( !bubbling ) { - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - jQuery.extend( jQuery.Event(type), event ) : - // Just the event type (string) - jQuery.Event(type); - - if ( type.indexOf("!") >= 0 ) { - event.type = type = type.slice(0, -1); - event.exclusive = true; - } - - // Handle a global trigger - if ( !elem ) { - // Don't bubble custom events when global (to avoid too much overhead) - event.stopPropagation(); - - // Only trigger if we've ever bound an event for it - if ( jQuery.event.global[ type ] ) { - jQuery.each( jQuery.cache, function() { - if ( this.events && this.events[type] ) { - jQuery.event.trigger( event, data, this.handle.elem ); - } - }); - } - } - - // Handle triggering a single element - - // don't do events on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { - return undefined; - } - - // Clean up in case it is reused - event.result = undefined; - event.target = elem; - - // Clone the incoming data, if any - data = jQuery.makeArray( data ); - data.unshift( event ); - } - - event.currentTarget = elem; - - // Trigger the event, it is assumed that "handle" is a function - var handle = elem.nodeType ? - jQuery.data( elem, "handle" ) : - (jQuery.data( elem, "__events__" ) || {}).handle; - - if ( handle ) { - handle.apply( elem, data ); - } - - var parent = elem.parentNode || elem.ownerDocument; - - // Trigger an inline bound script - try { - if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { - if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { - event.result = false; - event.preventDefault(); - } - } - - // prevent IE from throwing an error for some elements with some event types, see #3533 - } catch (inlineError) {} - - if ( !event.isPropagationStopped() && parent ) { - jQuery.event.trigger( event, data, parent, true ); - - } else if ( !event.isDefaultPrevented() ) { - var old, - target = event.target, - targetType = type.replace( rnamespaces, "" ), - isClick = jQuery.nodeName( target, "a" ) && targetType === "click", - special = jQuery.event.special[ targetType ] || {}; - - if ( (!special._default || special._default.call( elem, event ) === false) && - !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { - - try { - if ( target[ targetType ] ) { - // Make sure that we don't accidentally re-trigger the onFOO events - old = target[ "on" + targetType ]; - - if ( old ) { - target[ "on" + targetType ] = null; - } - - jQuery.event.triggered = true; - target[ targetType ](); - } - - // prevent IE from throwing an error for some elements with some event types, see #3533 - } catch (triggerError) {} - - if ( old ) { - target[ "on" + targetType ] = old; - } - - jQuery.event.triggered = false; - } - } - }, - - handle: function( event ) { - var all, handlers, namespaces, namespace_re, events, - namespace_sort = [], - args = jQuery.makeArray( arguments ); - - event = args[0] = jQuery.event.fix( event || window.event ); - event.currentTarget = this; - - // Namespaced event handlers - all = event.type.indexOf(".") < 0 && !event.exclusive; - - if ( !all ) { - namespaces = event.type.split("."); - event.type = namespaces.shift(); - namespace_sort = namespaces.slice(0).sort(); - namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - event.namespace = event.namespace || namespace_sort.join("."); - - events = jQuery.data(this, this.nodeType ? "events" : "__events__"); - - if ( typeof events === "function" ) { - events = events.events; - } - - handlers = (events || {})[ event.type ]; - - if ( events && handlers ) { - // Clone the handlers to prevent manipulation - handlers = handlers.slice(0); - - for ( var j = 0, l = handlers.length; j < l; j++ ) { - var handleObj = handlers[ j ]; - - // Filter the functions by class - if ( all || namespace_re.test( handleObj.namespace ) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handleObj.handler; - event.data = handleObj.data; - event.handleObj = handleObj; - - var ret = handleObj.handler.apply( this, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if ( event.isImmediatePropagationStopped() ) { - break; - } - } - } - } - - return event.result; - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ) { - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) { - // Fixes #1925 where srcElement might not be defined either - event.target = event.srcElement || document; - } - - // check if target is a textnode (safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) { - event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; - } - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var doc = document.documentElement, - body = document.body; - - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add which for key events - if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { - event.which = event.charCode != null ? event.charCode : event.keyCode; - } - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) { - event.metaKey = event.ctrlKey; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button !== undefined ) { - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - } - - return event; - }, - - // Deprecated, use jQuery.guid instead - guid: 1E8, - - // Deprecated, use jQuery.proxy instead - proxy: jQuery.proxy, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady, - teardown: jQuery.noop - }, - - live: { - add: function( handleObj ) { - jQuery.event.add( this, - liveConvert( handleObj.origType, handleObj.selector ), - jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); - }, - - remove: function( handleObj ) { - jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); - } - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src ) { - // Allow instantiation without the 'new' keyword - if ( !this.preventDefault ) { - return new jQuery.Event( src ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - // Event type - } else { - this.type = src; - } - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function( event ) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - - // Firefox sometimes assigns relatedTarget a XUL element - // which we cannot access the parentNode property of - try { - // Traverse up the tree - while ( parent && parent !== this ) { - parent = parent.parentNode; - } - - if ( parent !== this ) { - // set the correct event type - event.type = event.data; - - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply( this, arguments ); - } - - // assuming we've left the element since we most likely mousedover a xul element - } catch(e) { } -}, - -// In case of event delegation, we only need to rename the event.type, -// liveHandler will take care of the rest. -delegate = function( event ) { - event.type = event.data; - jQuery.event.handle.apply( this, arguments ); -}; - -// Create mouseenter and mouseleave events -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - setup: function( data ) { - jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); - }, - teardown: function( data ) { - jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); - } - }; -}); - -// submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function( data, namespaces ) { - if ( this.nodeName.toLowerCase() !== "form" ) { - jQuery.event.add(this, "click.specialSubmit", function( e ) { - var elem = e.target, - type = elem.type; - - if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { - e.liveFired = undefined; - return trigger( "submit", this, arguments ); - } - }); - - jQuery.event.add(this, "keypress.specialSubmit", function( e ) { - var elem = e.target, - type = elem.type; - - if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { - e.liveFired = undefined; - return trigger( "submit", this, arguments ); - } - }); - - } else { - return false; - } - }, - - teardown: function( namespaces ) { - jQuery.event.remove( this, ".specialSubmit" ); - } - }; - -} - -// change delegation, happens here so we have bind. -if ( !jQuery.support.changeBubbles ) { - - var changeFilters, - - getVal = function( elem ) { - var type = elem.type, val = elem.value; - - if ( type === "radio" || type === "checkbox" ) { - val = elem.checked; - - } else if ( type === "select-multiple" ) { - val = elem.selectedIndex > -1 ? - jQuery.map( elem.options, function( elem ) { - return elem.selected; - }).join("-") : - ""; - - } else if ( elem.nodeName.toLowerCase() === "select" ) { - val = elem.selectedIndex; - } - - return val; - }, - - testChange = function testChange( e ) { - var elem = e.target, data, val; - - if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { - return; - } - - data = jQuery.data( elem, "_change_data" ); - val = getVal(elem); - - // the current data will be also retrieved by beforeactivate - if ( e.type !== "focusout" || elem.type !== "radio" ) { - jQuery.data( elem, "_change_data", val ); - } - - if ( data === undefined || val === data ) { - return; - } - - if ( data != null || val ) { - e.type = "change"; - e.liveFired = undefined; - return jQuery.event.trigger( e, arguments[1], elem ); - } - }; - - jQuery.event.special.change = { - filters: { - focusout: testChange, - - beforedeactivate: testChange, - - click: function( e ) { - var elem = e.target, type = elem.type; - - if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { - return testChange.call( this, e ); - } - }, - - // Change has to be called before submit - // Keydown will be called before keypress, which is used in submit-event delegation - keydown: function( e ) { - var elem = e.target, type = elem.type; - - if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || - (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || - type === "select-multiple" ) { - return testChange.call( this, e ); - } - }, - - // Beforeactivate happens also before the previous element is blurred - // with this event you can't trigger a change event, but you can store - // information - beforeactivate: function( e ) { - var elem = e.target; - jQuery.data( elem, "_change_data", getVal(elem) ); - } - }, - - setup: function( data, namespaces ) { - if ( this.type === "file" ) { - return false; - } - - for ( var type in changeFilters ) { - jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); - } - - return rformElems.test( this.nodeName ); - }, - - teardown: function( namespaces ) { - jQuery.event.remove( this, ".specialChange" ); - - return rformElems.test( this.nodeName ); - } - }; - - changeFilters = jQuery.event.special.change.filters; - - // Handle when the input is .focus()'d - changeFilters.focus = changeFilters.beforeactivate; -} - -function trigger( type, elem, args ) { - args[0].type = type; - return jQuery.event.handle.apply( elem, args ); -} - -// Create "bubbling" focus and blur events -if ( document.addEventListener ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - jQuery.event.special[ fix ] = { - setup: function() { - if ( focusCounts[fix]++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --focusCounts[fix] === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - - function handler( e ) { - e = jQuery.event.fix( e ); - e.type = fix; - return jQuery.event.trigger( e, null, e.target ); - } - }); -} - -jQuery.each(["bind", "one"], function( i, name ) { - jQuery.fn[ name ] = function( type, data, fn ) { - // Handle object literals - if ( typeof type === "object" ) { - for ( var key in type ) { - this[ name ](key, data, type[key], fn); - } - return this; - } - - if ( jQuery.isFunction( data ) || data === false ) { - fn = data; - data = undefined; - } - - var handler = name === "one" ? jQuery.proxy( fn, function( event ) { - jQuery( this ).unbind( event, handler ); - return fn.apply( this, arguments ); - }) : fn; - - if ( type === "unload" && name !== "one" ) { - this.one( type, data, fn ); - - } else { - for ( var i = 0, l = this.length; i < l; i++ ) { - jQuery.event.add( this[i], type, handler, data ); - } - } - - return this; - }; -}); - -jQuery.fn.extend({ - unbind: function( type, fn ) { - // Handle object literals - if ( typeof type === "object" && !type.preventDefault ) { - for ( var key in type ) { - this.unbind(key, type[key]); - } - - } else { - for ( var i = 0, l = this.length; i < l; i++ ) { - jQuery.event.remove( this[i], type, fn ); - } - } - - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.live( types, data, fn, selector ); - }, - - undelegate: function( selector, types, fn ) { - if ( arguments.length === 0 ) { - return this.unbind( "live" ); - - } else { - return this.die( types, null, fn, selector ); - } - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - if ( this[0] ) { - var event = jQuery.Event( type ); - event.preventDefault(); - event.stopPropagation(); - jQuery.event.trigger( event, data, this[0] ); - return event.result; - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - i = 1; - - // link all the functions, so any of them can unbind this click handler - while ( i < args.length ) { - jQuery.proxy( fn, args[ i++ ] ); - } - - return this.click( jQuery.proxy( fn, function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - })); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -var liveMap = { - focus: "focusin", - blur: "focusout", - mouseenter: "mouseover", - mouseleave: "mouseout" -}; - -jQuery.each(["live", "die"], function( i, name ) { - jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { - var type, i = 0, match, namespaces, preType, - selector = origSelector || this.selector, - context = origSelector ? this : jQuery( this.context ); - - if ( typeof types === "object" && !types.preventDefault ) { - for ( var key in types ) { - context[ name ]( key, data, types[key], selector ); - } - - return this; - } - - if ( jQuery.isFunction( data ) ) { - fn = data; - data = undefined; - } - - types = (types || "").split(" "); - - while ( (type = types[ i++ ]) != null ) { - match = rnamespaces.exec( type ); - namespaces = ""; - - if ( match ) { - namespaces = match[0]; - type = type.replace( rnamespaces, "" ); - } - - if ( type === "hover" ) { - types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); - continue; - } - - preType = type; - - if ( type === "focus" || type === "blur" ) { - types.push( liveMap[ type ] + namespaces ); - type = type + namespaces; - - } else { - type = (liveMap[ type ] || type) + namespaces; - } - - if ( name === "live" ) { - // bind live handler - for ( var j = 0, l = context.length; j < l; j++ ) { - jQuery.event.add( context[j], "live." + liveConvert( type, selector ), - { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); - } - - } else { - // unbind live handler - context.unbind( "live." + liveConvert( type, selector ), fn ); - } - } - - return this; - }; -}); - -function liveHandler( event ) { - var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, - elems = [], - selectors = [], - events = jQuery.data( this, this.nodeType ? "events" : "__events__" ); - - if ( typeof events === "function" ) { - events = events.events; - } - - // Make sure we avoid non-left-click bubbling in Firefox (#3861) - if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { - return; - } - - if ( event.namespace ) { - namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); - } - - event.liveFired = this; - - var live = events.live.slice(0); - - for ( j = 0; j < live.length; j++ ) { - handleObj = live[j]; - - if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { - selectors.push( handleObj.selector ); - - } else { - live.splice( j--, 1 ); - } - } - - match = jQuery( event.target ).closest( selectors, event.currentTarget ); - - for ( i = 0, l = match.length; i < l; i++ ) { - close = match[i]; - - for ( j = 0; j < live.length; j++ ) { - handleObj = live[j]; - - if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { - elem = close.elem; - related = null; - - // Those two events require additional checking - if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { - event.type = handleObj.preType; - related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; - } - - if ( !related || related !== elem ) { - elems.push({ elem: elem, handleObj: handleObj, level: close.level }); - } - } - } - } - - for ( i = 0, l = elems.length; i < l; i++ ) { - match = elems[i]; - - if ( maxLevel && match.level > maxLevel ) { - break; - } - - event.currentTarget = match.elem; - event.data = match.handleObj.data; - event.handleObj = match.handleObj; - - ret = match.handleObj.origHandler.apply( match.elem, arguments ); - - if ( ret === false || event.isPropagationStopped() ) { - maxLevel = match.level; - - if ( ret === false ) { - stop = false; - } - if ( event.isImmediatePropagationStopped() ) { - break; - } - } - } - - return stop; -} - -function liveConvert( type, selector ) { - return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); -} - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.bind( name, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } -}); - -// Prevent memory leaks in IE -// Window isn't included so as not to unbind existing unload events -// More info: -// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ -if ( window.attachEvent && !window.addEventListener ) { - jQuery(window).bind("unload", function() { - for ( var id in jQuery.cache ) { - if ( jQuery.cache[ id ].handle ) { - // Try/Catch is to handle iframes being unloaded, see #4280 - try { - jQuery.event.remove( jQuery.cache[ id ].handle.elem ); - } catch(e) {} - } - } - }); -} - - -/*! - * Sizzle CSS Selector Engine - v1.0 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var match, - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - var left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = context.getElementsByTagName( "*" ); - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - var found, item, - filter = Expr.filter[ type ], - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !/\W/.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !/\W/.test(part) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !/\W/.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - return context.getElementsByTagName( match[1] ); - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace(/\\/g, "") + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace(/\\/g, ""); - }, - - TAG: function( match, curLoop ) { - return match[1].toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1].replace(/\\/g, ""); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - return "text" === elem.type; - }, - radio: function( elem ) { - return "radio" === elem.type; - }, - - checkbox: function( elem ) { - return "checkbox" === elem.type; - }, - - file: function( elem ) { - return "file" === elem.type; - }, - password: function( elem ) { - return "password" === elem.type; - }, - - submit: function( elem ) { - return "submit" === elem.type; - }, - - image: function( elem ) { - return "image" === elem.type; - }, - - reset: function( elem ) { - return "reset" === elem.type; - }, - - button: function( elem ) { - return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( "Syntax error, unrecognized expression: " + name ); - } - }, - - CHILD: function( elem, match ) { - var type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - var first = match[2], - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // If the nodes are siblings (or identical) we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Utility function for retreiving the text value of an array of DOM nodes -Sizzle.getText = function( elems ) { - var ret = "", elem; - - for ( var i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += Sizzle.getText( elem.childNodes ); - } - } - - return ret; -}; - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Make sure that attribute selectors are quoted - query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - if ( context.nodeType === 9 ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var old = context.getAttribute( "id" ), - nid = old || id; - - if ( !old ) { - context.setAttribute( "id", nid ); - } - - try { - return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra ); - - } catch(pseudoError) { - } finally { - if ( !old ) { - context.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - if ( matches ) { - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - return matches.call( node, expr ); - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.POS; - -jQuery.fn.extend({ - find: function( selector ) { - var ret = this.pushStack( "", "find", selector ), - length = 0; - - for ( var i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( var n = length; n < ret.length; n++ ) { - for ( var r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && jQuery.filter( selector, this ).length > 0; - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - if ( jQuery.isArray( selectors ) ) { - var match, selector, - matches = {}, - level = 1; - - if ( cur && selectors.length ) { - for ( i = 0, l = selectors.length; i < l; i++ ) { - selector = selectors[i]; - - if ( !matches[selector] ) { - matches[selector] = jQuery.expr.match.POS.test( selector ) ? - jQuery( selector, context || this.context ) : - selector; - } - } - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( selector in matches ) { - match = matches[selector]; - - if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { - ret.push({ selector: selector, elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - } - - return ret; - } - - var pos = POS.test( selectors ) ? - jQuery( selectors, context || this.context ) : null; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique(ret) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - if ( !elem || typeof elem === "string" ) { - return jQuery.inArray( this[0], - // If it receives a string, the selector is used - // If it receives nothing, the siblings are used - elem ? jQuery( elem ) : this.parent().children() ); - } - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context || this.context ) : - jQuery.makeArray( selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, slice.call(arguments).join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return (elem === qualifier) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return (jQuery.inArray( elem, qualifier ) >= 0) === keep; - }); -} - - - - -var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /\s]+\/)>/g, - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and - -
  • -
    - - - (NULL) -
    -
  • -$_recursion_marker++) - : @($bee[$_recursion_marker]++); - - $_[0][] =& $bee; - } - - // return all bees - // - return $_[0]; - } - - // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - /** - * Render a dump for the properties of an array or objeect - * - * @param mixed &$data - * @access private - * @static - */ - Private Static Function _vars(&$data) { - - $_is_object = is_object($data); - - // test for references in order to - // prevent endless recursion loops - // - $_recursion_marker = krumo::_marker(); - $_r = ($_is_object) - ? @$data->$_recursion_marker - : @$data[$_recursion_marker] ; - $_r = (integer) $_r; - - // recursion detected - // - if ($_r > 0) { - return krumo::_recursion(); - } - - // stain it - // - krumo::_hive($data); - - // render it - // - ?> - - - - -
  • - -
    0) {?> onClick="krumo.toggle(this);" - onMouseOver="krumo.over(this);" - onMouseOut="krumo.out(this);"> - - - (Array, ) - - - - | - (Callback) - ::(); - - -
    - - -
  • - -
  • - -
    0) {?> onClick="krumo.toggle(this);" - onMouseOver="krumo.over(this);" - onMouseOut="krumo.out(this);"> - - - (Object) - -
    - - -
  • - -
  • - -
    - - - (Resource) - -
    - -
  • - -
  • - -
    - - - (Boolean) - -
    - -
  • - -
  • - -
    - - - (Integer) - -
    - -
  • - -
  • - -
    - - - (Float) - -
    - -
  • - KRUMO_TRUNCATE_LENGTH) { - $_ = substr($data, 0, KRUMO_TRUNCATE_LENGTH - 3) . '...'; - $_extra = true; - } -?> -
  • - -
    onClick="krumo.toggle(this);" - onMouseOver="krumo.over(this);" - onMouseOut="krumo.out(this);"> - - - (String, - characters ) - - - - | - (Callback) - (); - - -
    - - - - -
  • - diff --git a/krumo/docs/Krumo/_class.krumo.php.html b/krumo/docs/Krumo/_class.krumo.php.html deleted file mode 100644 index 6b3fcf400a6d13b589da2389be9092984ba5c084..0000000000000000000000000000000000000000 --- a/krumo/docs/Krumo/_class.krumo.php.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - Docs for page class.krumo.php - - - - - -
    -

    File/class.krumo.php

    - - -
    -
    Description
    - -
    - -

    Krumo: Structured information display solution

    -

    Krumo is a debugging tool (PHP5 only), which displays structured information about any PHP variable. It is a nice replacement for print_r() or var_dump() which are used by a lot of PHP developers.

    - - -
    -
    - - -
    -
    Classes
    - -
    - - - - - - - - - -
    ClassDescription
    -  class - krumo - - Krumo API -
    -
    -
    - - - -
    -
    Constants
    - -
    - -
    - -
    - - - DIR_SEP = DIRECTORY_SEPARATOR - (line 22) - -
    - - -

    backward compatibility: the DIR_SEP constant isn't used anymore

    - - -
    - -
    - -
    - - - KRUMO_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR - (line 39) - -
    - - -

    Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.

    - - -
    - -
    - -
    - - - KRUMO_TRUNCATE_LENGTH = 50 - (line 48) - -
    - - -

    This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.

    - - -
    - -
    - -
    - - - PATH_SEPARATOR = OS_WINDOWS?';':':' - (line 28) - -
    - - -

    backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2

    - - -
    -
    -
    - - - -
    -
    Functions
    - -
    - -
    - -
    - - krumo (line 1295) -
    - - -

    Alias of krumo::dump()

    - -
    - void - - krumo - - ([mixed $data,... = ]) -
    - -
      -
    • - mixed - $data,...
    • -
    - - -
    -
    -
    - -

    - Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by phpDocumentor 1.4.0a2 -

    -
    - \ No newline at end of file diff --git a/krumo/docs/Krumo/krumo.html b/krumo/docs/Krumo/krumo.html deleted file mode 100755 index ce4d33b8977eb4fd10c5058b0e9e41c7401039ec..0000000000000000000000000000000000000000 --- a/krumo/docs/Krumo/krumo.html +++ /dev/null @@ -1,900 +0,0 @@ - - - - - - Docs For Class krumo - - - - - -
    -

     Class krumo

    - - -
    -
    Description
    - -
    - -

    Krumo API

    -

    This class stores the Krumo API for rendering and displaying the structured information it is reporting

    -

    - Located in /class.krumo.php (line 61) -

    - - -
    
    -	
    -			
    -
    - - - - - -
    -
    Method Summary
    - -
    -
    - -
    -  - static void - backtrace - () -
    - -
    -  - static void - classes - () -
    - -
    -  - static void - conf - () -
    - -
    -  - static void - cookie - () -
    - -
    -  - static void - defines - () -
    - -
    -  - static boolean - disable - () -
    - -
    -  - static void - dump - ( $data, mixed $data,...) -
    - -
    -  - static boolean - enable - () -
    - -
    -  - static void - env - () -
    - -
    -  - static void - extensions - () -
    - -
    -  - static void - functions - () -
    - -
    -  - static void - get - () -
    - -
    -  - static void - headers - () -
    - -
    -  - static void - includes - () -
    - -
    -  - static void - ini - (string $ini_file) -
    - -
    -  - static void - interfaces - () -
    - -
    -  - static void - path - () -
    - -
    -  - static void - phpini - () -
    - -
    -  - static void - post - () -
    - -
    -  - static void - request - () -
    - -
    -  - static void - server - () -
    - -
    -  - static void - session - () -
    - -
    -  - static string - version - () -
    -
    -
    -
    - - - -
    -
    Methods
    - -
    - - -
    - -
    - - static backtrace (line 82) -
    - - -

    Prints a debug backtrace

    -
      -
    • access: public
    • -
    - -
    - static void - - backtrace - - () -
    - - - -
    - -
    - -
    - - static classes (line 101) -
    - - -

    Prints a list of all currently declared classes.

    -
      -
    • access: public
    • -
    - -
    - static void - - classes - - () -
    - - - -
    - -
    - -
    - - static conf (line 297) -
    - - -

    Prints a list of all your configuration settings.

    -
      -
    • access: public
    • -
    - -
    - static void - - conf - - () -
    - - - -
    - -
    - -
    - - static cookie (line 441) -
    - - -

    Prints a list of all the values from the $_COOKIE array.

    -
      -
    • access: public
    • -
    - -
    - static void - - cookie - - () -
    - - - -
    - -
    - -
    - - static defines (line 197) -
    - - -

    Prints a list of all currently declared constants.

    -
      -
    • access: public
    • -
    - -
    - static void - - defines - - () -
    - - - -
    - -
    - -
    - - static disable (line 747) -
    - - -

    Disable Krumo

    -
      -
    • access: public
    • -
    - -
    - static boolean - - disable - - () -
    - - - -
    - -
    - -
    - - static dump (line 548) -
    - - -

    Dump information about a variable

    -
      -
    • access: public
    • -
    - -
    - static void - - dump - - ( $data, mixed $data,...) -
    - -
      -
    • - mixed - $data,...
    • -
    • - - $data
    • -
    - - -
    - -
    - -
    - - static enable (line 736) -
    - - -

    Enable Krumo

    -
      -
    • access: public
    • -
    - -
    - static boolean - - enable - - () -
    - - - -
    - -
    - -
    - - static env (line 465) -
    - - -

    Prints a list of all the values from the $_ENV array.

    -
      -
    • access: public
    • -
    - -
    - static void - - env - - () -
    - - - -
    - -
    - -
    - - static extensions (line 221) -
    - - -

    Prints a list of all currently loaded PHP extensions.

    -
      -
    • access: public
    • -
    - -
    - static void - - extensions - - () -
    - - - -
    - -
    - -
    - - static functions (line 173) -
    - - -

    Prints a list of all currently declared functions.

    -
      -
    • access: public
    • -
    - -
    - static void - - functions - - () -
    - - - -
    - -
    - -
    - - static get (line 369) -
    - - -

    Prints a list of all the values from the $_GET array.

    -
      -
    • access: public
    • -
    - -
    - static void - - get - - () -
    - - - -
    - -
    - -
    - - static headers (line 245) -
    - - -

    Prints a list of all HTTP request headers.

    -
      -
    • access: public
    • -
    - -
    - static void - - headers - - () -
    - - - -
    - -
    - -
    - - static includes (line 149) -
    - - -

    Prints a list of all currently included (or required) files.

    -
      -
    • access: public
    • -
    - -
    - static void - - includes - - () -
    - - - -
    - -
    - -
    - - static ini (line 515) -
    - - -

    Prints a list of all the values from an INI file.

    -
      -
    • access: public
    • -
    - -
    - static void - - ini - - (string $ini_file) -
    - -
      -
    • - string - $ini_file
    • -
    - - -
    - -
    - -
    - - static interfaces (line 125) -
    - - -

    Prints a list of all currently declared interfaces (PHP5 only).

    -
      -
    • access: public
    • -
    - -
    - static void - - interfaces - - () -
    - - - -
    - -
    - -
    - - static path (line 321) -
    - - -

    Prints a list of the specified directories under your include_path option.

    -
      -
    • access: public
    • -
    - -
    - static void - - path - - () -
    - - - -
    - -
    - -
    - - static phpini (line 269) -
    - - -

    Prints a list of the configuration settings read from php.ini

    -
      -
    • access: public
    • -
    - -
    - static void - - phpini - - () -
    - - - -
    - -
    - -
    - - static post (line 393) -
    - - -

    Prints a list of all the values from the $_POST array.

    -
      -
    • access: public
    • -
    - -
    - static void - - post - - () -
    - - - -
    - -
    - -
    - - static request (line 345) -
    - - -

    Prints a list of all the values from the $_REQUEST array.

    -
      -
    • access: public
    • -
    - -
    - static void - - request - - () -
    - - - -
    - -
    - -
    - - static server (line 417) -
    - - -

    Prints a list of all the values from the $_SERVER array.

    -
      -
    • access: public
    • -
    - -
    - static void - - server - - () -
    - - - -
    - -
    - -
    - - static session (line 489) -
    - - -

    Prints a list of all the values from the $_SESSION array.

    -
      -
    • access: public
    • -
    - -
    - static void - - session - - () -
    - - - -
    - -
    - -
    - - static version (line 70) -
    - - -

    Return Krumo version

    -
      -
    • access: public
    • -
    - -
    - static string - - version - - () -
    - - - -
    - -
    -
    - - -

    - Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by phpDocumentor 1.4.0a2 -

    -
    - \ No newline at end of file diff --git a/krumo/docs/blank.html b/krumo/docs/blank.html deleted file mode 100755 index 98c96360e63de1818cd91b8c323ebeae0bbb9a42..0000000000000000000000000000000000000000 --- a/krumo/docs/blank.html +++ /dev/null @@ -1,13 +0,0 @@ - - - Krumo - - - - -

    Krumo

    -Welcome to Krumo!
    -
    -This documentation was generated by phpDocumentor v1.4.0a2
    - - \ No newline at end of file diff --git a/krumo/docs/classtrees_Krumo.html b/krumo/docs/classtrees_Krumo.html deleted file mode 100755 index 8123084b98469a6013a76e080c3cde04a65bb432..0000000000000000000000000000000000000000 --- a/krumo/docs/classtrees_Krumo.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - -

    - -

    -

    Root class krumo

    - - -

    - Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by phpDocumentor 1.4.0a2 -

    - - \ No newline at end of file diff --git a/krumo/docs/elementindex.html b/krumo/docs/elementindex.html deleted file mode 100755 index bc89b7a342d194f26b85c6431ded872d8d2260de..0000000000000000000000000000000000000000 --- a/krumo/docs/elementindex.html +++ /dev/null @@ -1,392 +0,0 @@ - - - - - - - - - - -

    Full index

    -

    Package indexes

    - -
    -
    - b - c - d - e - f - g - h - i - k - p - r - s - v -
    - - -
    -
    b
    - -
    -
    -
    -
    - Method - backtrace -
    -
    -
    krumo::backtrace() in class.krumo.php
    -
    Prints a debug backtrace
    -
    -
    - -
    -
    c
    - -
    -
    -
    -
    - Page - class.krumo.php -
    -
    -
    class.krumo.php in class.krumo.php
    -
    -
    - Method - classes -
    -
    -
    krumo::classes() in class.krumo.php
    -
    Prints a list of all currently declared classes.
    -
    -
    - Method - conf -
    -
    -
    krumo::conf() in class.krumo.php
    -
    Prints a list of all your configuration settings.
    -
    -
    - Method - cookie -
    -
    -
    krumo::cookie() in class.krumo.php
    -
    Prints a list of all the values from the $_COOKIE array.
    -
    -
    - -
    -
    d
    - -
    -
    -
    -
    - Method - defines -
    -
    -
    krumo::defines() in class.krumo.php
    -
    Prints a list of all currently declared constants.
    -
    -
    - Constant - DIR_SEP -
    -
    -
    DIR_SEP in class.krumo.php
    -
    backward compatibility: the DIR_SEP constant isn't used anymore
    -
    -
    - Method - disable -
    -
    -
    krumo::disable() in class.krumo.php
    -
    Disable Krumo
    -
    -
    - Method - dump -
    -
    -
    krumo::dump() in class.krumo.php
    -
    Dump information about a variable
    -
    -
    - -
    -
    e
    - -
    -
    -
    -
    - Method - enable -
    -
    -
    krumo::enable() in class.krumo.php
    -
    Enable Krumo
    -
    -
    - Method - env -
    -
    -
    krumo::env() in class.krumo.php
    -
    Prints a list of all the values from the $_ENV array.
    -
    -
    - Method - extensions -
    -
    -
    krumo::extensions() in class.krumo.php
    -
    Prints a list of all currently loaded PHP extensions.
    -
    -
    - -
    -
    f
    - -
    -
    -
    -
    - Method - functions -
    -
    -
    krumo::functions() in class.krumo.php
    -
    Prints a list of all currently declared functions.
    -
    -
    - -
    -
    g
    - -
    -
    -
    -
    - Method - get -
    -
    -
    krumo::get() in class.krumo.php
    -
    Prints a list of all the values from the $_GET array.
    -
    -
    - -
    -
    h
    - -
    -
    -
    -
    - Method - headers -
    -
    -
    krumo::headers() in class.krumo.php
    -
    Prints a list of all HTTP request headers.
    -
    -
    - -
    -
    i
    - -
    -
    -
    -
    - Method - includes -
    -
    -
    krumo::includes() in class.krumo.php
    -
    Prints a list of all currently included (or required) files.
    -
    -
    - Method - ini -
    -
    -
    krumo::ini() in class.krumo.php
    -
    Prints a list of all the values from an INI file.
    -
    -
    - Method - interfaces -
    -
    -
    krumo::interfaces() in class.krumo.php
    -
    Prints a list of all currently declared interfaces (PHP5 only).
    -
    -
    - -
    -
    k
    - -
    -
    -
    -
    - Function - krumo -
    -
    -
    krumo() in class.krumo.php
    -
    Alias of krumo::dump()
    -
    -
    - Class - krumo -
    -
    -
    krumo in class.krumo.php
    -
    Krumo API
    -
    -
    - Constant - KRUMO_DIR -
    -
    -
    KRUMO_DIR in class.krumo.php
    -
    Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.
    -
    -
    - Constant - KRUMO_TRUNCATE_LENGTH -
    -
    -
    KRUMO_TRUNCATE_LENGTH in class.krumo.php
    -
    This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.
    -
    -
    - -
    -
    p
    - -
    -
    -
    -
    - Method - path -
    -
    -
    krumo::path() in class.krumo.php
    -
    Prints a list of the specified directories under your include_path option.
    -
    -
    - Constant - PATH_SEPARATOR -
    -
    -
    PATH_SEPARATOR in class.krumo.php
    -
    backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2
    -
    -
    - Method - phpini -
    -
    -
    krumo::phpini() in class.krumo.php
    -
    Prints a list of the configuration settings read from php.ini
    -
    -
    - Method - post -
    -
    -
    krumo::post() in class.krumo.php
    -
    Prints a list of all the values from the $_POST array.
    -
    -
    - -
    -
    r
    - -
    -
    -
    -
    - Method - request -
    -
    -
    krumo::request() in class.krumo.php
    -
    Prints a list of all the values from the $_REQUEST array.
    -
    -
    - -
    -
    s
    - -
    -
    -
    -
    - Method - server -
    -
    -
    krumo::server() in class.krumo.php
    -
    Prints a list of all the values from the $_SERVER array.
    -
    -
    - Method - session -
    -
    -
    krumo::session() in class.krumo.php
    -
    Prints a list of all the values from the $_SESSION array.
    -
    -
    - -
    -
    v
    - -
    -
    -
    -
    - Method - version -
    -
    -
    krumo::version() in class.krumo.php
    -
    Return Krumo version
    -
    -
    - -
    - b - c - d - e - f - g - h - i - k - p - r - s - v -
    - \ No newline at end of file diff --git a/krumo/docs/elementindex_Krumo.html b/krumo/docs/elementindex_Krumo.html deleted file mode 100755 index 39e7477217d34fb478db01483e0145d12ad63983..0000000000000000000000000000000000000000 --- a/krumo/docs/elementindex_Krumo.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - -

    [Krumo] element index

    -All elements -
    -
    - b - c - d - e - f - g - h - i - k - p - r - s - v -
    - - -
    -
    b
    - -
    -
    -
    -
    - Method - backtrace -
    -
    -
    krumo::backtrace() in class.krumo.php
    -
    Prints a debug backtrace
    -
    -
    - -
    -
    c
    - -
    -
    -
    -
    - Page - class.krumo.php -
    -
    -
    class.krumo.php in class.krumo.php
    -
    -
    - Method - classes -
    -
    -
    krumo::classes() in class.krumo.php
    -
    Prints a list of all currently declared classes.
    -
    -
    - Method - conf -
    -
    -
    krumo::conf() in class.krumo.php
    -
    Prints a list of all your configuration settings.
    -
    -
    - Method - cookie -
    -
    -
    krumo::cookie() in class.krumo.php
    -
    Prints a list of all the values from the $_COOKIE array.
    -
    -
    - -
    -
    d
    - -
    -
    -
    -
    - Method - defines -
    -
    -
    krumo::defines() in class.krumo.php
    -
    Prints a list of all currently declared constants.
    -
    -
    - Constant - DIR_SEP -
    -
    -
    DIR_SEP in class.krumo.php
    -
    backward compatibility: the DIR_SEP constant isn't used anymore
    -
    -
    - Method - disable -
    -
    -
    krumo::disable() in class.krumo.php
    -
    Disable Krumo
    -
    -
    - Method - dump -
    -
    -
    krumo::dump() in class.krumo.php
    -
    Dump information about a variable
    -
    -
    - -
    -
    e
    - -
    -
    -
    -
    - Method - enable -
    -
    -
    krumo::enable() in class.krumo.php
    -
    Enable Krumo
    -
    -
    - Method - env -
    -
    -
    krumo::env() in class.krumo.php
    -
    Prints a list of all the values from the $_ENV array.
    -
    -
    - Method - extensions -
    -
    -
    krumo::extensions() in class.krumo.php
    -
    Prints a list of all currently loaded PHP extensions.
    -
    -
    - -
    -
    f
    - -
    -
    -
    -
    - Method - functions -
    -
    -
    krumo::functions() in class.krumo.php
    -
    Prints a list of all currently declared functions.
    -
    -
    - -
    -
    g
    - -
    -
    -
    -
    - Method - get -
    -
    -
    krumo::get() in class.krumo.php
    -
    Prints a list of all the values from the $_GET array.
    -
    -
    - -
    -
    h
    - -
    -
    -
    -
    - Method - headers -
    -
    -
    krumo::headers() in class.krumo.php
    -
    Prints a list of all HTTP request headers.
    -
    -
    - -
    -
    i
    - -
    -
    -
    -
    - Method - includes -
    -
    -
    krumo::includes() in class.krumo.php
    -
    Prints a list of all currently included (or required) files.
    -
    -
    - Method - ini -
    -
    -
    krumo::ini() in class.krumo.php
    -
    Prints a list of all the values from an INI file.
    -
    -
    - Method - interfaces -
    -
    -
    krumo::interfaces() in class.krumo.php
    -
    Prints a list of all currently declared interfaces (PHP5 only).
    -
    -
    - -
    -
    k
    - -
    -
    -
    -
    - Function - krumo -
    -
    -
    krumo() in class.krumo.php
    -
    Alias of krumo::dump()
    -
    -
    - Class - krumo -
    -
    -
    krumo in class.krumo.php
    -
    Krumo API
    -
    -
    - Constant - KRUMO_DIR -
    -
    -
    KRUMO_DIR in class.krumo.php
    -
    Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.
    -
    -
    - Constant - KRUMO_TRUNCATE_LENGTH -
    -
    -
    KRUMO_TRUNCATE_LENGTH in class.krumo.php
    -
    This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.
    -
    -
    - -
    -
    p
    - -
    -
    -
    -
    - Method - path -
    -
    -
    krumo::path() in class.krumo.php
    -
    Prints a list of the specified directories under your include_path option.
    -
    -
    - Constant - PATH_SEPARATOR -
    -
    -
    PATH_SEPARATOR in class.krumo.php
    -
    backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2
    -
    -
    - Method - phpini -
    -
    -
    krumo::phpini() in class.krumo.php
    -
    Prints a list of the configuration settings read from php.ini
    -
    -
    - Method - post -
    -
    -
    krumo::post() in class.krumo.php
    -
    Prints a list of all the values from the $_POST array.
    -
    -
    - -
    -
    r
    - -
    -
    -
    -
    - Method - request -
    -
    -
    krumo::request() in class.krumo.php
    -
    Prints a list of all the values from the $_REQUEST array.
    -
    -
    - -
    -
    s
    - -
    -
    -
    -
    - Method - server -
    -
    -
    krumo::server() in class.krumo.php
    -
    Prints a list of all the values from the $_SERVER array.
    -
    -
    - Method - session -
    -
    -
    krumo::session() in class.krumo.php
    -
    Prints a list of all the values from the $_SESSION array.
    -
    -
    - -
    -
    v
    - -
    -
    -
    -
    - Method - version -
    -
    -
    krumo::version() in class.krumo.php
    -
    Return Krumo version
    -
    -
    - -
    - b - c - d - e - f - g - h - i - k - p - r - s - v -
    - \ No newline at end of file diff --git a/krumo/docs/errors.html b/krumo/docs/errors.html deleted file mode 100755 index cf21fd4278eb20685d67bb5f2fac8c6a21850fa7..0000000000000000000000000000000000000000 --- a/krumo/docs/errors.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - phpDocumentor Parser Errors and Warnings - - - - Post-parsing
    -

    - Documentation generated on Sun, 02 Dec 2007 09:43:25 +0200 by phpDocumentor 1.4.0a2 -

    - - \ No newline at end of file diff --git a/krumo/docs/index.html b/krumo/docs/index.html deleted file mode 100755 index 8276a705fb1a1b1418afa9e16ff094db3e8795f2..0000000000000000000000000000000000000000 --- a/krumo/docs/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Krumo - - - - - - - - - - - <H2>Frame Alert</H2> - <P>This document is designed to be viewed using the frames feature. - If you see this message, you are using a non-frame-capable web client.</P> - - - \ No newline at end of file diff --git a/krumo/docs/li_Krumo.html b/krumo/docs/li_Krumo.html deleted file mode 100755 index f353e8db69e7b2174c8da4bc3bcc759c365e19a3..0000000000000000000000000000000000000000 --- a/krumo/docs/li_Krumo.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - -

    Krumo

    -
    - -
    -

    - Generated by - phpDocumentor 1.4.0a2 -

    - - \ No newline at end of file diff --git a/krumo/docs/media/banner.css b/krumo/docs/media/banner.css deleted file mode 100755 index 1b7fa8a243b5e56c95a49700cec970b2f56f0179..0000000000000000000000000000000000000000 --- a/krumo/docs/media/banner.css +++ /dev/null @@ -1,32 +0,0 @@ -body -{ - background-color: #EEEEEE; - margin: 0px; - padding: 0px; -} - -/* Banner (top bar) classes */ - -.banner { } - -.banner-menu -{ - clear: both; - padding: .5em; - border-top: 2px solid #AAAAAA; -} - -.banner-title -{ - text-align: right; - font-size: 20pt; - font-weight: bold; - margin: .2em; -} - -.package-selector -{ - background-color: #DDDDDD; - border: 1px solid #AAAAAA; - color: #000090; -} diff --git a/krumo/docs/media/images/AbstractClass.png b/krumo/docs/media/images/AbstractClass.png deleted file mode 100755 index afa9d1d9261500c57ec37cff1de8cf43b31dbf25..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/AbstractClass.png and /dev/null differ diff --git a/krumo/docs/media/images/AbstractClass_logo.png b/krumo/docs/media/images/AbstractClass_logo.png deleted file mode 100755 index 8f65c390e37b548578390c0bdbe4a4bc469c4d19..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/AbstractClass_logo.png and /dev/null differ diff --git a/krumo/docs/media/images/AbstractMethod.png b/krumo/docs/media/images/AbstractMethod.png deleted file mode 100755 index 605ccbe58e04d8f1462227f08369ef6d8e5d4fe0..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/AbstractMethod.png and /dev/null differ diff --git a/krumo/docs/media/images/AbstractPrivateClass.png b/krumo/docs/media/images/AbstractPrivateClass.png deleted file mode 100755 index 53d76c636c92b06d0ca5176caa87183d702a3f44..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/AbstractPrivateClass.png and /dev/null differ diff --git a/krumo/docs/media/images/AbstractPrivateClass_logo.png b/krumo/docs/media/images/AbstractPrivateClass_logo.png deleted file mode 100755 index 4e68f570dcb38ee67756ce2231bb5c38e77cce71..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/AbstractPrivateClass_logo.png and /dev/null differ diff --git a/krumo/docs/media/images/AbstractPrivateMethod.png b/krumo/docs/media/images/AbstractPrivateMethod.png deleted file mode 100755 index 41cc9f021734b6f99a723a687827190f2ae645e2..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/AbstractPrivateMethod.png and /dev/null differ diff --git a/krumo/docs/media/images/Class.png b/krumo/docs/media/images/Class.png deleted file mode 100755 index cf548d274e834f3d2d67b2784a1316e8e759da2e..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Class.png and /dev/null differ diff --git a/krumo/docs/media/images/Class_logo.png b/krumo/docs/media/images/Class_logo.png deleted file mode 100755 index 6f223c479a6c6fefab504deb84ab824d2e744713..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Class_logo.png and /dev/null differ diff --git a/krumo/docs/media/images/Constant.png b/krumo/docs/media/images/Constant.png deleted file mode 100755 index a9c6f28b3591824c0732239096324984401092e5..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Constant.png and /dev/null differ diff --git a/krumo/docs/media/images/Constructor.png b/krumo/docs/media/images/Constructor.png deleted file mode 100755 index 3f16222b46222ac73a8a3443fc29249c1c72781d..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Constructor.png and /dev/null differ diff --git a/krumo/docs/media/images/Destructor.png b/krumo/docs/media/images/Destructor.png deleted file mode 100755 index f28528f084362ec02752846c310c0262b5f2a680..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Destructor.png and /dev/null differ diff --git a/krumo/docs/media/images/Function.png b/krumo/docs/media/images/Function.png deleted file mode 100755 index 902fe25805b3375653cf015cb319977318d5c080..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Function.png and /dev/null differ diff --git a/krumo/docs/media/images/Global.png b/krumo/docs/media/images/Global.png deleted file mode 100755 index 7281bd2aaf8523dddb7a5c99b786734f943c9c03..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Global.png and /dev/null differ diff --git a/krumo/docs/media/images/I.png b/krumo/docs/media/images/I.png deleted file mode 100755 index e8512fb911f40ec90e7cbf057ace91404573df37..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/I.png and /dev/null differ diff --git a/krumo/docs/media/images/Index.png b/krumo/docs/media/images/Index.png deleted file mode 100755 index 6558ec393a6e0b35fb7776a52b4ca9c10da0d5c3..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Index.png and /dev/null differ diff --git a/krumo/docs/media/images/Interface.PNG b/krumo/docs/media/images/Interface.PNG deleted file mode 100644 index e6cd51edf52c7bf532060fe4dca4fa6d9666f609..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Interface.PNG and /dev/null differ diff --git a/krumo/docs/media/images/Interface_logo.png b/krumo/docs/media/images/Interface_logo.png deleted file mode 100644 index 6f223c479a6c6fefab504deb84ab824d2e744713..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Interface_logo.png and /dev/null differ diff --git a/krumo/docs/media/images/L.png b/krumo/docs/media/images/L.png deleted file mode 100755 index eb334edaeac52e2f473ffd92a49b025fb6148ec3..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/L.png and /dev/null differ diff --git a/krumo/docs/media/images/Lminus.png b/krumo/docs/media/images/Lminus.png deleted file mode 100755 index f7c43c0aa3bebb499e86eb744b1e47b9a9445ba7..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Lminus.png and /dev/null differ diff --git a/krumo/docs/media/images/Lplus.png b/krumo/docs/media/images/Lplus.png deleted file mode 100755 index 848ec2fc3bbaab6345864c303684ff8a86559cfb..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Lplus.png and /dev/null differ diff --git a/krumo/docs/media/images/Method.png b/krumo/docs/media/images/Method.png deleted file mode 100755 index 9b2157845f1c9ba93820dbc1a165f6a87b892034..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Method.png and /dev/null differ diff --git a/krumo/docs/media/images/Page.png b/krumo/docs/media/images/Page.png deleted file mode 100755 index ffe7986ee2e78f7079d6de1a13ef29bff125f7a8..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Page.png and /dev/null differ diff --git a/krumo/docs/media/images/Page_logo.png b/krumo/docs/media/images/Page_logo.png deleted file mode 100755 index 44ce0b3c68c4b9b7765e6b1051a810932778dbb1..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Page_logo.png and /dev/null differ diff --git a/krumo/docs/media/images/PrivateClass.png b/krumo/docs/media/images/PrivateClass.png deleted file mode 100755 index 470e6d5684f29e52abb36ee6036a4d0b717f92e4..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/PrivateClass.png and /dev/null differ diff --git a/krumo/docs/media/images/PrivateClass_logo.png b/krumo/docs/media/images/PrivateClass_logo.png deleted file mode 100755 index 590e00640baeca2f541347cc1c5067c255030bba..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/PrivateClass_logo.png and /dev/null differ diff --git a/krumo/docs/media/images/PrivateMethod.png b/krumo/docs/media/images/PrivateMethod.png deleted file mode 100755 index d01f2b314b973da7318cdb98a71a326f383e5864..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/PrivateMethod.png and /dev/null differ diff --git a/krumo/docs/media/images/PrivateVariable.png b/krumo/docs/media/images/PrivateVariable.png deleted file mode 100755 index d76b21d4e9e8656a68989f007945ab14507ae23c..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/PrivateVariable.png and /dev/null differ diff --git a/krumo/docs/media/images/StaticMethod.png b/krumo/docs/media/images/StaticMethod.png deleted file mode 100644 index 9b2157845f1c9ba93820dbc1a165f6a87b892034..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/StaticMethod.png and /dev/null differ diff --git a/krumo/docs/media/images/StaticVariable.png b/krumo/docs/media/images/StaticVariable.png deleted file mode 100644 index 8e820193cf930c4147eba542a1b50626933d1f42..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/StaticVariable.png and /dev/null differ diff --git a/krumo/docs/media/images/T.png b/krumo/docs/media/images/T.png deleted file mode 100755 index 30173254061a6fc4f1488a0133b2704b0e5eea18..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/T.png and /dev/null differ diff --git a/krumo/docs/media/images/Tminus.png b/krumo/docs/media/images/Tminus.png deleted file mode 100755 index 2260e4248cef23f97d59b9c3defa571564debca3..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Tminus.png and /dev/null differ diff --git a/krumo/docs/media/images/Tplus.png b/krumo/docs/media/images/Tplus.png deleted file mode 100755 index 2c8d8f4fd38259b2ef70fc63fad505fb0a0f55a4..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Tplus.png and /dev/null differ diff --git a/krumo/docs/media/images/Variable.png b/krumo/docs/media/images/Variable.png deleted file mode 100755 index 8e820193cf930c4147eba542a1b50626933d1f42..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/Variable.png and /dev/null differ diff --git a/krumo/docs/media/images/blank.png b/krumo/docs/media/images/blank.png deleted file mode 100755 index cee9cd37a10ebe8d7fe6a6ed0d8d74a2889f6e9f..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/blank.png and /dev/null differ diff --git a/krumo/docs/media/images/class_folder.png b/krumo/docs/media/images/class_folder.png deleted file mode 100755 index 84e9587af979e70708ae9944da3ab94f9e0066ca..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/class_folder.png and /dev/null differ diff --git a/krumo/docs/media/images/empty.png b/krumo/docs/media/images/empty.png deleted file mode 100755 index d56838651efa45a3c52548e003a16b656b5d0cb3..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/empty.png and /dev/null differ diff --git a/krumo/docs/media/images/file.png b/krumo/docs/media/images/file.png deleted file mode 100755 index 0bb2427f8afe94b50835b0a6fb2f7fc4b6624bb9..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/file.png and /dev/null differ diff --git a/krumo/docs/media/images/folder.png b/krumo/docs/media/images/folder.png deleted file mode 100755 index a2d79f8de0a8abffa046b9699daf562b92b65a59..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/folder.png and /dev/null differ diff --git a/krumo/docs/media/images/function_folder.png b/krumo/docs/media/images/function_folder.png deleted file mode 100755 index 8b3d6e3b12902fd6de044496082464dbc7639d42..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/function_folder.png and /dev/null differ diff --git a/krumo/docs/media/images/minus.gif b/krumo/docs/media/images/minus.gif deleted file mode 100755 index f502662bccc750fa7163df74d83beb34041d8509..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/minus.gif and /dev/null differ diff --git a/krumo/docs/media/images/next_button.png b/krumo/docs/media/images/next_button.png deleted file mode 100755 index cdbc615d994890b8d3b5ebe89d442ea1d0bdcf33..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/next_button.png and /dev/null differ diff --git a/krumo/docs/media/images/next_button_disabled.png b/krumo/docs/media/images/next_button_disabled.png deleted file mode 100755 index 4a11780fc0ec50dd27cdb6a52f863c511e32b61a..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/next_button_disabled.png and /dev/null differ diff --git a/krumo/docs/media/images/package.png b/krumo/docs/media/images/package.png deleted file mode 100755 index b04cf566d4ac41fa95f87664cf65325cc51e8a64..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/package.png and /dev/null differ diff --git a/krumo/docs/media/images/package_folder.png b/krumo/docs/media/images/package_folder.png deleted file mode 100755 index 6162bafd97a09b69387bc65f1243922537fef284..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/package_folder.png and /dev/null differ diff --git a/krumo/docs/media/images/plus.gif b/krumo/docs/media/images/plus.gif deleted file mode 100755 index eeca02ce004470d15d2ff3f46581ec2f36e84c76..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/plus.gif and /dev/null differ diff --git a/krumo/docs/media/images/previous_button.png b/krumo/docs/media/images/previous_button.png deleted file mode 100755 index 327fdbc23dfad1bf34a9cf01e62ab6dfa62b457c..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/previous_button.png and /dev/null differ diff --git a/krumo/docs/media/images/previous_button_disabled.png b/krumo/docs/media/images/previous_button_disabled.png deleted file mode 100755 index c02ff64bf12d028db769a755026226442f0f81fc..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/previous_button_disabled.png and /dev/null differ diff --git a/krumo/docs/media/images/private_class_logo.png b/krumo/docs/media/images/private_class_logo.png deleted file mode 100755 index 590e00640baeca2f541347cc1c5067c255030bba..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/private_class_logo.png and /dev/null differ diff --git a/krumo/docs/media/images/tutorial.png b/krumo/docs/media/images/tutorial.png deleted file mode 100755 index bc19737521daf3fdf8ba84693a6c1db275587a5c..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/tutorial.png and /dev/null differ diff --git a/krumo/docs/media/images/tutorial_folder.png b/krumo/docs/media/images/tutorial_folder.png deleted file mode 100755 index 2a468b2a06fa3424ba94773373637d424f91f7e0..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/tutorial_folder.png and /dev/null differ diff --git a/krumo/docs/media/images/up_button.png b/krumo/docs/media/images/up_button.png deleted file mode 100755 index ff36c59356d1d67cf8c4d12cef7b5aff7bf4dbc1..0000000000000000000000000000000000000000 Binary files a/krumo/docs/media/images/up_button.png and /dev/null differ diff --git a/krumo/docs/media/lib/classTree.js b/krumo/docs/media/lib/classTree.js deleted file mode 100755 index 5989426f084cceb577f9d96914f6f782a0690cf2..0000000000000000000000000000000000000000 --- a/krumo/docs/media/lib/classTree.js +++ /dev/null @@ -1,454 +0,0 @@ -/*----------------------------------------\ -| Cross Browser Tree Widget 1.1 | -|-----------------------------------------| -| Created by Emil A. Eklund (eae@eae.net) | -| For WebFX (http://webfx.eae.net/) | -|-----------------------------------------| -| This script is provided as is without | -| any warranty whatsoever. It may be used | -| free of charge for non commerical sites | -| For commerical use contact the author | -| of this script for further details. | -|-----------------------------------------| -| Created 2000-12-11 | Updated 2001-09-06 | -\----------------------------------------*/ - -var webFXTreeConfig = { - rootIcon : 'media/images/empty.png', - openRootIcon : 'media/images/empty.png', - folderIcon : 'media/images/empty.png', - openFolderIcon : 'media/images/empty.png', - fileIcon : 'media/images/empty.png', - iIcon : 'media/images/I.png', - lIcon : 'media/images/L.png', - lMinusIcon : 'media/images/Lminus.png', - lPlusIcon : 'media/images/Lplus.png', - tIcon : 'media/images/T.png', - tMinusIcon : 'media/images/Tminus.png', - tPlusIcon : 'media/images/Tplus.png', - blankIcon : 'media/images/blank.png', - defaultText : 'Tree Item', - defaultAction : 'javascript:void(0);', - defaultTarget : 'right', - defaultBehavior : 'classic' -}; - -var webFXTreeHandler = { - idCounter : 0, - idPrefix : "webfx-tree-object-", - all : {}, - behavior : null, - selected : null, - getId : function() { return this.idPrefix + this.idCounter++; }, - toggle : function (oItem) { this.all[oItem.id.replace('-plus','')].toggle(); }, - select : function (oItem) { this.all[oItem.id.replace('-icon','')].select(); }, - focus : function (oItem) { this.all[oItem.id.replace('-anchor','')].focus(); }, - blur : function (oItem) { this.all[oItem.id.replace('-anchor','')].blur(); }, - keydown : function (oItem) { return this.all[oItem.id].keydown(window.event.keyCode); }, - cookies : new WebFXCookie() -}; - -/* - * WebFXCookie class - */ - -function WebFXCookie() { - if (document.cookie.length) { this.cookies = ' ' + document.cookie; } -} - -WebFXCookie.prototype.setCookie = function (key, value) { - document.cookie = key + "=" + escape(value); -} - -WebFXCookie.prototype.getCookie = function (key) { - if (this.cookies) { - var start = this.cookies.indexOf(' ' + key + '='); - if (start == -1) { return null; } - var end = this.cookies.indexOf(";", start); - if (end == -1) { end = this.cookies.length; } - end -= start; - var cookie = this.cookies.substr(start,end); - return unescape(cookie.substr(cookie.indexOf('=') + 1, cookie.length - cookie.indexOf('=') + 1)); - } - else { return null; } -} - -/* - * WebFXTreeAbstractNode class - */ - -function WebFXTreeAbstractNode(sText, sAction, sTarget) { - this.childNodes = []; - this.id = webFXTreeHandler.getId(); - this.text = sText || webFXTreeConfig.defaultText; - this.action = sAction || webFXTreeConfig.defaultAction; - this.targetWindow = sTarget || webFXTreeConfig.defaultTarget; - this._last = false; - webFXTreeHandler.all[this.id] = this; -} - -WebFXTreeAbstractNode.prototype.add = function (node) { - node.parentNode = this; - this.childNodes[this.childNodes.length] = node; - var root = this; - if (this.childNodes.length >=2) { - this.childNodes[this.childNodes.length -2]._last = false; - } - while (root.parentNode) { root = root.parentNode; } - if (root.rendered) { - if (this.childNodes.length >= 2) { - document.getElementById(this.childNodes[this.childNodes.length -2].id + '-plus').src = ((this.childNodes[this.childNodes.length -2].folder)?webFXTreeConfig.tMinusIcon:webFXTreeConfig.tIcon); - if (this.childNodes[this.childNodes.length -2].folder) { - this.childNodes[this.childNodes.length -2].plusIcon = webFXTreeConfig.tPlusIcon; - this.childNodes[this.childNodes.length -2].minusIcon = webFXTreeConfig.tMinusIcon; - } - this.childNodes[this.childNodes.length -2]._last = false; - } - this._last = true; - var foo = this; - while (foo.parentNode) { - for (var i = 0; i < foo.parentNode.childNodes.length; i++) { - if (foo.id == foo.parentNode.childNodes[i].id) { break; } - } - if (++i == foo.parentNode.childNodes.length) { foo.parentNode._last = true; } - else { foo.parentNode._last = false; } - foo = foo.parentNode; - } - document.getElementById(this.id + '-cont').insertAdjacentHTML("beforeEnd", node.toString()); - if ((!this.folder) && (!this.openIcon)) { - this.icon = webFXTreeConfig.folderIcon; - this.openIcon = webFXTreeConfig.openFolderIcon; - } - this.folder = true; - this.indent(); - this.expand(); - } - return node; -} - -WebFXTreeAbstractNode.prototype.toggle = function() { - if (this.folder) { - if (this.open) { this.collapse(); } - else { this.expand(); } - } -} - -WebFXTreeAbstractNode.prototype.select = function() { - document.getElementById(this.id + '-anchor').focus(); -} - -WebFXTreeAbstractNode.prototype.focus = function() { - webFXTreeHandler.selected = this; - if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.openIcon; } - document.getElementById(this.id + '-anchor').style.backgroundColor = 'highlight'; - document.getElementById(this.id + '-anchor').style.color = 'highlighttext'; - document.getElementById(this.id + '-anchor').focus(); -} - -WebFXTreeAbstractNode.prototype.blur = function() { - if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.icon; } - document.getElementById(this.id + '-anchor').style.backgroundColor = 'transparent'; - document.getElementById(this.id + '-anchor').style.color = 'menutext'; -} - -WebFXTreeAbstractNode.prototype.doExpand = function() { - if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.openIcon; } - if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'block'; } - this.open = true; - webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '1'); -} - -WebFXTreeAbstractNode.prototype.doCollapse = function() { - if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.icon; } - if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'none'; } - this.open = false; - webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '0'); -} - -WebFXTreeAbstractNode.prototype.expandAll = function() { - this.expandChildren(); - if ((this.folder) && (!this.open)) { this.expand(); } -} - -WebFXTreeAbstractNode.prototype.expandChildren = function() { - for (var i = 0; i < this.childNodes.length; i++) { - this.childNodes[i].expandAll(); -} } - -WebFXTreeAbstractNode.prototype.collapseAll = function() { - if ((this.folder) && (this.open)) { this.collapse(); } - this.collapseChildren(); -} - -WebFXTreeAbstractNode.prototype.collapseChildren = function() { - for (var i = 0; i < this.childNodes.length; i++) { - this.childNodes[i].collapseAll(); -} } - -WebFXTreeAbstractNode.prototype.indent = function(lvl, del, last, level) { - /* - * Since we only want to modify items one level below ourself, - * and since the rightmost indentation position is occupied by - * the plus icon we set this to -2 - */ - if (lvl == null) { lvl = -2; } - var state = 0; - for (var i = this.childNodes.length - 1; i >= 0 ; i--) { - state = this.childNodes[i].indent(lvl + 1, del, last, level); - if (state) { return; } - } - if (del) { - if (level >= this._level) { - if (this.folder) { - document.getElementById(this.id + '-plus').src = (this.open)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.lPlusIcon; - this.plusIcon = webFXTreeConfig.lPlusIcon; - this.minusIcon = webFXTreeConfig.lMinusIcon; - } - else { document.getElementById(this.id + '-plus').src = webFXTreeConfig.lIcon; } - return 1; - } - } - var foo = document.getElementById(this.id + '-indent-' + lvl); - if (foo) { - if ((del) && (last)) { foo._last = true; } - if (foo._last) { foo.src = webFXTreeConfig.blankIcon; } - else { foo.src = webFXTreeConfig.iIcon; } - } - return 0; -} - -/* - * WebFXTree class - */ - -function WebFXTree(sText, sAction, sBehavior, sIcon, sOpenIcon) { - this.base = WebFXTreeAbstractNode; - this.base(sText, sAction); - this.icon = sIcon || webFXTreeConfig.rootIcon; - this.openIcon = sOpenIcon || webFXTreeConfig.openRootIcon; - /* Defaults to open */ - this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '0')?false:true; - this.folder = true; - this.rendered = false; - if (!webFXTreeHandler.behavior) { webFXTreeHandler.behavior = sBehavior || webFXTreeConfig.defaultBehavior; } - this.targetWindow = 'right'; -} - -WebFXTree.prototype = new WebFXTreeAbstractNode; - -WebFXTree.prototype.setBehavior = function (sBehavior) { - webFXTreeHandler.behavior = sBehavior; -}; - -WebFXTree.prototype.getBehavior = function (sBehavior) { - return webFXTreeHandler.behavior; -}; - -WebFXTree.prototype.getSelected = function() { - if (webFXTreeHandler.selected) { return webFXTreeHandler.selected; } - else { return null; } -} - -WebFXTree.prototype.remove = function() { } - -WebFXTree.prototype.expand = function() { - this.doExpand(); -} - -WebFXTree.prototype.collapse = function() { - this.focus(); - this.doCollapse(); -} - -WebFXTree.prototype.getFirst = function() { - return null; -} - -WebFXTree.prototype.getLast = function() { - return null; -} - -WebFXTree.prototype.getNextSibling = function() { - return null; -} - -WebFXTree.prototype.getPreviousSibling = function() { - return null; -} - -WebFXTree.prototype.keydown = function(key) { - if (key == 39) { this.expand(); return false; } - if (key == 37) { this.collapse(); return false; } - if ((key == 40) && (this.open)) { this.childNodes[0].select(); return false; } - return true; -} - -WebFXTree.prototype.toString = function() { - var str = "
    "; - str += "" + this.text + "
    "; - str += "
    "; - for (var i = 0; i < this.childNodes.length; i++) { - str += this.childNodes[i].toString(i, this.childNodes.length); - } - str += "
    "; - this.rendered = true; - return str; -}; - -/* - * WebFXTreeItem class - */ - -function WebFXTreeItem(sText, sAction, eParent, sIcon, sOpenIcon) { - this.base = WebFXTreeAbstractNode; - this.base(sText, sAction); - /* Defaults to close */ - this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '1')?true:false; - if (eParent) { eParent.add(this); } - if (sIcon) { this.icon = sIcon; } - if (sOpenIcon) { this.openIcon = sOpenIcon; } -} - -WebFXTreeItem.prototype = new WebFXTreeAbstractNode; - -WebFXTreeItem.prototype.remove = function() { - var parentNode = this.parentNode; - var prevSibling = this.getPreviousSibling(true); - var nextSibling = this.getNextSibling(true); - var folder = this.parentNode.folder; - var last = ((nextSibling) && (nextSibling.parentNode) && (nextSibling.parentNode.id == parentNode.id))?false:true; - this.getPreviousSibling().focus(); - this._remove(); - if (parentNode.childNodes.length == 0) { - parentNode.folder = false; - parentNode.open = false; - } - if (last) { - if (parentNode.id == prevSibling.id) { - document.getElementById(parentNode.id + '-icon').src = webFXTreeConfig.fileIcon; - } - else { } - } - if ((!prevSibling.parentNode) || (prevSibling.parentNode != parentNode)) { - parentNode.indent(null, true, last, this._level); - } - if (document.getElementById(prevSibling.id + '-plus')) { - if (nextSibling) { - if ((parentNode == prevSibling) && (parentNode.getNextSibling)) { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.tIcon; } - else if (nextSibling.parentNode != prevSibling) { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.lIcon; } - } - else { document.getElementById(prevSibling.id + '-plus').src = webFXTreeConfig.lIcon; } - } -} - -WebFXTreeItem.prototype._remove = function() { - for (var i = this.childNodes.length - 1; i >= 0; i--) { - this.childNodes[i]._remove(); - } - for (var i = 0; i < this.parentNode.childNodes.length; i++) { - if (this.id == this.parentNode.childNodes[i].id) { - for (var j = i; j < this.parentNode.childNodes.length; j++) { - this.parentNode.childNodes[i] = this.parentNode.childNodes[i+1] - } - this.parentNode.childNodes.length = this.parentNode.childNodes.length - 1; - if (i + 1 == this.parentNode.childNodes.length) { this.parentNode._last = true; } - } - } - webFXTreeHandler.all[this.id] = null; - if (document.getElementById(this.id)) { - document.getElementById(this.id).innerHTML = ""; - document.getElementById(this.id).removeNode(); - } -} - -WebFXTreeItem.prototype.expand = function() { - this.doExpand(); - document.getElementById(this.id + '-plus').src = this.minusIcon; -} - -WebFXTreeItem.prototype.collapse = function() { - this.focus(); - this.doCollapse(); - document.getElementById(this.id + '-plus').src = this.plusIcon; -} - -WebFXTreeItem.prototype.getFirst = function() { - return this.childNodes[0]; -} - -WebFXTreeItem.prototype.getLast = function() { - if (this.childNodes[this.childNodes.length - 1].open) { return this.childNodes[this.childNodes.length - 1].getLast(); } - else { return this.childNodes[this.childNodes.length - 1]; } -} - -WebFXTreeItem.prototype.getNextSibling = function() { - for (var i = 0; i < this.parentNode.childNodes.length; i++) { - if (this == this.parentNode.childNodes[i]) { break; } - } - if (++i == this.parentNode.childNodes.length) { return this.parentNode.getNextSibling(); } - else { return this.parentNode.childNodes[i]; } -} - -WebFXTreeItem.prototype.getPreviousSibling = function(b) { - for (var i = 0; i < this.parentNode.childNodes.length; i++) { - if (this == this.parentNode.childNodes[i]) { break; } - } - if (i == 0) { return this.parentNode; } - else { - if ((this.parentNode.childNodes[--i].open) || (b && this.parentNode.childNodes[i].folder)) { return this.parentNode.childNodes[i].getLast(); } - else { return this.parentNode.childNodes[i]; } -} } - -WebFXTreeItem.prototype.keydown = function(key) { - if ((key == 39) && (this.folder)) { - if (!this.open) { this.expand(); return false; } - else { this.getFirst().select(); return false; } - } - else if (key == 37) { - if (this.open) { this.collapse(); return false; } - else { this.parentNode.select(); return false; } - } - else if (key == 40) { - if (this.open) { this.getFirst().select(); return false; } - else { - var sib = this.getNextSibling(); - if (sib) { sib.select(); return false; } - } } - else if (key == 38) { this.getPreviousSibling().select(); return false; } - return true; -} - -WebFXTreeItem.prototype.toString = function (nItem, nItemCount) { - var foo = this.parentNode; - var indent = ''; - if (nItem + 1 == nItemCount) { this.parentNode._last = true; } - var i = 0; - while (foo.parentNode) { - foo = foo.parentNode; - indent = "" + indent; - i++; - } - this._level = i; - if (this.childNodes.length) { this.folder = 1; } - else { this.open = false; } - if ((this.folder) || (webFXTreeHandler.behavior != 'classic')) { - if (!this.icon) { this.icon = webFXTreeConfig.folderIcon; } - if (!this.openIcon) { this.openIcon = webFXTreeConfig.openFolderIcon; } - } - else if (!this.icon) { this.icon = webFXTreeConfig.fileIcon; } - var label = this.text; - label = label.replace('<', '<'); - label = label.replace('>', '>'); - var str = "
    "; - str += indent; - str += "" - str += "" + label + "
    "; - str += "
    "; - for (var i = 0; i < this.childNodes.length; i++) { - str += this.childNodes[i].toString(i,this.childNodes.length); - } - str += "
    "; - this.plusIcon = ((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon); - this.minusIcon = ((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon); - return str; -} \ No newline at end of file diff --git a/krumo/docs/media/stylesheet.css b/krumo/docs/media/stylesheet.css deleted file mode 100755 index 498826ae136e385e47d22034a808f08954a3d44f..0000000000000000000000000000000000000000 --- a/krumo/docs/media/stylesheet.css +++ /dev/null @@ -1,181 +0,0 @@ -a { color: #000090; text-decoration: none; } -a:hover, a:active, a:focus { color: highlighttext; background-color: highlight; text-decoration: none; } - -body { background : #FFFFFF; } -body, table { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; } - -a img { border: 0px; } - -/* Page layout/boxes */ - -.info-box { } -.info-box-title { margin: 1em 0em 0em 0em; font-weight: normal; font-size: 14pt; color: #999999; border-bottom: 2px solid #999999; } -.info-box-body { border: 1px solid #999999; padding: .5em; } -.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; } - -.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} -.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} - -.page-body { max-width: 800px; margin: auto; } -.tree { } - -/* Index formatting classes */ - -.index-item-body { margin-top: .5em; margin-bottom: .5em} -.index-item-description { margin-top: .25em } -.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt } -.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em} -.index-letter-title { font-size: 12pt; font-weight: bold } -.index-letter-menu { text-align: center; margin: 1em } -.index-letter { font-size: 12pt } - -/* Docbook classes */ - -.description {} -.short-description { font-weight: bold; color: #666666; } -.tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; } -.parameters { padding-left: 0em; margin-left: 3em; color: #014fbe; list-style-type: square; } -.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; } -.package { font-weight: bold; } -.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black } -.sub-package { font-weight: bold; } -.tutorial { border-width: thin; border-color: #0066ff; } -.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; } - -/* Generic formatting */ - -.field { font-weight: bold; } -.detail { font-size: 8pt; } -.notes { font-style: italic; font-size: 8pt; } -.separator { background-color: #999999; height: 2px; } -.warning { color: #FF6600; } -.disabled { font-style: italic; color: #999999; } - -/* Code elements */ - -.line-number { } - -.class-table { width: 100%; } -.class-table-header { border-bottom: 1px dotted #666666; text-align: left} -.class-name { color: #0000AA; font-weight: bold; } - -.method-summary { color: #009000; padding-left: 1em; font-size: 8pt; } -.method-header { } -.method-definition { margin-bottom: .2em } -.method-title { color: #009000; font-weight: bold; } -.method-name { font-weight: bold; } -.method-signature { font-size: 85%; color: #666666; margin: .5em 0em } -.method-result { font-style: italic; } - -.var-summary { padding-left: 1em; font-size: 8pt; } -.var-header { } -.var-title { color: #014fbe; margin-bottom: .3em } -.var-type { font-style: italic; } -.var-name { font-weight: bold; } -.var-default {} -.var-description { font-weight: normal; color: #000000; } - -.include-title { color: #014fbe;} -.include-type { font-style: italic; } -.include-name { font-weight: bold; } - -.const-title { color: #FF6600; } -.const-name { font-weight: bold; } - -/* Syntax highlighting */ - -.src-code { font-family: 'Courier New', Courier, monospace; font-weight: normal; } -.src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } - -.src-code a:link { padding: 1px; text-decoration: underline; color: #0000DD; } -.src-code a:visited { text-decoration: underline; color: #0000DD; } -.src-code a:active { background-color: #FFFF66; color: #008000; } -.src-code a:hover { background-color: #FFFF66; text-decoration: overline underline; color: #008000; } - -.src-comm { color: #666666; } -.src-id { color: #FF6600; font-style: italic; } -.src-inc { color: #0000AA; font-weight: bold; } -.src-key { color: #0000AA; font-weight: bold; } -.src-num { color: #CC0000; } -.src-str { color: #CC0000; } -.src-sym { } -.src-var { } - -.src-php { font-weight: bold; } - -.src-doc { color: #666666; } -.src-doc-close-template { color: #666666 } -.src-doc-coretag { color: #008000; } -.src-doc-inlinetag {} -.src-doc-internal {} -.src-doc-tag { color: #0080CC; } -.src-doc-template { color: #666666 } -.src-doc-type { font-style: italic; color: #444444 } -.src-doc-var { color: #444444 } - -.tute-tag { color: #009999 } -.tute-attribute-name { color: #0000FF } -.tute-attribute-value { color: #0099FF } -.tute-entity { font-weight: bold; } -.tute-comment { font-style: italic } -.tute-inline-tag { color: #636311; font-weight: bold } - -/* tutorial */ - -.authors { } -.author { font-style: italic; font-weight: bold } -.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } -.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } -.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } -.release-info { font-size: 85%; font-style: italic; margin: 1em 0em } -.ref-title-box { } -.ref-title { } -.ref-purpose { font-style: italic; color: #666666 } -.ref-synopsis { } -.title { font-weight: bold; border-bottom: 1px solid #999999; color: #999999; } -.cmd-synopsis { margin: 1em 0em } -.cmd-title { font-weight: bold } -.toc { margin-left: 2em; padding-left: 0em } - -/*------------------------------------------------------------------------------ - webfx-tree -------------------------------------------------------------------------------*/ - -.webfx-tree-container { - margin: 0px; - padding: 0px; - white-space: nowrap; - font: icon; -} - -.webfx-tree-item { - padding: 0px; - margin: 0px; - color: black; - white-space: nowrap; - font: icon; -} - -.webfx-tree-item a { - margin-left: 3px; - padding: 1px 2px 1px 2px; - color: black; - text-decoration: none; -} - -.webfx-tree-item a:hover, .webfx-tree-item a:active { - color: highlighttext; - background: highlight; - text-decoration: none -} - -.webfx-tree-item img { - vertical-align: middle; - border: 0px; -} - -.webfx-tree-icon { - width: 16px; - height: 16px; -} - diff --git a/krumo/docs/packages.html b/krumo/docs/packages.html deleted file mode 100755 index a4852e3d067a7666e35ce3299516f040c8c7f31e..0000000000000000000000000000000000000000 --- a/krumo/docs/packages.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/krumo/docs/ric_INSTALL.html b/krumo/docs/ric_INSTALL.html deleted file mode 100755 index 8851703f1100bec231d420833cd32540fed83cbf..0000000000000000000000000000000000000000 --- a/krumo/docs/ric_INSTALL.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - -

    INSTALL

    -
    -------------------------------------------------------------------------------
    -
    -                     SETUP: How to install Krumo ?
    -
    -------------------------------------------------------------------------------
    -
    -In order to use Krumo you have to put it on your (development) server, and 
    -include it in your script. You can put it somewhere in the INCLUDE_PATH, or 
    -specify the full path to the "class.krumo.php" file.
    -
    -You have to modify the "krumo.ini" file too. It is the configuration file for 
    -Krumo. The first option is choosing a skin:
    -
    - [skin]
    - selected = "orange"
    -
    -The value for this setting has to be the name of one of the sub-folders from the 
    -"Krumo/skins/" folder. If the value provided for the skin results in not finding 
    -the skin, the `default` skin will be used instead.
    -
    -The second option is used to set the correct web path to the folder where Krumo 
    -is installed. This is used in order to make the images from Krumo's CSS skins 
    -web-accessible.
    -
    - [css]
    - url = "http://www.example.com/Krumo/"
    -
    -So far those two are the only configuration options.
    -
    -All the CSS files ("skin.css") from the "Krumo/skins/" sub-folders must have the 
    -proper permissions in order to be readable from Krumo. Same applies for 
    -"krumo.ini" and "krumo.js" files.
    -
    -

    - Documentation generated on Sun, 02 Dec 2007 09:43:22 +0200 by phpDocumentor 1.4.0a2 -

    - - \ No newline at end of file diff --git a/krumo/docs/ric_LICENSE.html b/krumo/docs/ric_LICENSE.html deleted file mode 100755 index aa2cad1e9c71e1c4be9048ccbbde09ca167aed19..0000000000000000000000000000000000000000 --- a/krumo/docs/ric_LICENSE.html +++ /dev/null @@ -1,522 +0,0 @@ - - - - - - - - - -

    LICENSE

    -
    -		  GNU LESSER GENERAL PUBLIC LICENSE
    -		       Version 2.1, February 1999
    -
    - Copyright (C) 1991, 1999 Free Software Foundation, Inc.
    -     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    - Everyone is permitted to copy and distribute verbatim copies
    - of this license document, but changing it is not allowed.
    -
    -[This is the first released version of the Lesser GPL.  It also counts
    - as the successor of the GNU Library Public License, version 2, hence
    - the version number 2.1.]
    -
    -			    Preamble
    -
    -  The licenses for most software are designed to take away your
    -freedom to share and change it.  By contrast, the GNU General Public
    -Licenses are intended to guarantee your freedom to share and change
    -free software--to make sure the software is free for all its users.
    -
    -  This license, the Lesser General Public License, applies to some
    -specially designated software packages--typically libraries--of the
    -Free Software Foundation and other authors who decide to use it.  You
    -can use it too, but we suggest you first think carefully about whether
    -this license or the ordinary General Public License is the better
    -strategy to use in any particular case, based on the explanations below.
    -
    -  When we speak of free software, we are referring to freedom of use,
    -not price.  Our General Public Licenses are designed to make sure that
    -you have the freedom to distribute copies of free software (and charge
    -for this service if you wish); that you receive source code or can get
    -it if you want it; that you can change the software and use pieces of
    -it in new free programs; and that you are informed that you can do
    -these things.
    -
    -  To protect your rights, we need to make restrictions that forbid
    -distributors to deny you these rights or to ask you to surrender these
    -rights.  These restrictions translate to certain responsibilities for
    -you if you distribute copies of the library or if you modify it.
    -
    -  For example, if you distribute copies of the library, whether gratis
    -or for a fee, you must give the recipients all the rights that we gave
    -you.  You must make sure that they, too, receive or can get the source
    -code.  If you link other code with the library, you must provide
    -complete object files to the recipients, so that they can relink them
    -with the library after making changes to the library and recompiling
    -it.  And you must show them these terms so they know their rights.
    -
    -  We protect your rights with a two-step method: (1) we copyright the
    -library, and (2) we offer you this license, which gives you legal
    -permission to copy, distribute and/or modify the library.
    -
    -  To protect each distributor, we want to make it very clear that
    -there is no warranty for the free library.  Also, if the library is
    -modified by someone else and passed on, the recipients should know
    -that what they have is not the original version, so that the original
    -author's reputation will not be affected by problems that might be
    -introduced by others.
    -
    -  Finally, software patents pose a constant threat to the existence of
    -any free program.  We wish to make sure that a company cannot
    -effectively restrict the users of a free program by obtaining a
    -restrictive license from a patent holder.  Therefore, we insist that
    -any patent license obtained for a version of the library must be
    -consistent with the full freedom of use specified in this license.
    -
    -  Most GNU software, including some libraries, is covered by the
    -ordinary GNU General Public License.  This license, the GNU Lesser
    -General Public License, applies to certain designated libraries, and
    -is quite different from the ordinary General Public License.  We use
    -this license for certain libraries in order to permit linking those
    -libraries into non-free programs.
    -
    -  When a program is linked with a library, whether statically or using
    -a shared library, the combination of the two is legally speaking a
    -combined work, a derivative of the original library.  The ordinary
    -General Public License therefore permits such linking only if the
    -entire combination fits its criteria of freedom.  The Lesser General
    -Public License permits more lax criteria for linking other code with
    -the library.
    -
    -  We call this license the "Lesser" General Public License because it
    -does Less to protect the user's freedom than the ordinary General
    -Public License.  It also provides other free software developers Less
    -of an advantage over competing non-free programs.  These disadvantages
    -are the reason we use the ordinary General Public License for many
    -libraries.  However, the Lesser license provides advantages in certain
    -special circumstances.
    -
    -  For example, on rare occasions, there may be a special need to
    -encourage the widest possible use of a certain library, so that it becomes
    -a de-facto standard.  To achieve this, non-free programs must be
    -allowed to use the library.  A more frequent case is that a free
    -library does the same job as widely used non-free libraries.  In this
    -case, there is little to gain by limiting the free library to free
    -software only, so we use the Lesser General Public License.
    -
    -  In other cases, permission to use a particular library in non-free
    -programs enables a greater number of people to use a large body of
    -free software.  For example, permission to use the GNU C Library in
    -non-free programs enables many more people to use the whole GNU
    -operating system, as well as its variant, the GNU/Linux operating
    -system.
    -
    -  Although the Lesser General Public License is Less protective of the
    -users' freedom, it does ensure that the user of a program that is
    -linked with the Library has the freedom and the wherewithal to run
    -that program using a modified version of the Library.
    -
    -  The precise terms and conditions for copying, distribution and
    -modification follow.  Pay close attention to the difference between a
    -"work based on the library" and a "work that uses the library".  The
    -former contains code derived from the library, whereas the latter must
    -be combined with the library in order to run.
    -
    -		  GNU LESSER GENERAL PUBLIC LICENSE
    -   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    -
    -  0. This License Agreement applies to any software library or other
    -program which contains a notice placed by the copyright holder or
    -other authorized party saying it may be distributed under the terms of
    -this Lesser General Public License (also called "this License").
    -Each licensee is addressed as "you".
    -
    -  A "library" means a collection of software functions and/or data
    -prepared so as to be conveniently linked with application programs
    -(which use some of those functions and data) to form executables.
    -
    -  The "Library", below, refers to any such software library or work
    -which has been distributed under these terms.  A "work based on the
    -Library" means either the Library or any derivative work under
    -copyright law: that is to say, a work containing the Library or a
    -portion of it, either verbatim or with modifications and/or translated
    -straightforwardly into another language.  (Hereinafter, translation is
    -included without limitation in the term "modification".)
    -
    -  "Source code" for a work means the preferred form of the work for
    -making modifications to it.  For a library, complete source code means
    -all the source code for all modules it contains, plus any associated
    -interface definition files, plus the scripts used to control compilation
    -and installation of the library.
    -
    -  Activities other than copying, distribution and modification are not
    -covered by this License; they are outside its scope.  The act of
    -running a program using the Library is not restricted, and output from
    -such a program is covered only if its contents constitute a work based
    -on the Library (independent of the use of the Library in a tool for
    -writing it).  Whether that is true depends on what the Library does
    -and what the program that uses the Library does.
    -  
    -  1. You may copy and distribute verbatim copies of the Library's
    -complete source code as you receive it, in any medium, provided that
    -you conspicuously and appropriately publish on each copy an
    -appropriate copyright notice and disclaimer of warranty; keep intact
    -all the notices that refer to this License and to the absence of any
    -warranty; and distribute a copy of this License along with the
    -Library.
    -
    -  You may charge a fee for the physical act of transferring a copy,
    -and you may at your option offer warranty protection in exchange for a
    -fee.
    -
    -  2. You may modify your copy or copies of the Library or any portion
    -of it, thus forming a work based on the Library, and copy and
    -distribute such modifications or work under the terms of Section 1
    -above, provided that you also meet all of these conditions:
    -
    -    a) The modified work must itself be a software library.
    -
    -    b) You must cause the files modified to carry prominent notices
    -    stating that you changed the files and the date of any change.
    -
    -    c) You must cause the whole of the work to be licensed at no
    -    charge to all third parties under the terms of this License.
    -
    -    d) If a facility in the modified Library refers to a function or a
    -    table of data to be supplied by an application program that uses
    -    the facility, other than as an argument passed when the facility
    -    is invoked, then you must make a good faith effort to ensure that,
    -    in the event an application does not supply such function or
    -    table, the facility still operates, and performs whatever part of
    -    its purpose remains meaningful.
    -
    -    (For example, a function in a library to compute square roots has
    -    a purpose that is entirely well-defined independent of the
    -    application.  Therefore, Subsection 2d requires that any
    -    application-supplied function or table used by this function must
    -    be optional: if the application does not supply it, the square
    -    root function must still compute square roots.)
    -
    -These requirements apply to the modified work as a whole.  If
    -identifiable sections of that work are not derived from the Library,
    -and can be reasonably considered independent and separate works in
    -themselves, then this License, and its terms, do not apply to those
    -sections when you distribute them as separate works.  But when you
    -distribute the same sections as part of a whole which is a work based
    -on the Library, the distribution of the whole must be on the terms of
    -this License, whose permissions for other licensees extend to the
    -entire whole, and thus to each and every part regardless of who wrote
    -it.
    -
    -Thus, it is not the intent of this section to claim rights or contest
    -your rights to work written entirely by you; rather, the intent is to
    -exercise the right to control the distribution of derivative or
    -collective works based on the Library.
    -
    -In addition, mere aggregation of another work not based on the Library
    -with the Library (or with a work based on the Library) on a volume of
    -a storage or distribution medium does not bring the other work under
    -the scope of this License.
    -
    -  3. You may opt to apply the terms of the ordinary GNU General Public
    -License instead of this License to a given copy of the Library.  To do
    -this, you must alter all the notices that refer to this License, so
    -that they refer to the ordinary GNU General Public License, version 2,
    -instead of to this License.  (If a newer version than version 2 of the
    -ordinary GNU General Public License has appeared, then you can specify
    -that version instead if you wish.)  Do not make any other change in
    -these notices.
    -
    -  Once this change is made in a given copy, it is irreversible for
    -that copy, so the ordinary GNU General Public License applies to all
    -subsequent copies and derivative works made from that copy.
    -
    -  This option is useful when you wish to copy part of the code of
    -the Library into a program that is not a library.
    -
    -  4. You may copy and distribute the Library (or a portion or
    -derivative of it, under Section 2) in object code or executable form
    -under the terms of Sections 1 and 2 above provided that you accompany
    -it with the complete corresponding machine-readable source code, which
    -must be distributed under the terms of Sections 1 and 2 above on a
    -medium customarily used for software interchange.
    -
    -  If distribution of object code is made by offering access to copy
    -from a designated place, then offering equivalent access to copy the
    -source code from the same place satisfies the requirement to
    -distribute the source code, even though third parties are not
    -compelled to copy the source along with the object code.
    -
    -  5. A program that contains no derivative of any portion of the
    -Library, but is designed to work with the Library by being compiled or
    -linked with it, is called a "work that uses the Library".  Such a
    -work, in isolation, is not a derivative work of the Library, and
    -therefore falls outside the scope of this License.
    -
    -  However, linking a "work that uses the Library" with the Library
    -creates an executable that is a derivative of the Library (because it
    -contains portions of the Library), rather than a "work that uses the
    -library".  The executable is therefore covered by this License.
    -Section 6 states terms for distribution of such executables.
    -
    -  When a "work that uses the Library" uses material from a header file
    -that is part of the Library, the object code for the work may be a
    -derivative work of the Library even though the source code is not.
    -Whether this is true is especially significant if the work can be
    -linked without the Library, or if the work is itself a library.  The
    -threshold for this to be true is not precisely defined by law.
    -
    -  If such an object file uses only numerical parameters, data
    -structure layouts and accessors, and small macros and small inline
    -functions (ten lines or less in length), then the use of the object
    -file is unrestricted, regardless of whether it is legally a derivative
    -work.  (Executables containing this object code plus portions of the
    -Library will still fall under Section 6.)
    -
    -  Otherwise, if the work is a derivative of the Library, you may
    -distribute the object code for the work under the terms of Section 6.
    -Any executables containing that work also fall under Section 6,
    -whether or not they are linked directly with the Library itself.
    -
    -  6. As an exception to the Sections above, you may also combine or
    -link a "work that uses the Library" with the Library to produce a
    -work containing portions of the Library, and distribute that work
    -under terms of your choice, provided that the terms permit
    -modification of the work for the customer's own use and reverse
    -engineering for debugging such modifications.
    -
    -  You must give prominent notice with each copy of the work that the
    -Library is used in it and that the Library and its use are covered by
    -this License.  You must supply a copy of this License.  If the work
    -during execution displays copyright notices, you must include the
    -copyright notice for the Library among them, as well as a reference
    -directing the user to the copy of this License.  Also, you must do one
    -of these things:
    -
    -    a) Accompany the work with the complete corresponding
    -    machine-readable source code for the Library including whatever
    -    changes were used in the work (which must be distributed under
    -    Sections 1 and 2 above); and, if the work is an executable linked
    -    with the Library, with the complete machine-readable "work that
    -    uses the Library", as object code and/or source code, so that the
    -    user can modify the Library and then relink to produce a modified
    -    executable containing the modified Library.  (It is understood
    -    that the user who changes the contents of definitions files in the
    -    Library will not necessarily be able to recompile the application
    -    to use the modified definitions.)
    -
    -    b) Use a suitable shared library mechanism for linking with the
    -    Library.  A suitable mechanism is one that (1) uses at run time a
    -    copy of the library already present on the user's computer system,
    -    rather than copying library functions into the executable, and (2)
    -    will operate properly with a modified version of the library, if
    -    the user installs one, as long as the modified version is
    -    interface-compatible with the version that the work was made with.
    -
    -    c) Accompany the work with a written offer, valid for at
    -    least three years, to give the same user the materials
    -    specified in Subsection 6a, above, for a charge no more
    -    than the cost of performing this distribution.
    -
    -    d) If distribution of the work is made by offering access to copy
    -    from a designated place, offer equivalent access to copy the above
    -    specified materials from the same place.
    -
    -    e) Verify that the user has already received a copy of these
    -    materials or that you have already sent this user a copy.
    -
    -  For an executable, the required form of the "work that uses the
    -Library" must include any data and utility programs needed for
    -reproducing the executable from it.  However, as a special exception,
    -the materials to be distributed need not include anything that is
    -normally distributed (in either source or binary form) with the major
    -components (compiler, kernel, and so on) of the operating system on
    -which the executable runs, unless that component itself accompanies
    -the executable.
    -
    -  It may happen that this requirement contradicts the license
    -restrictions of other proprietary libraries that do not normally
    -accompany the operating system.  Such a contradiction means you cannot
    -use both them and the Library together in an executable that you
    -distribute.
    -
    -  7. You may place library facilities that are a work based on the
    -Library side-by-side in a single library together with other library
    -facilities not covered by this License, and distribute such a combined
    -library, provided that the separate distribution of the work based on
    -the Library and of the other library facilities is otherwise
    -permitted, and provided that you do these two things:
    -
    -    a) Accompany the combined library with a copy of the same work
    -    based on the Library, uncombined with any other library
    -    facilities.  This must be distributed under the terms of the
    -    Sections above.
    -
    -    b) Give prominent notice with the combined library of the fact
    -    that part of it is a work based on the Library, and explaining
    -    where to find the accompanying uncombined form of the same work.
    -
    -  8. You may not copy, modify, sublicense, link with, or distribute
    -the Library except as expressly provided under this License.  Any
    -attempt otherwise to copy, modify, sublicense, link with, or
    -distribute the Library is void, and will automatically terminate your
    -rights under this License.  However, parties who have received copies,
    -or rights, from you under this License will not have their licenses
    -terminated so long as such parties remain in full compliance.
    -
    -  9. You are not required to accept this License, since you have not
    -signed it.  However, nothing else grants you permission to modify or
    -distribute the Library or its derivative works.  These actions are
    -prohibited by law if you do not accept this License.  Therefore, by
    -modifying or distributing the Library (or any work based on the
    -Library), you indicate your acceptance of this License to do so, and
    -all its terms and conditions for copying, distributing or modifying
    -the Library or works based on it.
    -
    -  10. Each time you redistribute the Library (or any work based on the
    -Library), the recipient automatically receives a license from the
    -original licensor to copy, distribute, link with or modify the Library
    -subject to these terms and conditions.  You may not impose any further
    -restrictions on the recipients' exercise of the rights granted herein.
    -You are not responsible for enforcing compliance by third parties with
    -this License.
    -
    -  11. If, as a consequence of a court judgment or allegation of patent
    -infringement or for any other reason (not limited to patent issues),
    -conditions are imposed on you (whether by court order, agreement or
    -otherwise) that contradict the conditions of this License, they do not
    -excuse you from the conditions of this License.  If you cannot
    -distribute so as to satisfy simultaneously your obligations under this
    -License and any other pertinent obligations, then as a consequence you
    -may not distribute the Library at all.  For example, if a patent
    -license would not permit royalty-free redistribution of the Library by
    -all those who receive copies directly or indirectly through you, then
    -the only way you could satisfy both it and this License would be to
    -refrain entirely from distribution of the Library.
    -
    -If any portion of this section is held invalid or unenforceable under any
    -particular circumstance, the balance of the section is intended to apply,
    -and the section as a whole is intended to apply in other circumstances.
    -
    -It is not the purpose of this section to induce you to infringe any
    -patents or other property right claims or to contest validity of any
    -such claims; this section has the sole purpose of protecting the
    -integrity of the free software distribution system which is
    -implemented by public license practices.  Many people have made
    -generous contributions to the wide range of software distributed
    -through that system in reliance on consistent application of that
    -system; it is up to the author/donor to decide if he or she is willing
    -to distribute software through any other system and a licensee cannot
    -impose that choice.
    -
    -This section is intended to make thoroughly clear what is believed to
    -be a consequence of the rest of this License.
    -
    -  12. If the distribution and/or use of the Library is restricted in
    -certain countries either by patents or by copyrighted interfaces, the
    -original copyright holder who places the Library under this License may add
    -an explicit geographical distribution limitation excluding those countries,
    -so that distribution is permitted only in or among countries not thus
    -excluded.  In such case, this License incorporates the limitation as if
    -written in the body of this License.
    -
    -  13. The Free Software Foundation may publish revised and/or new
    -versions of the Lesser General Public License from time to time.
    -Such new versions will be similar in spirit to the present version,
    -but may differ in detail to address new problems or concerns.
    -
    -Each version is given a distinguishing version number.  If the Library
    -specifies a version number of this License which applies to it and
    -"any later version", you have the option of following the terms and
    -conditions either of that version or of any later version published by
    -the Free Software Foundation.  If the Library does not specify a
    -license version number, you may choose any version ever published by
    -the Free Software Foundation.
    -
    -  14. If you wish to incorporate parts of the Library into other free
    -programs whose distribution conditions are incompatible with these,
    -write to the author to ask for permission.  For software which is
    -copyrighted by the Free Software Foundation, write to the Free
    -Software Foundation; we sometimes make exceptions for this.  Our
    -decision will be guided by the two goals of preserving the free status
    -of all derivatives of our free software and of promoting the sharing
    -and reuse of software generally.
    -
    -			    NO WARRANTY
    -
    -  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
    -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
    -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
    -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
    -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
    -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    -PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
    -LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
    -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
    -
    -  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
    -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
    -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
    -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
    -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
    -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
    -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
    -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
    -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
    -DAMAGES.
    -
    -		     END OF TERMS AND CONDITIONS
    -
    -           How to Apply These Terms to Your New Libraries
    -
    -  If you develop a new library, and you want it to be of the greatest
    -possible use to the public, we recommend making it free software that
    -everyone can redistribute and change.  You can do so by permitting
    -redistribution under these terms (or, alternatively, under the terms of the
    -ordinary General Public License).
    -
    -  To apply these terms, attach the following notices to the library.  It is
    -safest to attach them to the start of each source file to most effectively
    -convey the exclusion of warranty; and each file should have at least the
    -"copyright" line and a pointer to where the full notice is found.
    -
    -    <one line to give the library's name and a brief idea of what it does.>
    -    Copyright (C) <year>  <name of author>
    -
    -    This library is free software; you can redistribute it and/or
    -    modify it under the terms of the GNU Lesser General Public
    -    License as published by the Free Software Foundation; either
    -    version 2.1 of the License, or (at your option) any later version.
    -
    -    This library is distributed in the hope that it will be useful,
    -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    -    Lesser General Public License for more details.
    -
    -    You should have received a copy of the GNU Lesser General Public
    -    License along with this library; if not, write to the Free Software
    -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    -
    -Also add information on how to contact you by electronic and paper mail.
    -
    -You should also get your employer (if you work as a programmer) or your
    -school, if any, to sign a "copyright disclaimer" for the library, if
    -necessary.  Here is a sample; alter the names:
    -
    -  Yoyodyne, Inc., hereby disclaims all copyright interest in the
    -  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
    -
    -  <signature of Ty Coon>, 1 April 1990
    -  Ty Coon, President of Vice
    -
    -That's all there is to it!
    -
    -
    -
    -
    -

    - Documentation generated on Sun, 02 Dec 2007 09:43:23 +0200 by phpDocumentor 1.4.0a2 -

    - - \ No newline at end of file diff --git a/krumo/docs/ric_README.html b/krumo/docs/ric_README.html deleted file mode 100755 index 02a45c8f37d8b93608646b14e51dcd1ea798d303..0000000000000000000000000000000000000000 --- a/krumo/docs/ric_README.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - -

    README

    -
    -=============================================================================
    -
    -                               Krumo
    -                            version 0.2.1a
    -
    -=============================================================================
    -
    -You probably got this package from...
    -http://www.sourceforge.net/projects/krumo/
    -
    -If there is no licence agreement with this package please download
    -a version from the location above. You must read and accept that
    -licence to use this software. The file is titled simply LICENSE.
    -
    -OVERVIEW
    -------------------------------------------------------------------------------
    -To put it simply, Krumo is a replacement for print_r() and var_dump(). By 
    -definition Krumo is a debugging tool (for PHP5), which displays structured 
    -information about any PHP variable.
    -
    -A lot of developers use print_r() and var_dump() in the means of debugging 
    -tools. Although they were intended to present human readble information about a 
    -variable, we can all agree that in general they are not. Krumo is an 
    -alternative: it does the same job, but it presents the information beautified 
    -using CSS and DHTML. 
    -
    -EXAMPLES
    -------------------------------------------------------------------------------
    -Here's a basic example, which will return a report on the array variable passed 
    -as argument to it:
    -
    - krumo(array('a1'=> 'A1', 3, 'red'));
    -
    -You can dump simultaneously more then one variable - here's another example:
    -
    - krumo($_SERVER, $_REQUEST);
    -
    -You probably saw from the examples above that some of the nodes are expandable, 
    -so if you want to inspect the nested information, click on them and they will 
    -expand; if you do not need that information shown simply click again on it to 
    -collapse it. Here's an example to test this:
    -
    - $x1->x2->x3->x4->x5->x6->x7->x8->x9 = 'X10';
    - krumo($x1);
    -
    -The krumo() is the only standalone function from the package, and this is 
    -because basic dumps about variables (like print_r() or var_dump()) are the most 
    -common tasks such functionality is used for. The rest of the functionality can 
    -be called using static calls to the Krumo class. Here are several more examples:
    -
    - // print a debug backgrace
    - krumo::backtrace();
    -
    - // print all the included(or required) files
    - krumo::includes();
    - 
    - // print all the included functions
    - krumo::functions();
    - 
    - // print all the declared classes
    - krumo::classes();
    - 
    - // print all the defined constants
    - krumo::defines();
    -
    - ... and so on, etc.
    -
    -A full PHPDocumenter API documentation exists both in this package and at the 
    -project's website.
    -
    -INSTALL
    -------------------------------------------------------------------------------
    -Read the INSTALL file.
    -
    -DOCUMENTATION
    -------------------------------------------------------------------------------
    -As I said, a full PHPDocumenter API documentation can be found both in this
    -package and at the project's website.
    -
    -SKINS
    -------------------------------------------------------------------------------
    -There are several skins pre-installed with this package, but if you wish you can 
    -create skins of your own. The skins are simply CSS files that are prepended to 
    -the result that Krumo prints. If you want to use images in your CSS (for 
    -background, list-style, etc), you have to put "%URL%" in front of the image URL 
    -in order hook it up to the skin folder and make the image web-accessible.
    -
    -Here's an example:
    -
    - ul.krumo-first {background: url(%url%bg.gif);}
    -
    -TODO
    -------------------------------------------------------------------------------
    -You can find the list of stuff that is going to be added to this project in the 
    -TODO file from this very package.
    -
    -CONTRIBUTION
    ------------------------------------------------------------------------------
    -If you download and use and possibly even extend this tool, please let us know. 
    -Any feedback, even bad, is always welcome and your suggestions are going to be 
    -considered for our next release. Please use our SourceForge page for that:
    - 
    - http://www.sourceforge.net/projects/krumo/
    -
    -
    -

    - Documentation generated on Sun, 02 Dec 2007 09:43:23 +0200 by phpDocumentor 1.4.0a2 -

    - - \ No newline at end of file diff --git a/krumo/docs/ric_TODO.html b/krumo/docs/ric_TODO.html deleted file mode 100755 index 82b751e8b16264f6931c16fca6c2fe24cd56963f..0000000000000000000000000000000000000000 --- a/krumo/docs/ric_TODO.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - -

    TODO

    -
    -******************************************************************************
    -
    -                                 Krumo: TODO
    -
    -******************************************************************************
    -
    -BUGS
    -----------------
    - - watch the SourceForge.net Bug Tracker
    -
    -Features: PHP
    -----------------
    - - Try to detect anonymous (lambda) functions
    - - Try to detect whether an array is indexed or associated
    - - Add var_export support for arrays and objects
    - - Add JSON support for arrays and objects
    - 
    -Features: GUI
    -----------------
    - - Nicer and friendlier skin(s)
    - - Add top-level links for collapsing and expanding the whole tree
    - - Add object & array -level links for collapsing and expanding all the
    - 	nested nodes
    - - Print all parent classes for the rendered objects
    -
    -

    - Documentation generated on Sun, 02 Dec 2007 09:43:23 +0200 by phpDocumentor 1.4.0a2 -

    - - \ No newline at end of file diff --git a/krumo/docs/ric_VERSION.html b/krumo/docs/ric_VERSION.html deleted file mode 100755 index 45904040eeead20db97ab71f29196af82647be32..0000000000000000000000000000000000000000 --- a/krumo/docs/ric_VERSION.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -

    VERSION

    -
    -0.2.1a
    -
    -

    - Documentation generated on Sun, 02 Dec 2007 09:43:23 +0200 by phpDocumentor 1.4.0a2 -

    - - \ No newline at end of file diff --git a/krumo/krumo.ini b/krumo/krumo.ini deleted file mode 100755 index 3e20dd91d59e2e22f27a3b6ec47af770d6568ff0..0000000000000000000000000000000000000000 --- a/krumo/krumo.ini +++ /dev/null @@ -1,20 +0,0 @@ -; -; KRUMO CONFIGURATION FILE -; - -[skin] -selected = "white" -; -; Change the above value to set the CSS skin used to render -; Krumo layout. If the skin is not found, then the "default" one -; is going to be used. -; - -[css] -url = "http://www.example.com/Krumo/" -; -; This value is used to set the URL path to -; where the Krumo folder is. This is required in -; order to have web access to Krumo's CSS and -; image files. -; diff --git a/krumo/krumo.js b/krumo/krumo.js deleted file mode 100755 index 240af8cb409e7e56e1592d6025ed5611699965e3..0000000000000000000000000000000000000000 --- a/krumo/krumo.js +++ /dev/null @@ -1,97 +0,0 @@ -/** -* JavaScript routines for Krumo -* -* @link http://sourceforge.net/projects/krumo -*/ - -///////////////////////////////////////////////////////////////////////////// - -/** -* Krumo JS Class -*/ -function krumo() { - } - -// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -/** -* Add a CSS class to an HTML element -* -* @param HtmlElement el -* @param string className -* @return void -*/ -krumo.reclass = function(el, className) { - if (el.className.indexOf(className) < 0) { - el.className += (' ' + className); - } - } - -// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -/** -* Remove a CSS class to an HTML element -* -* @param HtmlElement el -* @param string className -* @return void -*/ -krumo.unclass = function(el, className) { - if (el.className.indexOf(className) > -1) { - el.className = el.className.replace(className, ''); - } - } - -// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -/** -* Toggle the nodes connected to an HTML element -* -* @param HtmlElement el -* @return void -*/ -krumo.toggle = function(el) { - var ul = el.parentNode.getElementsByTagName('ul'); - for (var i=0; i -*/ - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -ul.krumo-node { - margin: 0px; - padding: 0px; - } -ul.krumo-node ul { - margin-left: 20px; - } -* html ul.krumo-node ul { - margin-left: 24px; - } -div.krumo-root { - border: solid 1px black; - margin: 1em 0em; - } -ul.krumo-first { - font: normal 12px arial; - border: solid 2px white; - border-top-width:1px; - background: url(%url%bg.gif); - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-child { - display:block; - list-style: none; - padding: 0px; - margin: 0px; - overflow:hidden; - } -div.krumo-element { - cursor:default; - - line-height: 24px; - display:block; - - clear:both; - white-space:nowrap; - - border-top: solid 1px white; - background: #BFDFFF; - padding-left: 10px; - } -* html div.krumo-element { - padding-bottom: 3px; - } -a.krumo-name { - color:navy; - font: bold 13px Arial; - } -a.krumo-name big { - font: bold 20pt Georgia; - line-height: 14px; - position:relative; - top:2px; - left:-2px; - } -* html a.krumo-name big { - font: bold 19pt Georgia; - top: 5px; - left: 0px; - line-height: 9px; - height: 12px; - padding: 0px; - margin: 0px; - } -div.krumo-expand { - background: #AAD5FF; - cursor:pointer; - } -div.krumo-hover { - background: #FFBE7D; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-preview { - font: normal 13px courier new; - padding: 5px 5px 14px 5px; - background: white; - border-top: 0px; - overflow:auto; - } -* html div.krumo-preview { - padding-top: 2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-footnote { - background:white; - padding: 2px 5px; - list-style:none; - border-top: solid 1px #bebebe; - margin-top:2px; - cursor:default; - } -* html li.krumo-footnote { - line-height: 13px; - } -div.krumo-version { - float:right; - } -li.krumo-footnote h6 { - font: bold 11px verdana; - margin: 0px; - padding: 0px; - color:navy; - display:inline; - } -* html li.krumo-footnote h6 { - margin-right: 3px; - } -li.krumo-footnote a { - font: bold 10px arial; - color: #434343; - text-decoration:none; - } -li.krumo-footnote a:hover { - color:black; - } - -li.krumo-footnote span.krumo-call { - font:normal 11px verdana; - position: relative; - top: 1px; - } -li.krumo-footnote span.krumo-call code { - font-weight:bold; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-title { - font: normal 11px verdana ; - position:relative; - top:9px; - cursor:default; - line-height:2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -strong.krumo-array-length, -strong.krumo-string-length { - font-weight: normal; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ diff --git a/krumo/skins/default/bg.gif b/krumo/skins/default/bg.gif deleted file mode 100755 index fee4763e77bb256fa39a512338ff9dbd05385ec8..0000000000000000000000000000000000000000 Binary files a/krumo/skins/default/bg.gif and /dev/null differ diff --git a/krumo/skins/default/skin.css b/krumo/skins/default/skin.css deleted file mode 100755 index e4cd0b0b4cef47304d8571d96a00599e8b958745..0000000000000000000000000000000000000000 --- a/krumo/skins/default/skin.css +++ /dev/null @@ -1,157 +0,0 @@ -/** -* Krumo Default Skin -* -* @author Kaloyan K. Tsvetkov -*/ - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -ul.krumo-node { - margin: 0px; - padding: 0px; - } -ul.krumo-node ul { - margin-left: 20px; - } -* html ul.krumo-node ul { - margin-left: 24px; - } -div.krumo-root { - border: solid 1px black; - margin: 1em 0em; - } -ul.krumo-first { - font: normal 12px arial; - border: solid 2px white; - border-top-width:1px; - background: url(%url%bg.gif); - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-child { - display:block; - list-style: none; - padding: 0px; - margin: 0px; - overflow:hidden; - } -div.krumo-element { - cursor:default; - - line-height: 24px; - display:block; - - clear:both; - white-space:nowrap; - - border-top: solid 1px white; - background: #E8E8E8; - padding-left: 10px; - } -* html div.krumo-element { - padding-bottom: 3px; - } -a.krumo-name { - color:#2C5858; - font: bold 13px Arial; - } -a.krumo-name big { - font: bold 20pt Georgia; - line-height: 14px; - position:relative; - top:2px; - left:-2px; - } -* html a.krumo-name big { - font: bold 19pt Georgia; - top: 5px; - left: 0px; - line-height: 9px; - height: 12px; - padding: 0px; - margin: 0px; - } -div.krumo-expand { - background: #CCCCCC; - cursor:pointer; - } -div.krumo-hover { - background: #B7DBDB; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-preview { - font: normal 13px courier new; - padding: 5px 5px 14px 5px; - background: white; - border-top: 0px; - overflow:auto; - } -* html div.krumo-preview { - padding-top: 2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-footnote { - background:white; - padding: 2px 5px; - list-style:none; - border-top: solid 1px #bebebe; - margin-top:2px; - cursor:default; - } -* html li.krumo-footnote { - line-height: 13px; - } -div.krumo-version { - float:right; - } -li.krumo-footnote h6 { - font: bold 11px verdana; - margin: 0px; - padding: 0px; - color:#366D6D; - display:inline; - } -* html li.krumo-footnote h6 { - margin-right: 3px; - } -li.krumo-footnote a { - font: bold 10px arial; - color: #434343; - text-decoration:none; - } -li.krumo-footnote a:hover { - color:black; - } - -li.krumo-footnote span.krumo-call { - font:normal 11px verdana; - position: relative; - top: 1px; - } -li.krumo-footnote span.krumo-call code { - font-weight:bold; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-title { - font: normal 11px verdana ; - position:relative; - top:9px; - cursor:default; - line-height:2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -strong.krumo-array-length, -strong.krumo-string-length { - font-weight: normal; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ diff --git a/krumo/skins/green/bg.gif b/krumo/skins/green/bg.gif deleted file mode 100755 index aa4e75ec1636ec9332fe79436b641ac71b89604c..0000000000000000000000000000000000000000 Binary files a/krumo/skins/green/bg.gif and /dev/null differ diff --git a/krumo/skins/green/skin.css b/krumo/skins/green/skin.css deleted file mode 100755 index 1329c323d3ae0298ed098340070c9c28998545ec..0000000000000000000000000000000000000000 --- a/krumo/skins/green/skin.css +++ /dev/null @@ -1,157 +0,0 @@ -/** -* Krumo "Green" Skin -* -* @author Kaloyan K. Tsvetkov -*/ - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -ul.krumo-node { - margin: 0px; - padding: 0px; - } -ul.krumo-node ul { - margin-left: 20px; - } -* html ul.krumo-node ul { - margin-left: 24px; - } -div.krumo-root { - border: solid 1px black; - margin: 1em 0em; - } -ul.krumo-first { - font: normal 12px arial; - border: solid 2px white; - border-top-width:1px; - background: url(%url%bg.gif); - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-child { - display:block; - list-style: none; - padding: 0px; - margin: 0px; - overflow:hidden; - } -div.krumo-element { - cursor:default; - - line-height: 24px; - display:block; - - clear:both; - white-space:nowrap; - - border-top: solid 1px white; - background: #D7F4CA; - padding-left: 10px; - } -* html div.krumo-element { - padding-bottom: 3px; - } -a.krumo-name { - color:#004000; - font: bold 13px Arial; - } -a.krumo-name big { - font: bold 20pt Georgia; - line-height: 14px; - position:relative; - top:2px; - left:-2px; - } -* html a.krumo-name big { - font: bold 19pt Georgia; - top: 5px; - left: 0px; - line-height: 9px; - height: 12px; - padding: 0px; - margin: 0px; - } -div.krumo-expand { - background: #C0EEAC; - cursor:pointer; - } -div.krumo-hover { - background: gold; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-preview { - font: normal 13px courier new; - padding: 5px 5px 14px 5px; - background: white; - border-top: 0px; - overflow:auto; - } -* html div.krumo-preview { - padding-top: 2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-footnote { - background:white; - padding: 2px 5px; - list-style:none; - border-top: solid 1px #bebebe; - margin-top:2px; - cursor:default; - } -* html li.krumo-footnote { - line-height: 13px; - } -div.krumo-version { - float:right; - } -li.krumo-footnote h6 { - font: bold 11px verdana; - margin: 0px; - padding: 0px; - color:#008040; - display:inline; - } -* html li.krumo-footnote h6 { - margin-right: 3px; - } -li.krumo-footnote a { - font: bold 10px arial; - color: #434343; - text-decoration:none; - } -li.krumo-footnote a:hover { - color:black; - } - -li.krumo-footnote span.krumo-call { - font:normal 11px verdana; - position: relative; - top: 1px; - } -li.krumo-footnote span.krumo-call code { - font-weight:bold; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-title { - font: normal 11px verdana ; - position:relative; - top:9px; - cursor:default; - line-height:2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -strong.krumo-array-length, -strong.krumo-string-length { - font-weight: normal; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ diff --git a/krumo/skins/orange/bg.gif b/krumo/skins/orange/bg.gif deleted file mode 100755 index 3c71bc9209545a1cca8caed84caac180ac84ce36..0000000000000000000000000000000000000000 Binary files a/krumo/skins/orange/bg.gif and /dev/null differ diff --git a/krumo/skins/orange/skin.css b/krumo/skins/orange/skin.css deleted file mode 100755 index 0594b52c7b1d27578c69901a1c7b0a86e2946dda..0000000000000000000000000000000000000000 --- a/krumo/skins/orange/skin.css +++ /dev/null @@ -1,157 +0,0 @@ -/** -* Krumo "Orange" Skin -* -* @author Kaloyan K. Tsvetkov -*/ - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -ul.krumo-node { - margin: 0px; - padding: 0px; - } -ul.krumo-node ul { - margin-left: 20px; - } -* html ul.krumo-node ul { - margin-left: 24px; - } -div.krumo-root { - border: solid 1px black; - margin: 1em 0em; - } -ul.krumo-first { - font: normal 12px arial; - border: solid 2px white; - border-top-width:1px; - background: url(%url%bg.gif); - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-child { - display:block; - list-style: none; - padding: 0px; - margin: 0px; - overflow:hidden; - } -div.krumo-element { - cursor:default; - - line-height: 24px; - display:block; - - clear:both; - white-space:nowrap; - - border-top: solid 1px white; - background: #FCEBA9; - padding-left: 10px; - } -* html div.krumo-element { - padding-bottom: 3px; - } -a.krumo-name { - color:#404000; - font: bold 13px Arial; - } -a.krumo-name big { - font: bold 20pt Georgia; - line-height: 14px; - position:relative; - top:2px; - left:-2px; - } -* html a.krumo-name big { - font: bold 19pt Georgia; - top: 5px; - left: 0px; - line-height: 9px; - height: 12px; - padding: 0px; - margin: 0px; - } -div.krumo-expand { - background: #FADB61; - cursor:pointer; - } -div.krumo-hover { - background: #FF8A4B; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-preview { - font: normal 13px courier new; - padding: 5px 5px 14px 5px; - background: white; - border-top: 0px; - overflow:auto; - } -* html div.krumo-preview { - padding-top: 2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-footnote { - background:white; - padding: 2px 5px; - list-style:none; - border-top: solid 1px #bebebe; - margin-top:2px; - cursor:default; - } -* html li.krumo-footnote { - line-height: 13px; - } -div.krumo-version { - float:right; - } -li.krumo-footnote h6 { - font: bold 11px verdana; - margin: 0px; - padding: 0px; - color:#E87400; - display:inline; - } -* html li.krumo-footnote h6 { - margin-right: 3px; - } -li.krumo-footnote a { - font: bold 10px arial; - color: #434343; - text-decoration:none; - } -li.krumo-footnote a:hover { - color:black; - } - -li.krumo-footnote span.krumo-call { - font:normal 11px verdana; - position: relative; - top: 1px; - } -li.krumo-footnote span.krumo-call code { - font-weight:bold; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-title { - font: normal 11px verdana ; - position:relative; - top:9px; - cursor:default; - line-height:2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -strong.krumo-array-length, -strong.krumo-string-length { - font-weight: normal; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ diff --git a/krumo/skins/schablon.com/collapsed.gif b/krumo/skins/schablon.com/collapsed.gif deleted file mode 100755 index c1a4e7d5f7254b0cde1c912aad7a114305432b14..0000000000000000000000000000000000000000 Binary files a/krumo/skins/schablon.com/collapsed.gif and /dev/null differ diff --git a/krumo/skins/schablon.com/dotted.gif b/krumo/skins/schablon.com/dotted.gif deleted file mode 100755 index e009cf1ead6fdd6bf974f4173b9bc2d30ee2675e..0000000000000000000000000000000000000000 Binary files a/krumo/skins/schablon.com/dotted.gif and /dev/null differ diff --git a/krumo/skins/schablon.com/empty.gif b/krumo/skins/schablon.com/empty.gif deleted file mode 100755 index 51aa91d0898814f7501162613a21a88e8c24192b..0000000000000000000000000000000000000000 Binary files a/krumo/skins/schablon.com/empty.gif and /dev/null differ diff --git a/krumo/skins/schablon.com/expanded.gif b/krumo/skins/schablon.com/expanded.gif deleted file mode 100755 index a0ecb026f05d1af5b6af3cf2ed8fc21b37afec01..0000000000000000000000000000000000000000 Binary files a/krumo/skins/schablon.com/expanded.gif and /dev/null differ diff --git a/krumo/skins/schablon.com/skin.css b/krumo/skins/schablon.com/skin.css deleted file mode 100755 index 1b171b4dfce5255bc36f2eeccfef97dc7fa00291..0000000000000000000000000000000000000000 --- a/krumo/skins/schablon.com/skin.css +++ /dev/null @@ -1,164 +0,0 @@ -/** -* Krumo `Schablon.com` Skin -* -* @author Kaloyan K. Tsvetkov -*/ - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -ul.krumo-node { - margin: 0px; - padding: 0px; - background-color: white; - } -ul.krumo-node ul { - margin-left: 20px; - } -* html ul.krumo-node ul { - margin-left: 24px; - } -div.krumo-root { - border: solid 1px black; - margin: 1em 0em; - } -ul.krumo-first { - font: normal 11px tahoma, verdana; - border: solid 1px white; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-child { - display:block; - list-style: none; - padding: 0px; - margin: 0px; - overflow:hidden; - } -div.krumo-element { - cursor:default; - display:block; - clear:both; - white-space:nowrap; - - background-color: white; - background-image: url(%url%empty.gif); - background-repeat: no-repeat; - background-position: 6px 5px; - padding: 2px 0px 3px 20px; - } -* html div.krumo-element { - padding-bottom: 3px; - line-height: 13px; - } -div.krumo-expand { - background-image: url(%url%collapsed.gif); - cursor:pointer; - } -div.krumo-hover { - background-color: #BFDFFF; - } -div.krumo-opened { - background-image: url(%url%expanded.gif); - } -a.krumo-name { - color:navy; - font: bold 13px courier new; - line-height:12px; - } -a.krumo-name big { - font: bold 16pt Georgia; - line-height: 10px; - position:relative; - top:2px; - left:-2px; - } -* html a.krumo-name big { - font: bold 15pt Georgia; - float:left; - top: -5px; - left: 0px; - padding: 0px; - margin: 0px; - } -em.krumo-type { - font-style:normal; - margin: 0px 2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-preview { - font: normal 13px courier new; - padding: 5px ; - background: lightyellow; - border: solid 1px #808000; - overflow:auto; - margin: 5px 1em 1em 0px; - } -* html div.krumo-preview { - padding-top: 2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -li.krumo-footnote { - background: white url(%url%dotted.gif) repeat-x; - padding: 4px 5px 3px 5px; - list-style:none; - cursor:default; - } -* html li.krumo-footnote { - line-height: 13px; - } -div.krumo-version { - float:right; - } -li.krumo-footnote h6 { - font: bold 11px verdana; - margin: 0px; - padding: 0px; - color:navy; - display:inline; - } -* html li.krumo-footnote h6 { - margin-right: 3px; - } -li.krumo-footnote a { - font: bold 10px arial; - color: #434343; - text-decoration:none; - } -li.krumo-footnote a:hover { - color:black; - } - - -li.krumo-footnote span.krumo-call { - font:normal 11px tahoma, verdana; - position: relative; - top: 1px; - } -li.krumo-footnote span.krumo-call code { - font-weight:bold; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -div.krumo-title { - font: normal 11px tahoma, verdana; - position:relative; - top:9px; - cursor:default; - line-height:2px; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ - -strong.krumo-array-length, -strong.krumo-string-length { - font-weight: normal; - color: #000099; - } - -/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ diff --git a/performance/README.txt b/performance/README.txt deleted file mode 100644 index c2bdaed690a50d896602f3db0aa67bb0091580d2..0000000000000000000000000000000000000000 --- a/performance/README.txt +++ /dev/null @@ -1,95 +0,0 @@ - -By Khalid Baheyeldin - -Copyright 2008 http://2bits.com - -Description ------------ -This module provides performance statistics logging for a site, such as page generation -times, and memory usage, for each page load. - -This module is useful for developers and site administrators alike to identify pages that -are slow to generate or use excessive memory. - -Features include: -* Settings to enable detailed logging or summary logging. The module defaults to no - logging at all. - -* Detailed logging causes one database row to be written for each page load of the site. - The data includes page generation time in milliseconds, and the number of bytes allocated - to PHP, time stamp, ...etc. - -* Summary logging logs the average and maximum page generation time, average and maximum memory - usage, last access time, and number of accesses for each path. - -* Summary can be logged to memcache, if configured, so as to not cause extra load on the database. - This works when APC cannot be used (e.g. certain FastCGI configurations, or when you have many - web servers on different boxes. This mode is recommended for live sites. - -* Summary can be logged to APC, if installed, and the APC data cache is shared, so as to not cause - extra load on the database. This mode is recommended for live sites. - -* A settings option is available when using summary mode with APC, to exclude pages with less - than a certain number of accesses. Useful for large sites. - -* Support for normal page cache. - -Note that detailed logging is only suitable for a site that is in development or testing. Do NOT -enable detailed logging on a live site. - -The memory measurement feature of this module depends on the memory_get_peak_usage() function, -available only in PHP 5.2.x or later. - -Only summary logging with Memcache or APC are recommended mode for live sites, with a threshold of -2 or more. - -Note on Completeness: ---------------------- -Please note that when summary logging to APC or Memcache, the data captured in the summary will -not be comprehensive reflecting every single page view for every URL. - -The reason for this is that there is no atomic locking when updating the data structures that -store per-URL statistics in this module. - -This means that the values you get when using these storage caches are only samples, and would -miss some page views, depending on how busy the site is. - -For memcache, there is way to implement locking using the $mc->increment and/or $mc->add as well. -However, there is a risk if these are implemented, that there will be less concurrency and we -can cause a site to slow down. - -Configuration: --------------- -If you are using memcache, then you need to configure an extra bin for performance. -If you have multiple web server boxes, then it is best to centralize this bin for -all the boxes, so you get combined statistics. - -Your settings.php looks like this: - - $conf = array( - 'cache_inc' => './sites/all/modules/memcache/memcache.inc', - - 'memcache_servers' => array( - '127.0.0.1:11211' => 'default', - // More bins here .... - '127.0.0.1:11311' => 'performance', - ), - - 'memcache_bins' => array( - 'cache_performance' => 'performance', - ), - ); - -Bugs/Features/Patches: ----------------------- -If you want to report bugs, feature requests, or submit a patch, please do so at the project page on -the Drupal web site at http://drupal.org/project/performance - -Author ------- -Khalid Baheyeldin (http://baheyeldin.com/khalid and http://2bits.com) - -If you use this module, find it useful, and want to send the author a thank you note, then use the -Feedback/Contact page at the URL above. - -The author can also be contacted for paid customizations of this and other modules. diff --git a/performance/performance.info b/performance/performance.info deleted file mode 100644 index 4770aa5a3d9327909c60158c6801c6c23e356135..0000000000000000000000000000000000000000 --- a/performance/performance.info +++ /dev/null @@ -1,5 +0,0 @@ -name = Performance Logging -description = Logs detailed and/or summary page generation time and memory consumption for page requests. -package = Development -core = 7.x -tags[] = developer diff --git a/performance/performance.install b/performance/performance.install deleted file mode 100644 index 03a2f26533fbf9ff158641c43a4f5e2698d9503c..0000000000000000000000000000000000000000 --- a/performance/performance.install +++ /dev/null @@ -1,145 +0,0 @@ - array( - 'path' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''), - 'last_access' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'bytes_max' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'bytes_avg' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'ms_max' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'ms_avg' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'query_count_max' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'query_count_avg' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'query_timer_max' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'query_timer_avg' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'num_accesses' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - ), - 'primary key' => array('path'), - 'indexes' => array( - 'last_access' => array('last_access')), - ); - - $schema['performance_detail'] = array( - 'fields' => array( - 'pid' => array('type' => 'serial', 'not null' => TRUE, 'disp-width' => '11'), - 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'bytes' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'ms' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'query_count' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'query_timer' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'), - 'anon' => array('type' => 'int', 'not null' => FALSE, 'default' => 1, 'disp-width' => '1'), - 'path' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE), - 'data' => array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'), - ), - 'primary key' => array('pid'), - 'indexes' => array( - 'timestamp' => array('timestamp')), - ); - - return $schema; -} - -function performance_install() { - - // Set the weight so this module runs last - db_query("UPDATE {system} SET weight = 3000 WHERE name = 'performance'"); -} - -function performance_uninstall() { - db_query("DELETE FROM {variable} WHERE name LIKE 'performance%'"); -} - -function performance_requirements($phase) { - $requirements = array(); - - if ($phase != 'runtime') { - return $requirements; - } - - if (variable_get('performance_detail', 0)) { - $requirements['performance_detail'] = array( - 'title' => t('Performance logging details'), - 'value' => 'Enabled', - 'severity' => REQUIREMENT_WARNING, - 'description' => t('Performance detailed logging is enabled. This can cause severe issues on live sites.', array('@link' => url('admin/config/development/performance_logging'))), - ); - } - - if (variable_get('devel_query_display', FALSE)) { - if (variable_get('performance_detail', 0) || - variable_get('performance_summary_db', 0) || - variable_get('performance_summary_apc', 0)) { - $requirements['performance_query'] = array( - 'title' => t('Performance logging query'), - 'value' => 'Enabled', - 'severity' => REQUIREMENT_WARNING, - 'description' => t('Query timing and count logging is enabled. This can cause memory size per page to be larger than normal.', array('@link' => url('admin/config/development/performance_logging'))), - ); - } - } - - if (!function_exists('apc_fetch')) { - $requirements['performance_apc'] = array( - 'title' => t('Performance logging APC'), - 'value' => 'Disabled', - 'severity' => REQUIREMENT_WARNING, - 'description' => t('Performance logging on live web sites works best if APC is enabled.'), - ); - } - - $shm_size = ini_get('apc.shm_size'); - if (function_exists('apc_fetch') && $shm_size < PERFORMANCE_MIN_MEMORY) { - $requirements['performance_apc_mem'] = array( - 'title' => t('Performance logging APC memory size'), - 'value' => $shm_size, - 'severity' => REQUIREMENT_WARNING, - 'description' => t('APC has been configured for !size, which is less than the recommended !min_memory MB of memory. If you encounter errors when viewing the summary report, then try to increase that limit for APC.', array('!size' => 1*$shm_size, '!min_memory' => PERFORMANCE_MIN_MEMORY)), - ); - } - - return $requirements; -} - -function performance_update_1() { - $ret = array(); - db_drop_field($ret, 'performance_detail', 'title'); - db_drop_field($ret, 'performance_summary', 'title'); - return $ret; -} - -function performance_update_2() { - $ret = array(); - db_add_field($ret, 'performance_detail', 'data', array('type' => 'blob', 'not null' => FALSE, 'size' => 'big')); - return $ret; -} - -/** - * Harmonize notations for milliseconds to "ms". - * - * @return array - */ -function performance_update_7001() { - $int_field = array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'); - - db_change_field('performance_summary', 'millisecs_max', 'ms_max', $int_field); - db_change_field('performance_summary', 'millisecs_avg', 'ms_avg', $int_field); - db_change_field('performance_detail', 'millisecs', 'ms', $int_field); - - // We don't have a cache update method, so it's better to clear it - if (function_exists('apc_fetch')) { - apc_clear_cache('user'); - } -} diff --git a/performance/performance.module b/performance/performance.module deleted file mode 100644 index dcd8bbb0e8e797286fe36d069cbd2453024ec86f..0000000000000000000000000000000000000000 --- a/performance/performance.module +++ /dev/null @@ -1,892 +0,0 @@ - 'Performance logging', - 'description' => 'Logs performance data: page generation times and memory usage.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('performance_settings'), - 'access arguments' => array('administer performance logging'), - ); - - $items['admin/config/development/performance_logging/apc_clear'] = array( - 'title' => 'Clear APC', - 'description' => 'Clears performance statistics collected in APC.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('performance_clear_apc_confirm'), - 'access arguments' => array('administer performance logging'), - ); - - $items['admin/settings/performance_logging/memcache_clear'] = array( - 'title' => 'Clear Memcache', - 'description' => 'Clears performance statistics collected in Memcache.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('performance_clear_memcache_confirm'), - 'access arguments' => array('access administration pages'), - ); - - $items['admin/reports/performance_logging_summary'] = array( - 'title' => 'Performance Logs: Summary', - 'description' => 'View summary performance logs: page generation times and memory usage.', - 'page callback' => 'performance_view_summary', - 'access arguments' => array('administer performance logging'), - ); - - $items['admin/reports/performance_logging_details'] = array( - 'title' => 'Performance Logs: Details', - 'description' => 'View detailed, per page, performance logs: page generation times and memory usage.', - 'page callback' => 'performance_view_details', - 'access arguments' => array('administer performance logging'), - ); - - return $items; -} - -/** - * Implementation of hook_permission(). - */ -function performance_permission() { - return array( - 'administer performance logging' => array( - 'title' => t('Administer performance logging'), - 'description' => t('Allows both configuring the performance module and accessing its reports.'), - )); -} - -function performance_settings() { - $options = array( - 0 => t('Disabled'), - 1 => t('Enabled'), - ); - - if (function_exists('apc_cache_info')) { - drupal_set_message(t('APC is enabled. It is reasonably safe to enable summary logging on live sites.'), 'status', FALSE); - } - else { - drupal_set_message(t('APC is not enabled. It is not safe to enable summary logging to the database on live sites.'), 'error', FALSE); - } - - $form['mode'] = array( - '#type' => 'fieldset', - '#title' => t('Logging mode'), - '#collapsible' => TRUE, - ); - - $form['mode']['performance_detail'] = array( - '#type' => 'select', - '#title' => t('Detailed logging'), - '#default_value' => variable_get('performance_detail', 0), - '#options' => $options, - '#description' => t('Log memory usage and page generation times for every page. This logging mode is not suitable for large sites, as it can degrade performance severly. It is intended for use by developers, or on a test copy of the site.'), - ); - - $form['mode']['performance_summary_db'] = array( - '#type' => 'select', - '#title' => t('Summary logging (DB)'), - '#default_value' => variable_get('performance_summary_db', 0), - '#options' => $options, - '#description' => t('Log summary data, such as average and maximum page generation times and memory usage to the database. This logging mode is not suitable for most live sites.'), - ); - - $disabled = TRUE; - if (function_exists('apc_cache_info')) { - $disabled = FALSE; - } - - $form['mode']['performance_summary_apc'] = array( - '#type' => 'select', - '#title' => t('Summary logging (APC)'), - '#default_value' => variable_get('performance_summary_apc', 0), - '#options' => $options, - '#disabled' => $disabled, - '#description' => t('Log summary data, such as average and maximum page generation times and memory usage to APC, if installed. The summary will be stored in APC memory, and hence there is no load on the database. This logging to APC is suitable for most live sites, unless the number of unique page accesses is excessively high.'), - ); - - $disabled = TRUE; - if (performance_memcache_enabled()) { - $disabled = FALSE; - } - - $form['mode']['performance_summary_memcache'] = array( - '#type' => 'select', - '#title' => t('Summary logging (Memcached)'), - '#default_value' => variable_get('performance_summary_memcache', 0), - '#options' => $options, - '#disabled' => $disabled, - '#description' => t('Log summary data, such as average and maximum page generation times and memory usage to Memcached, if installed. The summary will be stored in Memcached memory, and hence there is no load on the database. This logging to Memcached is suitable for most live sites, unless the number of unique page accesses is excessively high.'), - ); - - $form['other'] = array( - '#type' => 'fieldset', - '#title' => t('Other'), - '#collapsible' => TRUE, - ); - - $form['other']['performance_query'] = array( - '#type' => 'select', - '#title' => t('Database Query timing and count'), - '#default_value' => variable_get('performance_query', 0), - '#options' => $options, - '#description' => t('Log database query timing and query count for each page. This is useful to know if the bottleneck is in excessive database query counts, or the time required to execute those queries is high. Enabling this will incurr some memory overhead as query times and the actual query strings are cached in memory as arrays for each page, hence skewing the overall page memory reported.'), - ); - - $form['other']['performance_threshold_accesses'] = array( - '#type' => 'select', - '#title' => t('Accesses threshold'), - '#default_value' => variable_get('performance_threshold_accesses', 0), - '#options' => array(0, 1, 2, 5, 10), - '#description' => t('When displaying the summary report and using APC, only pages with the number of accesses larger than the specified threshold will be shown. Also, when cron runs, pages with that number of accesses or less will be removed, so as not to overflow APC\'s shared memory. This is useful on a live site with a high volume of hits. On a development site, you probably want this set to 0, so you can see all pages.'), - ); - - return system_settings_form($form); -} - -function performance_boot() { - register_shutdown_function('performance_shutdown'); - if (variable_get('performance_query', 0)) { - //TODO: See if devel.module has changed this ... - @include_once DRUPAL_ROOT . '/includes/database/log.inc'; - Database::startLog('performance', 'default'); - } -} - -function performance_shutdown() { - $queries = Database::getLog('performance', 'default'); - -// if ($_GET['q']) { - if (isset($_GET['q']) && ($_GET['q'])) { - // q= has a value, use that for the path - $path = $_GET['q']; - } - else { - // q= is empty, use whatever the site_frontpage is set to - $path = variable_get('site_frontpage', 'node'); - } - - $params = array( - 'timer' => timer_read('page'), - 'path' => $path, - ); - - // Memory - if (function_exists('memory_get_peak_usage')) { - $params['mem'] = memory_get_peak_usage(TRUE); - } - else { - $params['mem'] = 0; - } - - // Query time and count - $query_count = 0; - $query_timer = 0; - $sum = 0; - - if (variable_get('performance_query', 0) && is_array($queries)) { - foreach ($queries as $query) { - $sum += $query['time']; - $query_count++; - } - $query_timer = round($sum * 1000, 2); - } - - $params['query_count'] = $query_count; - $params['query_timer'] = $query_timer; - - $anon = (!empty($data['anon']))? 'Yes' : 'No'; - - $header = array( - 'path' => $path, - 'timer' => $params['timer'], - 'anon' => $anon, - ); - module_invoke_all('performance', 'header', $header); - - if (variable_get('performance_detail', 0)) { - $data = module_invoke_all('performance', 'data'); - $params['data'] = !empty($data[0]) ? $data[0] : NULL; - - performance_log_details($params); - } - else { - module_invoke_all('performance', 'disable'); - } - - if (variable_get('performance_summary_db', 0)) { - performance_log_summary_db($params); - } - - if (variable_get('performance_summary_apc', 0)) { - if (function_exists('apc_cache_info')) { - performance_log_summary_apc($params); - } - } - - if (variable_get('performance_summary_memcache', 0)) { - if (performance_memcache_enabled()) { - performance_log_summary_memcache($params); - } - } -} - -function performance_log_summary_apc($params = array()) { - $key = PERFORMANCE_KEY . $params['path']; - if ($data = apc_fetch($key)) { - $data = array( - 'path' => $data['path'], - 'last_access' => REQUEST_TIME, - 'bytes_max' => max($params['mem'], $data['bytes_max']), - 'bytes_avg' => ($data['bytes_avg'] + $params['mem']) / 2, - 'ms_max' => max($params['timer'], $data['ms_max']), - 'ms_avg' => ($data['ms_avg'] + $params['timer']) / 2, - 'query_timer_max' => max($params['query_timer'], $data['query_timer_max']), - 'query_timer_avg' => ($data['query_timer_avg'] + $params['query_timer']) / 2, - 'query_count_max' => max($params['query_count'], $data['query_count_max']), - 'query_count_avg' => ($data['query_count_avg'] + $params['query_count']) / 2, - 'num_accesses' => $data['num_accesses'] + 1, - ); - } - else { - $data = array( - 'path' => $params['path'], - 'bytes_max' => $params['mem'], - 'bytes_avg' => $params['mem'], - 'ms_max' => $params['timer'], - 'ms_avg' => $params['timer'], - 'query_timer_max' => $params['query_timer'], - 'query_timer_avg' => $params['query_timer'], - 'query_count_max' => $params['query_count'], - 'query_count_avg' => $params['query_count'], - 'num_accesses' => 1, - 'last_access' => REQUEST_TIME, - ); - } - apc_store($key, $data); -} - -function performance_log_summary_memcache($params = array()) { - $key = PERFORMANCE_KEY . $params['path']; - if ($cache = cache_get($key, PERFORMANCE_MEMCACHE_BIN)) { - $type = 'existing'; - $values = $cache->data; - $values = array( - 'path' => $params['path'], - 'last_access' => time(), - 'bytes_max' => max($params['mem'], $values['bytes_max']), - 'bytes_avg' => ($values['bytes_avg'] + $params['mem']) / 2, - 'ms_max' => max($params['timer'], $values['ms_max']), - 'ms_avg' => ($values['ms_avg'] + $params['timer']) / 2, - 'query_timer_max' => max($params['query_timer'], $values['query_timer_max']), - 'query_timer_avg' => ($values['query_timer_avg'] + $params['query_timer']) / 2, - 'query_count_max' => max($params['query_count'], $values['query_count_max']), - 'query_count_avg' => ($values['query_count_avg'] + $params['query_count']) / 2, - 'num_accesses' => $values['num_accesses'] + 1, - ); - } - else { - $type = 'new'; - // It is a new key - $values = array( - 'path' => $params['path'], - 'bytes_max' => $params['mem'], - 'bytes_avg' => $params['mem'], - 'ms_max' => $params['timer'], - 'ms_avg' => $params['timer'], - 'query_timer_max' => $params['query_timer'], - 'query_timer_avg' => $params['query_timer'], - 'query_count_max' => $params['query_count'], - 'query_count_avg' => $params['query_count'], - 'num_accesses' => 1, - 'last_access' => time(), - ); - - if ($keys_cache = cache_get(PERFORMANCE_KEY, PERFORMANCE_MEMCACHE_BIN)) { - $keys_values = $keys_cache->data; - } - $keys_values[$key] = 1; - cache_set(PERFORMANCE_KEY, $keys_values, PERFORMANCE_MEMCACHE_BIN, CACHE_PERMANENT); - } - cache_set($key, $values, PERFORMANCE_MEMCACHE_BIN, CACHE_PERMANENT); -} - -function performance_log_summary_db($params = array()) { - $row = db_query("SELECT * FROM {performance_summary} WHERE path = :path", array(':path' => $params['path']))->fetch(); - if ($row) { - db_update('performance_summary') - ->condition('path', $params['path']) - ->fields(array( - 'last_access' => REQUEST_TIME, - 'num_accesses' => $row->num_accesses + 1, - 'bytes_max' => max($params['mem'], $row->bytes_max), - 'bytes_avg' => ($row->bytes_avg + $params['mem']) / 2, - 'ms_max' => max($params['timer'], $row->ms_max), - 'ms_avg' => ($row->ms_avg + $params['timer']) / 2, - 'query_timer_max' => max($params['query_timer'], $row->query_timer_max), - 'query_timer_avg' => ($row->query_timer_avg + $params['query_timer']) / 2, - 'query_count_max' => max($params['query_count'], $row->query_count_max), - 'query_count_avg' => ($row->query_count_avg + $params['query_count']) / 2, - )) - ->execute(); - } - else { - // First time we log this path, write fresh values - $fields = array( - 'last_access' => REQUEST_TIME, - 'num_accesses' => 1, - 'bytes_max' => $params['mem'], - 'bytes_avg' => $params['mem'], - 'ms_max' => (int)$params['timer'], - 'ms_avg' => (int)$params['timer'], - 'query_timer_max' => (int)$params['query_count'], - 'query_timer_avg' => (int)$params['query_count'], - 'query_count_max' => $params['query_timer'], - 'query_count_avg' => $params['query_timer'], - 'path' => $params['path'], - ); - - try { - db_insert('performance_summary') - ->fields($fields) - ->execute(); - } - catch (Exception $e) { - echo $e->getMessage(); - } - } -} - -function performance_log_details($params = array()) { - global $user; - - $fields = array( - 'timestamp' => REQUEST_TIME, - 'bytes' => $params['mem'], - 'ms' => (int)$params['timer'], - 'query_count' => $params['query_count'], - 'query_timer' => (int)$params['query_timer'], - 'anon' => ($user->uid) ? 0 : 1, - 'path' => $params['path'], - 'data' => $params['data'], - ); - - try { - db_insert('performance_detail') - ->fields($fields) - ->execute(); - } - catch (Exception $e) { - echo $e->getMessage(); - } -} - -function performance_apc_list_all() { - $key_list = array(); - $list = apc_cache_info('user'); - if (!empty($list['cache_list'])) { - foreach ($list['cache_list'] as $cache_id => $cache_data) { - $regex = '/^' . PERFORMANCE_KEY . '/'; - if (preg_match($regex, $cache_data['info'])) { - $key_list[] = $cache_data['info']; - } - } - } - return $key_list; -} - -/** - * Custom sort for summary performance report - * - * @param $x - * @param $y - * @return int - */ -function performance_summary_sort($x, $y) { - // This function does not work - return; -} - -function performance_view_summary() { - global - $pager_page_array, // array of element-keyed current page - 1 - $pager_total, // array of element-keyed total number of pages - $pager_total_items, // array of element-keyed total number of data rows - $pager_limits; // array of element-keyed number of rows per page - - $sum = array(); - $data_list = array(); - $rows = array(); - - $sum[] = variable_get('performance_summary_db', 0); - $sum[] = variable_get('performance_summary_apc', 0); - $sum[] = variable_get('performance_summary_memcache', 0); - $go = array_sum($sum); - - if (!$go) { - return t('Summary performance log is not enabled. Go to the settings page to enable it.', - array('!link' => url('admin/config/development/performance_logging'))); - } - - $header = array(); - - $header[] = array('data' => t('Path'), 'field' => 'path'); - $header[] = array('data' => t('Last access'), 'field' => 'last_access'); - $header[] = array('data' => t('# accesses'), 'field' => 'num_accesses'); - $header[] = array('data' => t('MB Memory (Max)'), 'field' => 'bytes_max'); - $header[] = array('data' => t('MB Memory (Avg)'), 'field' => 'bytes_avg'); - $header[] = array('data' => t('ms (Max)'), 'field' => 'ms_max'); - $header[] = array('data' => t('ms (Avg)'), 'field' => 'ms_avg'); - - if (variable_get('performance_query', 0)) { - $header[] = array('data' => t('Query ms (Max)'), 'field' => 'query_timer_max'); - $header[] = array('data' => t('Query ms (Avg)'), 'field' => 'query_timer_avg'); - $header[] = array('data' => t('Query Count (Max)'), 'field' => 'query_count_max'); - $header[] = array('data' => t('Query Count (Avg)'), 'field' => 'query_count_avg'); - } - - $total_rows = $shown = $last_max = $total_bytes = $total_ms = $total_accesses = 0; - $last_min = REQUEST_TIME; - - $threshold = variable_get('performance_threshold_accesses', 0); - - $data_list = array(); - $pager_height = 50; - - if (variable_get('performance_summary_memcache', 0) && function_exists('dmemcache_set')) { - $tablesort = tablesort_init($header); - // Get the data from memcache - if ($keys_cache = cache_get(PERFORMANCE_KEY)) { - if ($keys_cache->data) { - foreach ($keys_cache->data as $key => $v) { - $cache = cache_get($key); - $data_list[] = $cache->data; - } - } - } - usort($data_list, 'performance_summary_sort'); - - // Set up pager since this is not done automatically when not using DB - $page = isset($_GET['page']) ? $_GET['page'] : 0; // unsafe - $page = sprintf('%d', $page); // now safe - - $pager_page_array = array(0 => $page); - $pager_total_items = array(0 => count($data_list)); - $pager_limits = array(0 => $pager_height); - $pager_total = array(0 => ceil($pager_total_items[0] / $pager_limits[0])); - - // Extract the data subset we need - $data_list = array_slice($data_list, $page * $pager_height, $pager_height); - } - else if (variable_get('performance_summary_apc', 0) && function_exists('apc_cache_info')) { - $tablesort = tablesort_init($header); - - // Get the data from the APC cache - foreach (performance_apc_list_all() as $key) { - $data_list[] = apc_fetch($key) + $tablesort; - } - usort($data_list, 'performance_summary_sort'); - - // FIXME: This section o code is duplicated from the above memcache case. - // This is ugly, and should be changed. - - // Set up pager since this is not done automatically when not using DB - $page = isset($_GET['page']) ? $_GET['page'] : 0; // unsafe - $page = sprintf('%d', $page); // now safe - - $pager_page_array = array(0 => $page); - $pager_total_items = array(0 => count($data_list)); - $pager_limits = array(0 => $pager_height); - $pager_total = array(0 => ceil($pager_total_items[0] / $pager_limits[0])); - - // Extract the data subset we need - $data_list = array_slice($data_list, $page * $pager_height, $pager_height); - } - else { - // Get the data form the database table - $result = db_select('performance_summary', 'p') - ->fields('p') - ->extend('PagerDefault') - ->limit($pager_height) - ->extend('TableSort') - ->orderByHeader($header) - ->execute(); - - foreach ($result as $row) { - $data_list[] = $row; - } - } - - $rows = array(); - foreach ($data_list as $data) { - $data = (object) $data; - $total_rows++; - $last_max = max($last_max, $data->last_access); - $last_min = min($last_min, $data->last_access); - - // Calculate running averages - $total_bytes += $data->bytes_avg; - $total_ms += $data->ms_avg; - $total_accesses += $data->num_accesses; - - $row_data = array(); - - if ($data->num_accesses > $threshold) { - $shown++; - $row_data[] = check_plain($data->path); - $row_data[] = format_date($data->last_access, 'small'); - $row_data[] = $data->num_accesses; - $row_data[] = number_format($data->bytes_max/1024/1024, 2); - $row_data[] = number_format($data->bytes_avg/1024/1024, 2); - $row_data[] = number_format($data->ms_max, 1); - $row_data[] = number_format($data->ms_avg, 1); - if (variable_get('performance_query', 0)) { - $row_data[] = number_format($data->query_timer_max, 1); - $row_data[] = number_format($data->query_timer_avg, 1); - $row_data[] = $data->query_count_max; - $row_data[] = $data->query_count_avg; - } - } - $rows[] = array('data' => $row_data); - } - - if (!$rows) { - $rows[] = array(array('data' => t('No statistics available yet.'), 'colspan' => count($header))); - } - - $output = ''; - if ($threshold) { - $output .= t('Showing !shown paths with more than !threshold accesses, out of !total total paths.', - array('!threshold' => $threshold, '!shown' => $shown, '!total' => $total_rows)) . '
    '; - } - else { - $output .= t('Showing all !total paths.', array('!total' => $total_rows)) . '
    '; - } - - // Protect against divide by zero - if ($total_rows > 0) { - $mb_avg = number_format($total_bytes/$total_rows/1024/1024, 1); - $ms_avg = number_format($total_ms/$total_rows, 2); - } - else { - $mb_avg = 'n/a'; - $ms_avg = 'n/a'; - } - - $output .= t('Average memory per page: !mb_avg MB', array('!mb_avg' => $mb_avg)) . '
    '; - $output .= t('Average duration per page: !ms_avg ms', array('!ms_avg' => $ms_avg)) . '
    '; - $output .= t('Total number of page accesses: !accesses', array('!accesses' => $total_accesses)) . '
    '; - $output .= t('First access: !access.', array('!access' => format_date($last_min, 'small'))) . '
    '; - $output .= t('Last access: !access.', array('!access' => format_date($last_max, 'small'))) . '
    '; - - $output .= theme_table(array( - 'header' => $header, - 'rows' => $rows, - 'attributes' => array(), - 'caption' => NULL, - 'colgroups' => NULL, - 'sticky' => TRUE, - 'empty' => t('No data has been collected.'), - )); - $output .= theme_pager(array( - 'tags' => NULL, - 'element' => 0, - 'parameters' => $header, - 'quantity' => 9)); - - return $output; -} - -function performance_view_details() { - if (!variable_get('performance_detail', 0)) { - return t('Detail performance log is not enabled. Go to the settings page to enable it.', - array('@link' => url('admin/config/development/performance_logging'))); - } - - $header = array( - array('data' => t('#'), 'field' => 'pid', 'sort' => 'desc'), - array('data' => t('Date'), 'field' => 'timestamp'), - array('data' => t('Path'), 'field' => 'path'), - array('data' => t('Memory (MB)'), 'field' => 'bytes'), - array('data' => t('ms (Total)'), 'field' => 'ms'), - array('data' => t('Anonymous?'), 'field' => 'anon'), - ); - - if (variable_get('performance_query', 0)) { - $header[] = array('data' => t('# Queries'), 'field' => 'query_count'); - $header[] = array('data' => t('Query ms'), 'field' => 'query_timer'); - } - - $pager_height = 50; - $result = db_select('performance_detail', 'p') - ->fields('p') - ->extend('PagerDefault') - ->limit($pager_height) - ->extend('TableSort') - ->orderByHeader($header) - ->execute(); - - $rows = array(); - - foreach ($result as $data) { - $row_data = array(); - $row_data[] = $data->pid; - $row_data[] = format_date($data->timestamp, 'small'); - $row_data[] = check_plain($data->path); - $row_data[] = number_format($data->bytes/1024/1024, 2); - $row_data[] = $data->ms; - $row_data[] = ($data->anon) ? t('Yes') : t('No'); - - if (variable_get('performance_query', 0)) { - $row_data[] = $data->query_count; - $row_data[] = $data->query_timer; - } - - $rows[] = array('data' => $row_data); - } - - if (!$rows) { - $rows[] = array(array('data' => t('No log messages available.'), 'colspan' => count($header))); - } - - $output = theme('table', array('header' => $header, 'rows' => $rows)); - $output .= theme('pager', array('tags' => NULL, 'quantity' => $pager_height)); - - return $output; -} - -function performance_cron() { - // One day ago ... - $timestamp = time() - 24*60*60; - - performance_cron_db_prune($timestamp); - performance_cron_apc_prune($timestamp); -} - -function performance_cron_db_prune($timestamp = 0) { - // Remove rows which have not been accessed since a certain timestamp - db_delete('performance_summary')->condition('last_access', $timestamp, '<='); - - // Remove performance_detail rows on a daily basis - db_delete('performance_detail')->condition('timestamp', $timestamp, '<='); -} - -function performance_cron_apc_prune($timestamp = 0) { - if (!function_exists('apc_cache_info')) { - // APC not enabled, nothing to do ... - return; - } - - // Get all entries in APC's user cache - $list = performance_apc_list_all(); - if (!count($list)) { - // Nothing stored yet - return; - } - - foreach ($list as $key) { - if ($data = apc_fetch($key)) { - if ($data['last_access'] <= $timestamp) { - apc_delete($key); - } - } - } -} - -function performance_clear_apc_confirm() { - $form['confirm'] = array( - '#value' => t('Confirm APC clear'), - ); - return confirm_form( - $form, - t('Are you sure you want to clear the APC statistics for this site?'), - 'admin/config/development/performance_logging', - t('This will clear all the collected performance statistics stored in APC. This action cannot be undone.'), - t('Clear'), - t('Cancel')); -} - -function performance_clear_apc_confirm_submit($form_id, &$form) { - if (!function_exists('apc_cache_info')) { - drupal_set_message(t('APC is not enabled. Nothing to do ...'), 'status', FALSE); - drupal_goto('admin/config/development/performance'); - return; - } - - $list = performance_apc_list_all(); - if (!count($list)) { - // Nothing stored yet - return; - } - - foreach ($list as $key) { - if ($data = apc_fetch($key)) { - apc_delete($key); - } - } - - drupal_set_message(t('Performance statistics collected in APC has been cleared.'), 'status', FALSE); - drupal_goto('admin/config/development/performance'); -} - -function performance_clear_memcache_confirm() { - $form['confirm'] = array( - '#value' => t('Confirm Memcache clear'), - ); - return confirm_form( - $form, - t('Are you sure you want to clear the Memcache statistics for this site?'), - 'admin/settings/performance_logging', - t('This will clear all the collected performance statistics stored in Memcache. This action cannot be undone.'), - t('Clear'), - t('Cancel')); -} - -function performance_clear_memcache_confirm_submit($form, &$form_state) { - if (!performance_memcache_enabled()) { - drupal_set_message(t('Memcache is not enabled. Nothing to do ...'), 'status', FALSE); - drupal_goto('admin/settings/performance'); - return; - } - - // We have to iterate over all entries and delete them, reaching down - // the API stack and calling dmemcache_delete directly. - // This is suboptimal, but there is no other alternative - if ($keys_cache = cache_get(PERFORMANCE_KEY, PERFORMANCE_MEMCACHE_BIN)) { - if ($keys_cache->data) { - foreach ($keys_cache->data as $key => $v) { - dmemcache_delete($key, PERFORMANCE_MEMCACHE_BIN); - } - dmemcache_delete(PERFORMANCE_KEY, PERFORMANCE_MEMCACHE_BIN); - } - } - - drupal_set_message(t('Performance statistics collected in Memcache has been cleared.'), 'status', FALSE); - drupal_goto('admin/settings/performance'); -} - -/** - * Implementation of hook_nagios_info() - */ -function performance_nagios_info() { - return array( - 'name' => 'Performance logging', - 'id' => 'PERF', - ); -} - -/** - * Implementation of hook_nagios() - */ -function performance_nagios() { - $info = performance_nagios_info(); - $id = $info['id']; - - // Find out if we have what we need enabled - $sum = array(); - - $sum[] = variable_get('performance_summary_db', 0); - $sum[] = variable_get('performance_summary_apc', 0); - $go = array_sum($sum); - - if (!$go) { - return array( - $id => array( - 'status' => NAGIOS_STATUS_UNKNOWN, - 'type' => 'perf', - 'text' => t('Performance logging is not enabled'), - ), - ); - } - - // Initialize variables - $total_rows = $total_bytes = $total_ms = $total_accesses = $total_query_time = $total_query_count = 0; - - // Check which data store to use - if (variable_get('performance_summary_apc', 0) && function_exists('apc_cache_info')) { - // Get the data from the APC cache - foreach (performance_apc_list_all() as $key) { - $data_list[] = apc_fetch($key); - } - } - else { - // Get the data form the database table for URLs that have been accessed in the last 15 minutes - $result = db_query("SELECT * FROM {performance_summary} WHERE last_access >= %d", time() - 15*60); - while ($row = db_fetch_array($result)) { - $data_list[] = $row; - } - } - - foreach ($data_list as $data) { - $total_rows++; - - // Calculate running averages - $total_bytes += $data['bytes_avg']; - $total_ms += $data['ms_avg']; - $total_accesses += $data['num_accesses']; - $total_query_time += $data['query_timer_avg']; - $total_query_count += $data['query_count_avg']; - } - - // Protect against divide by zero - if ($total_rows > 0) { - $ms_avg = number_format($total_ms / $total_rows, 1, '.', ''); - $ms_query = number_format($total_query_time / $total_rows, 1, '.', ''); - $query_count = number_format($total_query_count / $total_rows, 2, '.', ''); - $mb_avg = number_format($total_bytes / $total_rows/1024/1024, 1); - } - else { - $mb_avg = ''; - $ms_avg = ''; - $ms_query = ''; - $query_count = ''; - } - - $status = NAGIOS_STATUS_OK; - - return array( - 'ACC' => array( - 'status' => $status, - 'type' => 'perf', - 'text' => $total_accesses, - ), - 'MS' => array( - 'status' => $status, - 'type' => 'perf', - 'text' => $ms_avg, - ), - 'MMB' => array( - 'status' => $status, - 'type' => 'perf', - 'text' => $mb_avg, - ), - 'QRC' => array( - 'status' => $status, - 'type' => 'perf', - 'text' => $query_count, - ), - 'QRT' => array( - 'status' => $status, - 'type' => 'perf', - 'text' => $ms_query, - ), - ); -} -