summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoshe Weitzman2011-04-12 01:53:55 (GMT)
committerMoshe Weitzman2011-04-12 01:53:55 (GMT)
commit2589ce3a5233952efb09f62698f6ff718b7d560c (patch)
tree35c1102b3cd1789b188b59a6c904bfa3e9367988
parent9ab54a0ad0f13750f0b5d8056f41351987655e8d (diff)
Empty master branch. Use 7.x-1.x or 8.x-1.xmaster
-rw-r--r--.gitignore1
-rw-r--r--README.look_at_8.x_please.txt1
-rw-r--r--README.txt48
-rw-r--r--README_devel_node_access.txt42
-rw-r--r--devel-rtl.css8
-rw-r--r--devel.admin.inc142
-rw-r--r--devel.css102
-rw-r--r--devel.drush.inc216
-rw-r--r--devel.info6
-rw-r--r--devel.install88
-rw-r--r--devel.js45
-rw-r--r--devel.module1764
-rw-r--r--devel.pages.inc304
-rw-r--r--devel.rules.inc24
-rw-r--r--devel_generate/devel_generate.drush.inc202
-rw-r--r--devel_generate/devel_generate.fields.inc98
-rw-r--r--devel_generate/devel_generate.inc709
-rw-r--r--devel_generate/devel_generate.info6
-rw-r--r--devel_generate/devel_generate.module416
-rw-r--r--devel_generate/devel_generate_batch.inc68
-rw-r--r--devel_generate/file.devel_generate.inc48
-rw-r--r--devel_generate/image.devel_generate.inc91
-rw-r--r--devel_generate/list.devel_generate.inc20
-rw-r--r--devel_generate/number.devel_generate.inc45
-rw-r--r--devel_generate/taxonomy.devel_generate.inc36
-rw-r--r--devel_generate/text.devel_generate.inc39
-rw-r--r--devel_node_access.api.php78
-rw-r--r--devel_node_access.info7
-rw-r--r--devel_node_access.install13
-rw-r--r--devel_node_access.module1279
-rw-r--r--jquery-1.4.4-uncompressed.js7179
-rwxr-xr-xkrumo/INSTALL32
-rwxr-xr-xkrumo/LICENSE504
-rwxr-xr-xkrumo/README103
-rwxr-xr-xkrumo/TODO24
-rwxr-xr-xkrumo/VERSION1
-rwxr-xr-xkrumo/class.krumo.php1307
-rw-r--r--krumo/docs/Krumo/_class.krumo.php.html267
-rwxr-xr-xkrumo/docs/Krumo/krumo.html900
-rwxr-xr-xkrumo/docs/blank.html13
-rwxr-xr-xkrumo/docs/classtrees_Krumo.html23
-rwxr-xr-xkrumo/docs/elementindex.html392
-rwxr-xr-xkrumo/docs/elementindex_Krumo.html389
-rwxr-xr-xkrumo/docs/errors.html15
-rwxr-xr-xkrumo/docs/index.html24
-rwxr-xr-xkrumo/docs/li_Krumo.html155
-rwxr-xr-xkrumo/docs/media/banner.css32
-rwxr-xr-xkrumo/docs/media/images/AbstractClass.pngbin620 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/AbstractClass_logo.pngbin1232 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/AbstractMethod.pngbin696 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/AbstractPrivateClass.pngbin848 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/AbstractPrivateClass_logo.pngbin1615 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/AbstractPrivateMethod.pngbin874 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Class.pngbin570 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Class_logo.pngbin1600 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Constant.pngbin752 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Constructor.pngbin865 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Destructor.pngbin956 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Function.pngbin596 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Global.pngbin712 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/I.pngbin148 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Index.pngbin584 -> 0 bytes
-rw-r--r--krumo/docs/media/images/Interface.PNGbin1083 -> 0 bytes
-rw-r--r--krumo/docs/media/images/Interface_logo.pngbin1600 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/L.pngbin153 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Lminus.pngbin219 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Lplus.pngbin224 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Method.pngbin661 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Page.pngbin592 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Page_logo.pngbin1369 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/PrivateClass.pngbin790 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/PrivateClass_logo.pngbin1836 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/PrivateMethod.pngbin918 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/PrivateVariable.pngbin772 -> 0 bytes
-rw-r--r--krumo/docs/media/images/StaticMethod.pngbin661 -> 0 bytes
-rw-r--r--krumo/docs/media/images/StaticVariable.pngbin688 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/T.pngbin152 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Tminus.pngbin207 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Tplus.pngbin222 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/Variable.pngbin688 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/blank.pngbin144 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/class_folder.pngbin633 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/empty.pngbin90 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/file.pngbin462 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/folder.pngbin492 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/function_folder.pngbin605 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/minus.gifbin54 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/next_button.pngbin657 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/next_button_disabled.pngbin543 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/package.pngbin668 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/package_folder.pngbin564 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/plus.gifbin56 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/previous_button.pngbin644 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/previous_button_disabled.pngbin541 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/private_class_logo.pngbin1836 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/tutorial.pngbin431 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/tutorial_folder.pngbin572 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/images/up_button.pngbin668 -> 0 bytes
-rwxr-xr-xkrumo/docs/media/lib/classTree.js454
-rwxr-xr-xkrumo/docs/media/stylesheet.css181
-rwxr-xr-xkrumo/docs/packages.html40
-rwxr-xr-xkrumo/docs/ric_INSTALL.html49
-rwxr-xr-xkrumo/docs/ric_LICENSE.html522
-rwxr-xr-xkrumo/docs/ric_README.html121
-rwxr-xr-xkrumo/docs/ric_TODO.html41
-rwxr-xr-xkrumo/docs/ric_VERSION.html18
-rwxr-xr-xkrumo/krumo.ini20
-rwxr-xr-xkrumo/krumo.js97
-rwxr-xr-xkrumo/skins/blue/bg.gifbin141 -> 0 bytes
-rwxr-xr-xkrumo/skins/blue/skin.css157
-rwxr-xr-xkrumo/skins/default/bg.gifbin141 -> 0 bytes
-rwxr-xr-xkrumo/skins/default/skin.css157
-rwxr-xr-xkrumo/skins/green/bg.gifbin141 -> 0 bytes
-rwxr-xr-xkrumo/skins/green/skin.css157
-rwxr-xr-xkrumo/skins/orange/bg.gifbin141 -> 0 bytes
-rwxr-xr-xkrumo/skins/orange/skin.css157
-rwxr-xr-xkrumo/skins/schablon.com/collapsed.gifbin102 -> 0 bytes
-rwxr-xr-xkrumo/skins/schablon.com/dotted.gifbin91 -> 0 bytes
-rwxr-xr-xkrumo/skins/schablon.com/empty.gifbin101 -> 0 bytes
-rwxr-xr-xkrumo/skins/schablon.com/expanded.gifbin99 -> 0 bytes
-rwxr-xr-xkrumo/skins/schablon.com/skin.css164
-rw-r--r--performance/README.txt95
-rw-r--r--performance/performance.info5
-rw-r--r--performance/performance.install145
-rw-r--r--performance/performance.module892
125 files changed, 1 insertions, 20777 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 2820fa5..0000000
--- 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 0000000..4ad67e7
--- /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 aa4df0b..0000000
--- 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 <weitzman at tejasa DOT com>
-http://cyrve.com
-Hans Salvisberg <drupal at salvisberg DOT com>
diff --git a/README_devel_node_access.txt b/README_devel_node_access.txt
deleted file mode 100644
index 1d9362f..0000000
--- 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 fe784a8..0000000
--- 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 ca95cc5..0000000
--- a/devel.admin.inc
+++ /dev/null
@@ -1,142 +0,0 @@
-<?php
-
-function devel_admin_settings() {
- $form['queries'] = array('#type' => '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 <a href="!url">horribly buggy and segfault your Apache</a> ... ', 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.') : '<span class="warning">' . t('You must enable the <a href="!url">xhprof php extension</a> to use this feature.', array('!url' => url('http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/'))) . '</span>';
- $form['xhprof']['devel_xhprof_enabled'] = array(
- '#type' => 'checkbox',
- '#title' => t('Enable profiling of all page views and <a href="!drush">drush</a> 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 <a href="!url">api.module</a> 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 <a href="http://api.drupal.org/api/function/hook_page_alter/7">hook_page_alter()</a> 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. <em>Backtrace</em> prints nice debug information when an error is noticed, and you <a href="@choose">choose to show errors on screen</a>. <strong>Backtrace requires the <a href="@krumo">krumo library</a></strong>. <em>None</em> 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 <em>disabled</em> 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 f06179d..0000000
--- 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 ec17f3e..0000000
--- a/devel.drush.inc
+++ /dev/null
@@ -1,216 +0,0 @@
-<?php
-
-/**
- * @file
- * Drush integration for the devel module.
- */
-
-/**
- * Implements hook_drush_command().
- */
-function devel_drush_command() {
- $items['devel-download'] = array(
- 'description' => 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 f655609..0000000
--- 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 d454fc3..0000000
--- a/devel.install
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
-/**
- * Implements hook_enable().
- */
-function devel_enable() {
- $t = get_t();
-
- // New module weights in core: put devel as the very last in the chain.
- db_update('system')
- ->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 bbf4942..0000000
--- 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 560306f..0000000
--- a/devel.module
+++ /dev/null
@@ -1,1764 +0,0 @@
-<?php
-
-// This module holds functions useful for Drupal development.
-// Please contribute!
-
-// Suggested profiling and stacktrace library from http://www.xdebug.org/index.php
-
-define('DEVEL_QUERY_SORT_BY_SOURCE', 0);
-define('DEVEL_QUERY_SORT_BY_DURATION', 1);
-
-define('DEVEL_ERROR_HANDLER_NONE', 0);
-define('DEVEL_ERROR_HANDLER_STANDARD', 1);
-define('DEVEL_ERROR_HANDLER_BACKTRACE', 2);
-
-define('DEVEL_MIN_TEXTAREA', 50);
-
-/**
- * Implementation of hook_help().
- */
-function devel_help($section) {
- switch ($section) {
- case 'devel/reference':
- return '<p>'. t('This is a list of defined user functions that generated this current request lifecycle. Click on a function name to view its documention.') .'</p>';
- case 'devel/session':
- return '<p>'. t('Here are the contents of your <code>$_SESSION</code> variable.') .'</p>';
- case 'devel/variable':
- $api = variable_get('devel_api_url', 'api.drupal.org');
- return '<p>'. t('This is a list of the variables and their values currently stored in variables table and the <code>$conf</code> array of your settings.php file. These variables are usually accessed with <a href="@variable-get-doc">variable_get()</a> and <a href="@variable-set-doc">variable_set()</a>. 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")) .'</p>';
- 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 <a href="' . url('admin/structure/block') . '">block administration</a> 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 <a href="' . url('admin/structure/block') . '">block administration</a> 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 <a href="!url">turn off</a> 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'] . '<span class="' . $counter++ . '" />'] = $call;
- }
- print t('%error: %message in %function (line %line of %file).', $variables) ." =&gt;\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('<p>The user is being redirected to <a href="@destination">@destination</a>.</p>', 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 <span class="marker">highlighted</span>.', 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 '<div class="dev-query">' . $output . '</div>';
- }
-}
-
-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('<a href="@xhprof">XHProf output</a>. ', 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 = '<span class="dev-memory-usages"> Memory used at: devel_boot()=<strong>@memory_boot</strong> MB, devel_shutdown()=<strong>@memory_shutdown</strong> MB, PHP peak=<strong>@memory_peak</strong> MB.</span>';
- // 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 = '</div>' . 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 '<script type="text/javascript">jQuery.extend(Drupal.settings, '. json_encode($settings) .");</script>\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&nbsp;Optimizer&nbsp;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 <code>&lt;?php ?&gt;</code> 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 = '<div class="devel-obj-output">';
- if ($header) {
- $output .= '<h3>'. t('Display of !type !obj', array('!type' => str_replace(array('$', '->'), '', $prefix), '!obj' => gettype($object))) .'</h3>';
- }
- $output .= _devel_print_object($object, $prefix);
- $output .= '</div>';
- 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 = "<dl>\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 .', <em>'. $summary .'</em>)';
- }
- else {
- $typesum = '('. $type .')';
- }
-
- $output .= '<span class="devel-attr">';
- $output .= "<dt><span class=\"field\">{$prefix}{$field}</span> $typesum</dt>\n";
- $output .= "<dd>\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 .= "</dd></span>\n";
- }
- $output .= "</dl>\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 = '<div class="dev-placeholders">' . check_plain($query['query']) . "</div>\n";
- $args = '<div class="dev-arguments" style="display: none;"></div>' . "\n";
- $explain = '<div class="dev-explain" style="display: none;"></div>' . "\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 .= "<div $attr>$data</div>";
- }
- return $output;
-}
-
-function theme_devel_querylog($variables) {
- $header = $variables['header'];
- $rows = $variables['rows'];
- $output = '';
- if (!empty($header)) {
- $output .= "<div class='devel-querylog devel-querylog-header clear-block'>";
- $output .= theme('devel_querylog_row', array('row' => $header));
- $output .= "</div>";
- }
- if (!empty($rows)) {
- $i = 0;
- foreach ($rows as $row) {
- $i++;
- $zebra = ($i % 2) == 0 ? 'even' : 'odd';
- $output .= "<div class='devel-querylog devel-querylog-$zebra clear-block'>";
- $output .= theme('devel_querylog_row', array('row' => $row));
- $output .= "</div>";
- }
- }
- 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 = "<textarea rows=30 style=\"width: 100%;\">\n". $name . $output .'</textarea>';
- }
- else {
- $printed_value = '<pre>'. $name . $output .'</pre>';
- }
-
- 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 134a59f..0000000
--- a/devel.pages.inc
+++ /dev/null
@@ -1,304 +0,0 @@
-<?php
-
-// Menu callback that shows menu item.
-function devel_menu_item() {
- $item = menu_get_item($_GET['path']);
- return kdevel_print_object($item);
-}
-
-/**
- * Returns a list of all currently defined user functions in the current
- * request lifecycle, with links their documentation.
- */
-function devel_function_reference() {
- $functions = get_defined_functions();
- $version = devel_get_core_version(VERSION);
- $ufunctions = $functions['user'];
- sort($ufunctions);
- $api = variable_get('devel_api_url', 'api.drupal.org');
- foreach ($ufunctions as $function) {
- $links[] = l($function, "http://$api/api/$version/function/$function");
- }
- return theme('item_list', array('items' => $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. <code>hook_uninstall()</code> and <code>hook_install()</code> 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 <code>hook_uninstall()</code>.'),
- );
- $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 <em>Execute PHP</em> block and the <a href="@variable-set-doc">variable_set()</a> 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 0a7a078..0000000
--- a/devel.rules.inc
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-/**
- * Implements hook_rules_action_info().
- */
-function devel_rules_action_info() {
- return array(
- 'devel_debug' => 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 67ca8f6..0000000
--- a/devel_generate/devel_generate.drush.inc
+++ /dev/null
@@ -1,202 +0,0 @@
-<?php
-
-/**
- * @file
- * Generate content, taxonomy, menu, and users via drush framework.
- */
-
-/**
- * Implementation of hook_drush_command().
- */
-function devel_generate_drush_command() {
- $items['generate-users'] = array(
- 'description' => '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 147fe9f..0000000
--- a/devel_generate/devel_generate.fields.inc
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-
-/**
- * @file
- * Functions needed for devel_generate Fields API integration.
- */
-
-/**
- * Enrich the $object that is about to be saved with arbitrary
- * information in each of its fields.
- **/
-function devel_generate_fields(&$object, $obj_type, $bundle) {
- $field_types = field_info_field_types();
- $instances = field_info_instances($obj_type, $bundle);
- $skips = function_exists('drush_get_option') ? drush_get_option('skip-fields', '') : @$_REQUEST['skip-fields'];
- foreach (explode(',', $skips) as $skip) {
- unset($instances[$skip]);
- }
- foreach ($instances as $instance) {
- $field_name = $instance['field_name'];
- $field = field_info_field($field_name);
-
- $object_field = array();
- // If module handles own multiples, then only call its hook once.
- if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
- $max = 0;
- }
- else {
- 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++) {
- $module = $field_types[$field['type']]['module'];
-
- // Include any support file that might exist for this field.
- if (in_array($module, array('file', 'image', 'taxonomy', 'number', 'text', 'comment', 'list'))) {
- // devel_generate implements on behalf of core and special friends.
- module_load_include('inc', 'devel_generate', "$module.devel_generate");
- }
- else {
- module_load_include('inc', $module, "$module.devel_generate");
- }
- $function = $module . '_devel_generate';
- if (function_exists($function)) {
- if ($result = $function($object, $field, $instance, $bundle)) {
- if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
- // Fields that handle their own multiples will add their own deltas.
- $object_field = $result;
- }
- else {
- // When multiples are handled by the content module, add a delta for each result.
- $object_field[$i] = $result;
- }
- }
- }
- }
- // TODO: Completely overriding any existing $object->{$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 bb0358e..0000000
--- a/devel_generate/devel_generate.inc
+++ /dev/null
@@ -1,709 +0,0 @@
-<?php
-
-/**
- * Generate some random users.
- *
- * @param $num
- * Number of users to generate.
- * @param $kill
- * Boolean that indicates if existing users should be removed first.
- * @param $age
- * The max age of each randomly-generated user, in seconds.
- * @param $roles
- * An array of role IDs that the users should receive.
- */
-function devel_create_users($num, $kill, $age = 0, $roles = array()) {
- $url = parse_url($GLOBALS['base_url']);
- if ($kill) {
- $uids = db_select('users', 'u')
- ->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'] = '<front>';
- 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 <p> 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 .= "<p>" . devel_create_greeking($words) . "</p>";
- break;
-
- case 2:
- $output .= devel_create_greeking($words) . "<br />";
- 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 a04f845..0000000
--- 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 07e1844..0000000
--- a/devel_generate/devel_generate.module
+++ /dev/null
@@ -1,416 +0,0 @@
-<?php
-
-/**
- * Implementation of hook_menu().
- */
-function devel_generate_menu() {
- $items = array();
-
- $items['admin/config/development/generate/user'] = array(
- 'title' => '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 <em>authenticated user</em> 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 = '<small>. ' . t('Comments: ') . $map[$default]. '</small>';
- }
- $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. <a href="@create-type">Go create a new content type</a> already!</a>', 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('<strong>Delete all content</strong> 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 2e90357..0000000
--- a/devel_generate/devel_generate_batch.inc
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-/**
- * Devel Generate batch handling functions using the BatchAPI
- */
-
-/**
- * Functions called from FAPI:
- */
-
-function devel_generate_batch_content($form_state) {
- $operations = array();
-
- // Setup the batch operations and save the variables.
- $operations[] = array('devel_generate_batch_content_pre_node', array($form_state['values']));
-
- // add the kill operation
- if ($form_state['values']['kill_content']) {
- $operations[] = array('devel_generate_batch_content_kill', array());
- }
-
- // add the operations to create the nodes
- for ($num = 0; $num < $form_state['values']['num_nodes']; $num ++) {
- $operations[] = array('devel_generate_batch_content_add_node', array());
- }
-
- // start the batch
- $batch = array(
- 'title' => 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 9fb145f..0000000
--- a/devel_generate/file.devel_generate.inc
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-function file_devel_generate($object, $field, $instance, $bundle) {
- if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
- return devel_generate_multiple('_file_devel_generate', $object, $field, $instance, $bundle);
- }
- else {
- return _file_devel_generate($object, $field, $instance, $bundle);
- }
-}
-
-function _file_devel_generate($object, $field, $instance, $bundle) {
- static $file;
-
- if (empty($file)) {
- if ($path = devel_generate_textfile()) {
- $source->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 c2cc1a7..0000000
--- a/devel_generate/image.devel_generate.inc
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-define('DEVEL_GENERATE_IMAGE_MAX', 5);
-
-function image_devel_generate($object, $field, $instance, $bundle) {
- if (function_exists('imagejpeg')) {
- if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
- return devel_generate_multiple('_image_devel_generate', $object, $field, $instance, $bundle);
- }
- else {
- return _image_devel_generate($object, $field, $instance, $bundle);
- }
- }
-}
-
-function _image_devel_generate($object, $field, $instance, $bundle) {
- $object_field = array();
- static $images = array();
-
- $min_resolution = empty($instance['settings']['min_resolution']) ? '100x100' : $instance['settings']['min_resolution'];
- $max_resolution = empty($instance['settings']['max_resolution']) ? '600x600' : $instance['settings']['max_resolution'];
- $extensions = array_intersect(explode(' ', $instance['settings']['file_extensions']), array('png', 'jpg'));
- $extension = array_rand(drupal_map_assoc($extensions));
-
- // Generate a max of 5 different images.
- if (!isset($images[$extension][$min_resolution][$max_resolution]) || count($images[$extension][$min_resolution][$max_resolution]) <= DEVEL_GENERATE_IMAGE_MAX) {
- if ($path = devel_generate_image($extension, $min_resolution, $max_resolution)) {
- $source = new stdClass();
- $source->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 d8101c7..0000000
--- a/devel_generate/list.devel_generate.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-// Id$
-
-function list_devel_generate($object, $field, $instance, $bundle) {
- if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
- return devel_generate_multiple('_list_devel_generate', $object, $field, $instance, $bundle);
- }
- else {
- return _list_devel_generate($object, $field, $instance, $bundle);
- }
-}
-
-function _list_devel_generate($object, $field, $instance, $bundle) {
- $object_field = array();
- if ($allowed_values = list_allowed_values($field)) {
- $keys = array_keys($allowed_values);
- $object_field['value'] = $keys[mt_rand(0, count($allowed_values) - 1)];
- }
- return $object_field;
-}
diff --git a/devel_generate/number.devel_generate.inc b/devel_generate/number.devel_generate.inc
deleted file mode 100644
index 372942c..0000000
--- a/devel_generate/number.devel_generate.inc
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-// Id$
-
-function number_devel_generate($object, $field, $instance, $bundle) {
- if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
- return devel_generate_multiple('_number_devel_generate', $object, $field, $instance, $bundle);
- }
- else {
- return _number_devel_generate($object, $field, $instance, $bundle);
- }
-}
-
-function _number_devel_generate($object, $field, $instance, $bundle) {
- $object_field = array();
- // Make sure the instance settings are all set.
- foreach (array('min', 'max', 'precision', 'scale') as $key) {
- if (empty($instance['settings'][$key])) {
- $instance['settings'][$key] = NULL;
- }
- }
- $min = is_numeric($instance['settings']['min']) ? $instance['settings']['min'] : 0;
- switch ($field['type']) {
- case 'number_integer':
- $max = is_numeric($instance['settings']['max']) ? $instance['settings']['max'] : 10000;
- $decimal = 0;
- $scale = 0;
- break;
-
- case 'number_decimal':
- $precision = is_numeric($instance['settings']['precision']) ? $instance['settings']['precision'] : 10;
- $scale = is_numeric($instance['settings']['scale']) ? $instance['settings']['scale'] : 2;
- $max = is_numeric($instance['settings']['max']) ? $instance['settings']['max'] : pow(10, ($precision - $scale));
- $decimal = rand(0, (10 * $scale)) / 100;
- break;
-
- case 'number_float':
- $precision = rand(10, 32);
- $scale = rand(0, 2);
- $decimal = rand(0, (10 * $scale)) / 100;
- $max = is_numeric($instance['settings']['max']) ? $instance['settings']['max'] : pow(10, ($precision - $scale));
- break;
- }
- $object_field['value'] = round((rand($min, $max) + $decimal), $scale);
- return $object_field;
-}
diff --git a/devel_generate/taxonomy.devel_generate.inc b/devel_generate/taxonomy.devel_generate.inc
deleted file mode 100644
index 70c4162..0000000
--- a/devel_generate/taxonomy.devel_generate.inc
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-function taxonomy_devel_generate($object, $field, $instance, $bundle) {
- if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
- return devel_generate_multiple('_taxonomy_devel_generate', $object, $field, $instance, $bundle);
- }
- else {
- return _taxonomy_devel_generate($object, $field, $instance, $bundle);
- }
-}
-
-function _taxonomy_devel_generate($object, $field, $instance, $bundle) {
- $object_field = array();
- // TODO: For free tagging vocabularies that do not already have terms, this
- // will not result in any tags being added.
- $machine_name = $field['settings']['allowed_values'][0]['vocabulary'];
- $vocabulary = taxonomy_vocabulary_machine_name_load($machine_name);
- if ($max = db_query('SELECT MAX(tid) FROM {taxonomy_term_data} WHERE vid = :vid', array(':vid' => $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 1f4691d..0000000
--- a/devel_generate/text.devel_generate.inc
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-function text_devel_generate($object, $field, $instance, $bundle) {
- if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
- return devel_generate_multiple('_text_devel_generate', $object, $field, $instance, $bundle);
- }
- else {
- return _text_devel_generate($object, $field, $instance, $bundle);
- }
-}
-
-function _text_devel_generate($object, $field, $instance, $bundle) {
- $object_field = array();
- if (!empty($instance['settings']['text_processing'])) {
- $formats = filter_formats();
- $format = array_rand($formats);
- }
- else {
- $format = filter_fallback_format();
- }
-
- if ($instance['widget']['type'] != 'text_textfield') {
- // Textarea handling
- $object_field['value'] = devel_create_content($format);
- if ($instance['widget']['type'] == 'text_textarea_with_summary' && !empty($instance['display_summary'])) {
- $object_field['summary'] = devel_create_content($format);
- }
- }
- else {
- // Textfield handling.
- // Generate a value that respects max_length.
- if (empty($field['settings']['max_length'])) {
- $field['settings']['max_length'] = 12;
- }
- $object_field['value'] = user_password($field['settings']['max_length']);
- }
- $object_field['format'] = $format;
- return $object_field;
-}
diff --git a/devel_node_access.api.php b/devel_node_access.api.php
deleted file mode 100644
index aacf9a6..0000000
--- a/devel_node_access.api.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-
-/**
- * @file
- * Hook provided by the Devel Node Access module.
- */
-
-/**
- * @addtogroup hooks
- * @{
- */
-
-/**
- * Explain your records in the {node_access} table.
- *
- * In order to help developers and administrators understand the forces
- * that control access to any given node, the DNA module provides the
- * Devel Node Access block, which lists all the grant records in the
- * {node_access} table for that node.
- *
- * However, every Node Access module is free in how it defines and uses the
- * 'realm' and 'gid' fields in its records in the {node_access} table, and
- * it's often difficult to interpret them. This hook passes each record
- * that DNA wants to display, and the owning module is expected to return
- * an explanation of that record.
- *
- * The explanation should not be localized (not be passed through t()), so
- * that administrators seeking help can present English explanations.
- *
- * @param $row
- * The record from the {node_access} table, as object. The member fields are:
- * nid, gid, realm, grant_view, grant_update, grant_delete.
- *
- * @return
- * A string with a (short!) explanation of the given {node_access} row,
- * to be displayed in DNA's 'Devel Node Access' block. It will be displayed
- * as HTML; any variable parts must already be sanitized.
- *
- * @see hook_node_access_records()
- * @see devel_node_access_node_access_explain()
- *
- * @ingroup node_access
- */
-function hook_node_access_explain($row) {
- if ($row->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 e747c15..0000000
--- 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 0088d78..0000000
--- a/devel_node_access.install
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-/**
- * Implements hook_uninstall().
- */
-function devel_node_access_uninstall() {
- variable_del('devel_node_access_debug_mode');
-
- if (!module_exists('devel') && ($devel_menu = menu_load('devel'))) {
- // Delete the development menu.
- menu_delete($devel_menu);
- }
-}
diff --git a/devel_node_access.module b/devel_node_access.module
deleted file mode 100644
index 758af15..0000000
--- a/devel_node_access.module
+++ /dev/null
@@ -1,1279 +0,0 @@
-<?php
-/**
- * @file
- *
- * This module gives developers feedback as to what their
- * node_access table contains, and which nodes are protected or
- * visible to the public.
- *
- */
-
-define('DNA_ACCESS_VIEW', 'view devel_node_access information');
-
-function devel_node_access_permission() {
- return array(
- 'view devel_node_access information' => 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 = '<p>' . 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.') . "</p>\n";
- $output .= '<p>' . 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.') . "</p>\n";
- $output .= '<p>' . 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.') . "</p>\n";
- $output .= '<p>' . 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.') . "</p>\n";
- $output .= '<p>' . 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 <a href="@settings_page">settings page</a> 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')))
- ) . "</p>\n";
- $output .= '<p>' . t('This module also provides a <a href="@summary_page">summary page</a> 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'))
- ) . "</p>\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 <a href="' . url('admin/structure/block') . '">block administration</a> 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.<br />For even more information enable the <a href="@link">%DNAbU block</a>, 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 .= '<h3>' . t('Access Granted to All Nodes (All Users)') . "</h3>\n";
- $output .= '<p>' . 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.') . "</p>\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 .= '<h3>' . t('Legacy Nodes') . "</h3>\n";
- $output .= '<p>' .
- 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')))
- . "</p>\n";
- if (!empty($access_granted_to_all_nodes)) {
- $output .= '<p>' .
- t('This issue may be masked by the one above, so look into the former first.')
- . "</p>\n";
- }
- }
- else {
- $output .= '<h3>' . t('All Nodes Represented') . "</h3>\n";
- $output .= '<p>' . t('All nodes are represented in the node_access table.') . "</p>\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 .= '<h3>' . t('Access Granted to All Nodes (Some Users)') . "</h3>\n";
- $output .= '<p>' . 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.') . "</p>\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 .= '<h3>' . t('Access Granted to Some Nodes') . "</h3>\n";
- $output .= '<p>' .
- 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.')
- . "</p>\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 .= '<h3>' . t('Summary by Realm') . "</h3>\n";
- $output .= '<p>' . t('The following realms grant limited access to some specific nodes.') . "</p>\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 .= '<ul>';
- foreach ($duplicates as $realm => $data_by_realm) {
- foreach ($data_by_realm as $gid => $data_by_realm_gid) {
- $msg .= '<li><ul>';
- foreach ($data_by_realm_gid as $grant) {
- $msg .= "<li>$node->nid/$realm/$gid/" . ($grant['grant_view'] ? 1 : 0) . ($grant['grant_update'] ? 1 : 0) . ($grant['grant_delete'] ? 1 : 0) . ' by ' . $grant['#module'] . '</li>';
- }
- $msg .= '</ul></li>';
- }
- }
- $msg .= '</ul>';
- 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 <a href="@link">%DNAbU block</a>.', 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' : '<a href="#node-' . $row->nid . '">' . _devel_node_access_get_node_title($nodes[$row->nid], TRUE) . '</a>'),
- $row->realm,
- $row->gid,
- $row->grant_view,
- $row->grant_update,
- $row->grant_delete,
- implode('<br />', $explained),
- );
- }
- $output[] = array(
- '#theme' => 'table',
- '#header' => $headers,
- '#rows' => $rows,
- '#attributes' => array('style' => 'text-align: left')
- );
-
- $hint = t('To see more details enable <a href="@debug_mode">debug mode</a>.', 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 : '&ndash;&nbsp;');
- $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 : '&ndash;&nbsp;');
- $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' => '&ndash;',
- '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' => '&ndash;',
- '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('<br />', 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'] .= '&prime;';
- $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!"] . '&gt;' . (!$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' => '<a href="#node-' . $grant['nid'] . '">' . $row['nid'] . '</a>',
- 'title' => $grant['#title'],
- );
- $row['realm'] = (empty($grant['#module']) || strpos($grant['realm'], $grant['#module']) === 0 ? '' : $grant['#module'] . ':<br />') . $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'] = '<a href="' . url('admin/reports/status/rebuild') . '">' . $tr('Rebuild permissions') . '</a>';
- $output[] = array(
- '#prefix' => "\n<div class=\"error\">",
- '#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. <br /> DON'T do this just yet if you intend to ask for help with this situation.", $variables),
- '#suffix' => "</div><br />\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' => '<em class="placeholder">' . theme('username', array('account' => $user)) . '</em>',
- '%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' => '<br />&nbsp;',
- );
- }
- else {
- $variables['!list'] = '<div style="margin-left: 2em">' . _devel_node_access_get_grant_list($nid, $ng_alter_data) . '</div>';
- $variables['%access'] = 'view';
- $output[] = array(
- '#prefix' => "\n<div style='text-align: left' title='" . t('These are the grants returned by hook_node_grants() for this user.') . "'>",
- '#markup' => t('!username (user %uid) can use these grants (if they are present above) for %access access: !list', $variables),
- '#suffix' => "</div>\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[] = "<div style='width: 5em; display: inline-block'>" . t('%op:', array('%op' => $op)) . ' </div>' . $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<div style='margin-left: 2em'>",
- '#suffix' => '</div>',
- );
- }
- if (count($nid_items) == 1) {
- $account_items = $nid_items[0];
- }
- else {
- $account_items = array(
- '#theme' => 'item_list',
- '#items' => $nid_items,
- '#type' => 'ul',
- '#prefix' => "\n<div style='margin-left: 2em'>",
- '#suffix' => '</div>',
- );
- }
- $variables['!username'] = theme('username', array('account' => $account));
- $output[] = array(
- '#prefix' => "\n<div style='text-align: left'>",
- '#markup' => t("!username has the following access", $variables),
- 'items' => $account_items,
- '#suffix' => "\n</div>\n",
- );
- }
- }
- }
-
- if (!empty($hint)) {
- $output[] = array(
- '#theme' => 'form_element',
- '#description' => '(' . $hint . ')',
- );
- }
- $output[]['#markup'] = '<br /><br />';
- $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'), '<span title="' . t("Create nodes of the '@Node_type' type.", array('@Node_type' => $node_type->name)) . '">' . t('create') . '</span>', 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 = '<strong>' . $username . '</strong>';
- }
- $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 &ndash; 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] .= '<span class="' . ($second_opinion ? 'ok' : 'error') . '" title="Core seems to disagree on this item. This is a bug in either DNA or Core and should be fixed! Try to look at this node as this user and check whether there is still disagreement.">*</span>';
- }
- 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 &ndash; 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 = '<u>' . $gid . '</u>'; // new grant, still active
- }
- }
- else {
- $g = '<del>' . $gid . '</del>'; // 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 = "<span title='node/$node->nid: $node_title'>" . drupal_substr($node_title, 0, 15) . '...</span>';
- }
- $node_title = '<span title="node/' . $node->nid . '">' . $node_title . '</span>';
- }
- return $node_title;
- }
- elseif (isset($node->nid)) {
- return $node->nid;
- }
- }
- return '&mdash;';
-}
-
-/**
- * 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 '<span class="' . ($permission[0] ? 'ok' : 'error') . '" title="' . $permission[2] . '">' . $permission[1] . '</span>';
-}
diff --git a/jquery-1.4.4-uncompressed.js b/jquery-1.4.4-uncompressed.js
deleted file mode 100644
index 2ddcf99..0000000
--- 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 = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
- 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 = "<input type='radio' name='radiotest' checked='checked'/>";
-
- 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 = "<div style='width:4px;'></div>";
- jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
- }
-
- div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
- 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 = "<a name='" + id + "'/>";
-
- // 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 = "<a href='#'></a>";
-
- 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 = "<p class='TEST'></p>";
-
- // 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 = "<div class='test e'></div><div class='test'></div>";
-
- // 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 = /<tbody/i,
- rhtml = /<|&#?\w+;/,
- rnocache = /<(?:script|object|embed|option|style)/i,
- // checked="checked" or checked (html5)
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- raction = /\=([^="'>\s]+\/)>/g,
- wrapMap = {
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
- legend: [ 1, "<fieldset>", "</fieldset>" ],
- thead: [ 1, "<table>", "</table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- area: [ 1, "<map>", "</map>" ],
- _default: [ 0, "", "" ]
- };
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE can't serialize <link> and <script> tags normally
-if ( !jQuery.support.htmlSerialize ) {
- wrapMap._default = [ 1, "div<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
- text: function( text ) {
- if ( jQuery.isFunction(text) ) {
- return this.each(function(i) {
- var self = jQuery( this );
-
- self.text( text.call(this, i, self.text()) );
- });
- }
-
- if ( typeof text !== "object" && text !== undefined ) {
- return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
- }
-
- return jQuery.text( this );
- },
-
- wrapAll: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
- if ( this[0].parentNode ) {
- wrap.insertBefore( this[0] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
- }
-
- return elem;
- }).append(this);
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapInner( html.call(this, i) );
- });
- }
-
- return this.each(function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- return this.each(function() {
- jQuery( this ).wrapAll( html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- },
-
- append: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.insertBefore( elem, this.firstChild );
- }
- });
- },
-
- before: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this );
- });
- } else if ( arguments.length ) {
- var set = jQuery(arguments[0]);
- set.push.apply( set, this.toArray() );
- return this.pushStack( set, "before", arguments );
- }
- },
-
- after: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- } else if ( arguments.length ) {
- var set = this.pushStack( this, "after", arguments );
- set.push.apply( set, jQuery(arguments[0]).toArray() );
- return set;
- }
- },
-
- // keepData is for internal use only--do not document
- remove: function( selector, keepData ) {
- for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
- if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
- if ( !keepData && elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- jQuery.cleanData( [ elem ] );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- }
- }
-
- return this;
- },
-
- empty: function() {
- for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- }
-
- // Remove any remaining nodes
- while ( elem.firstChild ) {
- elem.removeChild( elem.firstChild );
- }
- }
-
- return this;
- },
-
- clone: function( events ) {
- // Do the clone
- var ret = this.map(function() {
- if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
- // IE copies events bound via attachEvent when
- // using cloneNode. Calling detachEvent on the
- // clone will also remove the events from the orignal
- // In order to get around this, we use innerHTML.
- // Unfortunately, this means some modifications to
- // attributes in IE that are actually only stored
- // as properties will not be copied (such as the
- // the name attribute on an input).
- var html = this.outerHTML,
- ownerDocument = this.ownerDocument;
-
- if ( !html ) {
- var div = ownerDocument.createElement("div");
- div.appendChild( this.cloneNode(true) );
- html = div.innerHTML;
- }
-
- return jQuery.clean([html.replace(rinlinejQuery, "")
- // Handle the case in IE 8 where action=/test/> self-closes a tag
- .replace(raction, '="$1">')
- .replace(rleadingWhitespace, "")], ownerDocument)[0];
- } else {
- return this.cloneNode(true);
- }
- });
-
- // Copy the events from the original to the clone
- if ( events === true ) {
- cloneCopyEvent( this, ret );
- cloneCopyEvent( this.find("*"), ret.find("*") );
- }
-
- // Return the cloned set
- return ret;
- },
-
- html: function( value ) {
- if ( value === undefined ) {
- return this[0] && this[0].nodeType === 1 ?
- this[0].innerHTML.replace(rinlinejQuery, "") :
- null;
-
- // See if we can take a shortcut and just use innerHTML
- } else if ( typeof value === "string" && !rnocache.test( value ) &&
- (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
- !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
-
- value = value.replace(rxhtmlTag, "<$1></$2>");
-
- try {
- for ( var i = 0, l = this.length; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( this[i].nodeType === 1 ) {
- jQuery.cleanData( this[i].getElementsByTagName("*") );
- this[i].innerHTML = value;
- }
- }
-
- // If using innerHTML throws an exception, use the fallback method
- } catch(e) {
- this.empty().append( value );
- }
-
- } else if ( jQuery.isFunction( value ) ) {
- this.each(function(i){
- var self = jQuery( this );
-
- self.html( value.call(this, i, self.html()) );
- });
-
- } else {
- this.empty().append( value );
- }
-
- return this;
- },
-
- replaceWith: function( value ) {
- if ( this[0] && this[0].parentNode ) {
- // Make sure that the elements are removed from the DOM before they are inserted
- // this can help fix replacing a parent with child elements
- if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this), old = self.html();
- self.replaceWith( value.call( this, i, old ) );
- });
- }
-
- if ( typeof value !== "string" ) {
- value = jQuery( value ).detach();
- }
-
- return this.each(function() {
- var next = this.nextSibling,
- parent = this.parentNode;
-
- jQuery( this ).remove();
-
- if ( next ) {
- jQuery(next).before( value );
- } else {
- jQuery(parent).append( value );
- }
- });
- } else {
- return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
- }
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, table, callback ) {
- var results, first, fragment, parent,
- value = args[0],
- scripts = [];
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
- return this.each(function() {
- jQuery(this).domManip( args, table, callback, true );
- });
- }
-
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- args[0] = value.call(this, i, table ? self.html() : undefined);
- self.domManip( args, table, callback );
- });
- }
-
- if ( this[0] ) {
- parent = value && value.parentNode;
-
- // If we're in a fragment, just use that instead of building a new one
- if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
- results = { fragment: parent };
-
- } else {
- results = jQuery.buildFragment( args, this, scripts );
- }
-
- fragment = results.fragment;
-
- if ( fragment.childNodes.length === 1 ) {
- first = fragment = fragment.firstChild;
- } else {
- first = fragment.firstChild;
- }
-
- if ( first ) {
- table = table && jQuery.nodeName( first, "tr" );
-
- for ( var i = 0, l = this.length; i < l; i++ ) {
- callback.call(
- table ?
- root(this[i], first) :
- this[i],
- i > 0 || results.cacheable || this.length > 1 ?
- fragment.cloneNode(true) :
- fragment
- );
- }
- }
-
- if ( scripts.length ) {
- jQuery.each( scripts, evalScript );
- }
- }
-
- return this;
- }
-});
-
-function root( elem, cur ) {
- return jQuery.nodeName(elem, "table") ?
- (elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
- elem;
-}
-
-function cloneCopyEvent(orig, ret) {
- var i = 0;
-
- ret.each(function() {
- if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
- return;
- }
-
- var oldData = jQuery.data( orig[i++] ),
- curData = jQuery.data( this, oldData ),
- events = oldData && oldData.events;
-
- if ( events ) {
- delete curData.handle;
- curData.events = {};
-
- for ( var type in events ) {
- for ( var handler in events[ type ] ) {
- jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
- }
- }
- }
- });
-}
-
-jQuery.buildFragment = function( args, nodes, scripts ) {
- var fragment, cacheable, cacheresults,
- doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
-
- // Only cache "small" (1/2 KB) strings that are associated with the main document
- // Cloning options loses the selected state, so don't cache them
- // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
- // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
- if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
- !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
-
- cacheable = true;
- cacheresults = jQuery.fragments[ args[0] ];
- if ( cacheresults ) {
- if ( cacheresults !== 1 ) {
- fragment = cacheresults;
- }
- }
- }
-
- if ( !fragment ) {
- fragment = doc.createDocumentFragment();
- jQuery.clean( args, doc, fragment, scripts );
- }
-
- if ( cacheable ) {
- jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
- }
-
- return { fragment: fragment, cacheable: cacheable };
-};
-
-jQuery.fragments = {};
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var ret = [],
- insert = jQuery( selector ),
- parent = this.length === 1 && this[0].parentNode;
-
- if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
- insert[ original ]( this[0] );
- return this;
-
- } else {
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = (i > 0 ? this.clone(true) : this).get();
- jQuery( insert[i] )[ original ]( elems );
- ret = ret.concat( elems );
- }
-
- return this.pushStack( ret, name, insert.selector );
- }
- };
-});
-
-jQuery.extend({
- clean: function( elems, context, fragment, scripts ) {
- context = context || document;
-
- // !context.createElement fails in IE with an error but returns typeof 'object'
- if ( typeof context.createElement === "undefined" ) {
- context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
- }
-
- var ret = [];
-
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- if ( typeof elem === "number" ) {
- elem += "";
- }
-
- if ( !elem ) {
- continue;
- }
-
- // Convert html string into DOM nodes
- if ( typeof elem === "string" && !rhtml.test( elem ) ) {
- elem = context.createTextNode( elem );
-
- } else if ( typeof elem === "string" ) {
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(rxhtmlTag, "<$1></$2>");
-
- // Trim whitespace, otherwise indexOf won't work as expected
- var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
- wrap = wrapMap[ tag ] || wrapMap._default,
- depth = wrap[0],
- div = context.createElement("div");
-
- // Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + elem + wrap[2];
-
- // Move to the right depth
- while ( depth-- ) {
- div = div.lastChild;
- }
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !jQuery.support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- var hasBody = rtbody.test(elem),
- tbody = tag === "table" && !hasBody ?
- div.firstChild && div.firstChild.childNodes :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] === "<table>" && !hasBody ?
- div.childNodes :
- [];
-
- for ( var j = tbody.length - 1; j >= 0 ; --j ) {
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
- }
- }
-
- }
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
- div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
- }
-
- elem = div.childNodes;
- }
-
- if ( elem.nodeType ) {
- ret.push( elem );
- } else {
- ret = jQuery.merge( ret, elem );
- }
- }
-
- if ( fragment ) {
- for ( i = 0; ret[i]; i++ ) {
- if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
- scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
-
- } else {
- if ( ret[i].nodeType === 1 ) {
- ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
- }
- fragment.appendChild( ret[i] );
- }
- }
- }
-
- return ret;
- },
-
- cleanData: function( elems ) {
- var data, id, cache = jQuery.cache,
- special = jQuery.event.special,
- deleteExpando = jQuery.support.deleteExpando;
-
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
- continue;
- }
-
- id = elem[ jQuery.expando ];
-
- if ( id ) {
- data = cache[ id ];
-
- if ( data && data.events ) {
- for ( var type in data.events ) {
- if ( special[ type ] ) {
- jQuery.event.remove( elem, type );
-
- } else {
- jQuery.removeEvent( elem, type, data.handle );
- }
- }
- }
-
- if ( deleteExpando ) {
- delete elem[ jQuery.expando ];
-
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( jQuery.expando );
- }
-
- delete cache[ id ];
- }
- }
- }
-});
-
-function evalScript( i, elem ) {
- if ( elem.src ) {
- jQuery.ajax({
- url: elem.src,
- async: false,
- dataType: "script"
- });
- } else {
- jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
-}
-
-
-
-
-var ralpha = /alpha\([^)]*\)/i,
- ropacity = /opacity=([^)]*)/,
- rdashAlpha = /-([a-z])/ig,
- rupper = /([A-Z])/g,
- rnumpx = /^-?\d+(?:px)?$/i,
- rnum = /^-?\d/,
-
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssWidth = [ "Left", "Right" ],
- cssHeight = [ "Top", "Bottom" ],
- curCSS,
-
- getComputedStyle,
- currentStyle,
-
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
-
-jQuery.fn.css = function( name, value ) {
- // Setting 'undefined' is a no-op
- if ( arguments.length === 2 && value === undefined ) {
- return this;
- }
-
- return jQuery.access( this, name, value, true, function( elem, name, value ) {
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- });
-};
-
-jQuery.extend({
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity", "opacity" );
- return ret === "" ? "1" : ret;
-
- } else {
- return elem.style.opacity;
- }
- }
- }
- },
-
- // Exclude the following css properties to add px
- cssNumber: {
- "zIndex": true,
- "fontWeight": true,
- "opacity": true,
- "zoom": true,
- "lineHeight": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {
- // normalize float css property
- "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
- },
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, origName = jQuery.camelCase( name ),
- style = elem.style, hooks = jQuery.cssHooks[ origName ];
-
- name = jQuery.cssProps[ origName ] || origName;
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- // Make sure that NaN and null values aren't set. See: #7116
- if ( typeof value === "number" && isNaN( value ) || value == null ) {
- return;
- }
-
- // If a number was passed in, add 'px' to the (except for certain CSS properties)
- if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {
- value += "px";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
- // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
- // Fixes bug #5509
- try {
- style[ name ] = value;
- } catch(e) {}
- }
-
- } else {
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, extra ) {
- // Make sure that we're working with the right name
- var ret, origName = jQuery.camelCase( name ),
- hooks = jQuery.cssHooks[ origName ];
-
- name = jQuery.cssProps[ origName ] || origName;
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
- return ret;
-
- // Otherwise, if a way to get the computed value exists, use that
- } else if ( curCSS ) {
- return curCSS( elem, name, origName );
- }
- },
-
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var old = {};
-
- // Remember the old values, and insert the new ones
- for ( var name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- callback.call( elem );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
- },
-
- camelCase: function( string ) {
- return string.replace( rdashAlpha, fcamelCase );
- }
-});
-
-// DEPRECATED, Use jQuery.css() instead
-jQuery.curCSS = jQuery.css;
-
-jQuery.each(["height", "width"], function( i, name ) {
- jQuery.cssHooks[ name ] = {
- get: function( elem, computed, extra ) {
- var val;
-
- if ( computed ) {
- if ( elem.offsetWidth !== 0 ) {
- val = getWH( elem, name, extra );
-
- } else {
- jQuery.swap( elem, cssShow, function() {
- val = getWH( elem, name, extra );
- });
- }
-
- if ( val <= 0 ) {
- val = curCSS( elem, name, name );
-
- if ( val === "0px" && currentStyle ) {
- val = currentStyle( elem, name, name );
- }
-
- if ( val != null ) {
- // Should return "auto" instead of 0, use 0 for
- // temporary backwards-compat
- return val === "" || val === "auto" ? "0px" : val;
- }
- }
-
- if ( val < 0 || val == null ) {
- val = elem.style[ name ];
-
- // Should return "auto" instead of 0, use 0 for
- // temporary backwards-compat
- return val === "" || val === "auto" ? "0px" : val;
- }
-
- return typeof val === "string" ? val : val + "px";
- }
- },
-
- set: function( elem, value ) {
- if ( rnumpx.test( value ) ) {
- // ignore negative width and height values #1599
- value = parseFloat(value);
-
- if ( value >= 0 ) {
- return value + "px";
- }
-
- } else {
- return value;
- }
- }
- };
-});
-
-if ( !jQuery.support.opacity ) {
- jQuery.cssHooks.opacity = {
- get: function( elem, computed ) {
- // IE uses filters for opacity
- return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
- (parseFloat(RegExp.$1) / 100) + "" :
- computed ? "1" : "";
- },
-
- set: function( elem, value ) {
- var style = elem.style;
-
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- style.zoom = 1;
-
- // Set the alpha filter to set the opacity
- var opacity = jQuery.isNaN(value) ?
- "" :
- "alpha(opacity=" + value * 100 + ")",
- filter = style.filter || "";
-
- style.filter = ralpha.test(filter) ?
- filter.replace(ralpha, opacity) :
- style.filter + ' ' + opacity;
- }
- };
-}
-
-if ( document.defaultView && document.defaultView.getComputedStyle ) {
- getComputedStyle = function( elem, newName, name ) {
- var ret, defaultView, computedStyle;
-
- name = name.replace( rupper, "-$1" ).toLowerCase();
-
- if ( !(defaultView = elem.ownerDocument.defaultView) ) {
- return undefined;
- }
-
- if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
- ret = computedStyle.getPropertyValue( name );
- if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
- ret = jQuery.style( elem, name );
- }
- }
-
- return ret;
- };
-}
-
-if ( document.documentElement.currentStyle ) {
- currentStyle = function( elem, name ) {
- var left, rsLeft,
- ret = elem.currentStyle && elem.currentStyle[ name ],
- style = elem.style;
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
- // Remember the original values
- left = style.left;
- rsLeft = elem.runtimeStyle.left;
-
- // Put in the new values to get a computed value out
- elem.runtimeStyle.left = elem.currentStyle.left;
- style.left = name === "fontSize" ? "1em" : (ret || 0);
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- elem.runtimeStyle.left = rsLeft;
- }
-
- return ret === "" ? "auto" : ret;
- };
-}
-
-curCSS = getComputedStyle || currentStyle;
-
-function getWH( elem, name, extra ) {
- var which = name === "width" ? cssWidth : cssHeight,
- val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
-
- if ( extra === "border" ) {
- return val;
- }
-
- jQuery.each( which, function() {
- if ( !extra ) {
- val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
- }
-
- if ( extra === "margin" ) {
- val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
-
- } else {
- val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
- }
- });
-
- return val;
-}
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.hidden = function( elem ) {
- var width = elem.offsetWidth,
- height = elem.offsetHeight;
-
- return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
- };
-
- jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
- };
-}
-
-
-
-
-var jsc = jQuery.now(),
- rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
- rselectTextarea = /^(?:select|textarea)/i,
- rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
- rnoContent = /^(?:GET|HEAD)$/,
- rbracket = /\[\]$/,
- jsre = /\=\?(&|$)/,
- rquery = /\?/,
- rts = /([?&])_=[^&]*/,
- rurl = /^(\w+:)?\/\/([^\/?#]+)/,
- r20 = /%20/g,
- rhash = /#.*$/,
-
- // Keep a copy of the old load method
- _load = jQuery.fn.load;
-
-jQuery.fn.extend({
- load: function( url, params, callback ) {
- if ( typeof url !== "string" && _load ) {
- return _load.apply( this, arguments );
-
- // Don't do a request if no elements are being requested
- } else if ( !this.length ) {
- return this;
- }
-
- var off = url.indexOf(" ");
- if ( off >= 0 ) {
- var selector = url.slice(off, url.length);
- url = url.slice(0, off);
- }
-
- // Default to a GET request
- var type = "GET";
-
- // If the second parameter was provided
- if ( params ) {
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
- // We assume that it's the callback
- callback = params;
- params = null;
-
- // Otherwise, build a param string
- } else if ( typeof params === "object" ) {
- params = jQuery.param( params, jQuery.ajaxSettings.traditional );
- type = "POST";
- }
- }
-
- var self = this;
-
- // Request the remote document
- jQuery.ajax({
- url: url,
- type: type,
- dataType: "html",
- data: params,
- complete: function( res, status ) {
- // If successful, inject the HTML into all the matched elements
- if ( status === "success" || status === "notmodified" ) {
- // See if a selector was specified
- self.html( selector ?
- // Create a dummy div to hold the results
- jQuery("<div>")
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append(res.responseText.replace(rscript, ""))
-
- // Locate the specified elements
- .find(selector) :
-
- // If not, just inject the full result
- res.responseText );
- }
-
- if ( callback ) {
- self.each( callback, [res.responseText, status, res] );
- }
- }
- });
-
- return this;
- },
-
- serialize: function() {
- return jQuery.param(this.serializeArray());
- },
-
- serializeArray: function() {
- return this.map(function() {
- return this.elements ? jQuery.makeArray(this.elements) : this;
- })
- .filter(function() {
- return this.name && !this.disabled &&
- (this.checked || rselectTextarea.test(this.nodeName) ||
- rinput.test(this.type));
- })
- .map(function( i, elem ) {
- var val = jQuery(this).val();
-
- return val == null ?
- null :
- jQuery.isArray(val) ?
- jQuery.map( val, function( val, i ) {
- return { name: elem.name, value: val };
- }) :
- { name: elem.name, value: val };
- }).get();
- }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
- jQuery.fn[o] = function( f ) {
- return this.bind(o, f);
- };
-});
-
-jQuery.extend({
- get: function( url, data, callback, type ) {
- // shift arguments if data argument was omited
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = null;
- }
-
- return jQuery.ajax({
- type: "GET",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- getScript: function( url, callback ) {
- return jQuery.get(url, null, callback, "script");
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get(url, data, callback, "json");
- },
-
- post: function( url, data, callback, type ) {
- // shift arguments if data argument was omited
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = {};
- }
-
- return jQuery.ajax({
- type: "POST",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- ajaxSetup: function( settings ) {
- jQuery.extend( jQuery.ajaxSettings, settings );
- },
-
- ajaxSettings: {
- url: location.href,
- global: true,
- type: "GET",
- contentType: "application/x-www-form-urlencoded",
- processData: true,
- async: true,
- /*
- timeout: 0,
- data: null,
- username: null,
- password: null,
- traditional: false,
- */
- // This function can be overriden by calling jQuery.ajaxSetup
- xhr: function() {
- return new window.XMLHttpRequest();
- },
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- script: "text/javascript, application/javascript",
- json: "application/json, text/javascript",
- text: "text/plain",
- _default: "*/*"
- }
- },
-
- ajax: function( origSettings ) {
- var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
- jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
-
- s.url = s.url.replace( rhash, "" );
-
- // Use original (not extended) context object if it was provided
- s.context = origSettings && origSettings.context != null ? origSettings.context : s;
-
- // convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Handle JSONP Parameter Callbacks
- if ( s.dataType === "jsonp" ) {
- if ( type === "GET" ) {
- if ( !jsre.test( s.url ) ) {
- s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
- }
- } else if ( !s.data || !jsre.test(s.data) ) {
- s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
- }
- s.dataType = "json";
- }
-
- // Build temporary JSONP function
- if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
- jsonp = s.jsonpCallback || ("jsonp" + jsc++);
-
- // Replace the =? sequence both in the query string and the data
- if ( s.data ) {
- s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
- }
-
- s.url = s.url.replace(jsre, "=" + jsonp + "$1");
-
- // We need to make sure
- // that a JSONP style response is executed properly
- s.dataType = "script";
-
- // Handle JSONP-style loading
- var customJsonp = window[ jsonp ];
-
- window[ jsonp ] = function( tmp ) {
- if ( jQuery.isFunction( customJsonp ) ) {
- customJsonp( tmp );
-
- } else {
- // Garbage collect
- window[ jsonp ] = undefined;
-
- try {
- delete window[ jsonp ];
- } catch( jsonpError ) {}
- }
-
- data = tmp;
- jQuery.handleSuccess( s, xhr, status, data );
- jQuery.handleComplete( s, xhr, status, data );
-
- if ( head ) {
- head.removeChild( script );
- }
- };
- }
-
- if ( s.dataType === "script" && s.cache === null ) {
- s.cache = false;
- }
-
- if ( s.cache === false && noContent ) {
- var ts = jQuery.now();
-
- // try replacing _= if it is there
- var ret = s.url.replace(rts, "$1_=" + ts);
-
- // if nothing was replaced, add timestamp to the end
- s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
- }
-
- // If data is available, append data to url for GET/HEAD requests
- if ( s.data && noContent ) {
- s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
- }
-
- // Watch for a new set of requests
- if ( s.global && jQuery.active++ === 0 ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // Matches an absolute URL, and saves the domain
- var parts = rurl.exec( s.url ),
- remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host);
-
- // If we're requesting a remote document
- // and trying to load JSON or Script with a GET
- if ( s.dataType === "script" && type === "GET" && remote ) {
- var head = document.getElementsByTagName("head")[0] || document.documentElement;
- var script = document.createElement("script");
- if ( s.scriptCharset ) {
- script.charset = s.scriptCharset;
- }
- script.src = s.url;
-
- // Handle Script loading
- if ( !jsonp ) {
- var done = false;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function() {
- if ( !done && (!this.readyState ||
- this.readyState === "loaded" || this.readyState === "complete") ) {
- done = true;
- jQuery.handleSuccess( s, xhr, status, data );
- jQuery.handleComplete( s, xhr, status, data );
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
- if ( head && script.parentNode ) {
- head.removeChild( script );
- }
- }
- };
- }
-
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709 and #4378).
- head.insertBefore( script, head.firstChild );
-
- // We handle everything using the script element injection
- return undefined;
- }
-
- var requestDone = false;
-
- // Create the request object
- var xhr = s.xhr();
-
- if ( !xhr ) {
- return;
- }
-
- // Open the socket
- // Passing null username, generates a login popup on Opera (#2865)
- if ( s.username ) {
- xhr.open(type, s.url, s.async, s.username, s.password);
- } else {
- xhr.open(type, s.url, s.async);
- }
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- // Set content-type if data specified and content-body is valid for this type
- if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) {
- xhr.setRequestHeader("Content-Type", s.contentType);
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[s.url] ) {
- xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
- }
-
- if ( jQuery.etag[s.url] ) {
- xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
- }
- }
-
- // Set header so the called script knows that it's an XMLHttpRequest
- // Only send the header if it's not a remote XHR
- if ( !remote ) {
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- }
-
- // Set the Accepts header for the server, depending on the dataType
- xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
- s.accepts[ s.dataType ] + ", */*; q=0.01" :
- s.accepts._default );
- } catch( headerError ) {}
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) {
- // Handle the global AJAX counter
- if ( s.global && jQuery.active-- === 1 ) {
- jQuery.event.trigger( "ajaxStop" );
- }
-
- // close opended socket
- xhr.abort();
- return false;
- }
-
- if ( s.global ) {
- jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] );
- }
-
- // Wait for a response to come back
- var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
- // The request was aborted
- if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
- // Opera doesn't call onreadystatechange before this point
- // so we simulate the call
- if ( !requestDone ) {
- jQuery.handleComplete( s, xhr, status, data );
- }
-
- requestDone = true;
- if ( xhr ) {
- xhr.onreadystatechange = jQuery.noop;
- }
-
- // The transfer is complete and the data is available, or the request timed out
- } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
- requestDone = true;
- xhr.onreadystatechange = jQuery.noop;
-
- status = isTimeout === "timeout" ?
- "timeout" :
- !jQuery.httpSuccess( xhr ) ?
- "error" :
- s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
- "notmodified" :
- "success";
-
- var errMsg;
-
- if ( status === "success" ) {
- // Watch for, and catch, XML document parse errors
- try {
- // process the data (runs the xml through httpData regardless of callback)
- data = jQuery.httpData( xhr, s.dataType, s );
- } catch( parserError ) {
- status = "parsererror";
- errMsg = parserError;
- }
- }
-
- // Make sure that the request was successful or notmodified
- if ( status === "success" || status === "notmodified" ) {
- // JSONP handles its own success callback
- if ( !jsonp ) {
- jQuery.handleSuccess( s, xhr, status, data );
- }
- } else {
- jQuery.handleError( s, xhr, status, errMsg );
- }
-
- // Fire the complete handlers
- if ( !jsonp ) {
- jQuery.handleComplete( s, xhr, status, data );
- }
-
- if ( isTimeout === "timeout" ) {
- xhr.abort();
- }
-
- // Stop memory leaks
- if ( s.async ) {
- xhr = null;
- }
- }
- };
-
- // Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK)
- // Opera doesn't fire onreadystatechange at all on abort
- try {
- var oldAbort = xhr.abort;
- xhr.abort = function() {
- if ( xhr ) {
- // oldAbort has no call property in IE7 so
- // just do it this way, which works in all
- // browsers
- Function.prototype.call.call( oldAbort, xhr );
- }
-
- onreadystatechange( "abort" );
- };
- } catch( abortError ) {}
-
- // Timeout checker
- if ( s.async && s.timeout > 0 ) {
- setTimeout(function() {
- // Check to see if the request is still happening
- if ( xhr && !requestDone ) {
- onreadystatechange( "timeout" );
- }
- }, s.timeout);
- }
-
- // Send the data
- try {
- xhr.send( noContent || s.data == null ? null : s.data );
-
- } catch( sendError ) {
- jQuery.handleError( s, xhr, null, sendError );
-
- // Fire the complete handlers
- jQuery.handleComplete( s, xhr, status, data );
- }
-
- // firefox 1.5 doesn't fire statechange for sync requests
- if ( !s.async ) {
- onreadystatechange();
- }
-
- // return XMLHttpRequest to allow aborting the request etc.
- return xhr;
- },
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- param: function( a, traditional ) {
- var s = [],
- add = function( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction(value) ? value() : value;
- s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
- };
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings.traditional;
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray(a) || a.jquery ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( var prefix in a ) {
- buildParams( prefix, a[prefix], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join("&").replace(r20, "+");
- }
-});
-
-function buildParams( prefix, obj, traditional, add ) {
- if ( jQuery.isArray(obj) && obj.length ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
- // If array item is non-scalar (array or object), encode its
- // numeric index to resolve deserialization ambiguity issues.
- // Note that rack (as of 1.0.0) can't currently deserialize
- // nested arrays properly, and attempting to do so may cause
- // a server error. Possible fixes are to modify rack's
- // deserialization algorithm or to provide an option or flag
- // to force array serialization to be shallow.
- buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
- }
- });
-
- } else if ( !traditional && obj != null && typeof obj === "object" ) {
- if ( jQuery.isEmptyObject( obj ) ) {
- add( prefix, "" );
-
- // Serialize object item.
- } else {
- jQuery.each( obj, function( k, v ) {
- buildParams( prefix + "[" + k + "]", v, traditional, add );
- });
- }
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
-}
-
-// This is still on the jQuery object... for now
-// Want to move this to jQuery.ajax some day
-jQuery.extend({
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- handleError: function( s, xhr, status, e ) {
- // If a local callback was specified, fire it
- if ( s.error ) {
- s.error.call( s.context, xhr, status, e );
- }
-
- // Fire the global callback
- if ( s.global ) {
- jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] );
- }
- },
-
- handleSuccess: function( s, xhr, status, data ) {
- // If a local callback was specified, fire it and pass it the data
- if ( s.success ) {
- s.success.call( s.context, data, status, xhr );
- }
-
- // Fire the global callback
- if ( s.global ) {
- jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] );
- }
- },
-
- handleComplete: function( s, xhr, status ) {
- // Process result
- if ( s.complete ) {
- s.complete.call( s.context, xhr, status );
- }
-
- // The request was completed
- if ( s.global ) {
- jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] );
- }
-
- // Handle the global AJAX counter
- if ( s.global && jQuery.active-- === 1 ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- },
-
- triggerGlobal: function( s, type, args ) {
- (s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args);
- },
-
- // Determines if an XMLHttpRequest was successful or not
- httpSuccess: function( xhr ) {
- try {
- // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
- return !xhr.status && location.protocol === "file:" ||
- xhr.status >= 200 && xhr.status < 300 ||
- xhr.status === 304 || xhr.status === 1223;
- } catch(e) {}
-
- return false;
- },
-
- // Determines if an XMLHttpRequest returns NotModified
- httpNotModified: function( xhr, url ) {
- var lastModified = xhr.getResponseHeader("Last-Modified"),
- etag = xhr.getResponseHeader("Etag");
-
- if ( lastModified ) {
- jQuery.lastModified[url] = lastModified;
- }
-
- if ( etag ) {
- jQuery.etag[url] = etag;
- }
-
- return xhr.status === 304;
- },
-
- httpData: function( xhr, type, s ) {
- var ct = xhr.getResponseHeader("content-type") || "",
- xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
- data = xml ? xhr.responseXML : xhr.responseText;
-
- if ( xml && data.documentElement.nodeName === "parsererror" ) {
- jQuery.error( "parsererror" );
- }
-
- // Allow a pre-filtering function to sanitize the response
- // s is checked to keep backwards compatibility
- if ( s && s.dataFilter ) {
- data = s.dataFilter( data, type );
- }
-
- // The filter can actually parse the response
- if ( typeof data === "string" ) {
- // Get the JavaScript object, if JSON is used.
- if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
- data = jQuery.parseJSON( data );
-
- // If the type is "script", eval it in global context
- } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
- jQuery.globalEval( data );
- }
- }
-
- return data;
- }
-
-});
-
-/*
- * Create the request object; Microsoft failed to properly
- * implement the XMLHttpRequest in IE7 (can't request local files),
- * so we use the ActiveXObject when it is available
- * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
- * we need a fallback.
- */
-if ( window.ActiveXObject ) {
- jQuery.ajaxSettings.xhr = function() {
- if ( window.location.protocol !== "file:" ) {
- try {
- return new window.XMLHttpRequest();
- } catch(xhrError) {}
- }
-
- try {
- return new window.ActiveXObject("Microsoft.XMLHTTP");
- } catch(activeError) {}
- };
-}
-
-// Does this browser support XHR requests?
-jQuery.support.ajax = !!jQuery.ajaxSettings.xhr();
-
-
-
-
-var elemdisplay = {},
- rfxtypes = /^(?:toggle|show|hide)$/,
- rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
- timerId,
- fxAttrs = [
- // height animations
- [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
- // width animations
- [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
- // opacity animations
- [ "opacity" ]
- ];
-
-jQuery.fn.extend({
- show: function( speed, easing, callback ) {
- var elem, display;
-
- if ( speed || speed === 0 ) {
- return this.animate( genFx("show", 3), speed, easing, callback);
-
- } else {
- for ( var i = 0, j = this.length; i < j; i++ ) {
- elem = this[i];
- display = elem.style.display;
-
- // Reset the inline display of this element to learn if it is
- // being hidden by cascaded rules or not
- if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
- display = elem.style.display = "";
- }
-
- // Set elements which have been overridden with display: none
- // in a stylesheet to whatever the default browser style is
- // for such an element
- if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
- jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName));
- }
- }
-
- // Set the display of most of the elements in a second loop
- // to avoid the constant reflow
- for ( i = 0; i < j; i++ ) {
- elem = this[i];
- display = elem.style.display;
-
- if ( display === "" || display === "none" ) {
- elem.style.display = jQuery.data(elem, "olddisplay") || "";
- }
- }
-
- return this;
- }
- },
-
- hide: function( speed, easing, callback ) {
- if ( speed || speed === 0 ) {
- return this.animate( genFx("hide", 3), speed, easing, callback);
-
- } else {
- for ( var i = 0, j = this.length; i < j; i++ ) {
- var display = jQuery.css( this[i], "display" );
-
- if ( display !== "none" ) {
- jQuery.data( this[i], "olddisplay", display );
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( i = 0; i < j; i++ ) {
- this[i].style.display = "none";
- }
-
- return this;
- }
- },
-
- // Save the old toggle function
- _toggle: jQuery.fn.toggle,
-
- toggle: function( fn, fn2, callback ) {
- var bool = typeof fn === "boolean";
-
- if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
- this._toggle.apply( this, arguments );
-
- } else if ( fn == null || bool ) {
- this.each(function() {
- var state = bool ? fn : jQuery(this).is(":hidden");
- jQuery(this)[ state ? "show" : "hide" ]();
- });
-
- } else {
- this.animate(genFx("toggle", 3), fn, fn2, callback);
- }
-
- return this;
- },
-
- fadeTo: function( speed, to, easing, callback ) {
- return this.filter(":hidden").css("opacity", 0).show().end()
- .animate({opacity: to}, speed, easing, callback);
- },
-
- animate: function( prop, speed, easing, callback ) {
- var optall = jQuery.speed(speed, easing, callback);
-
- if ( jQuery.isEmptyObject( prop ) ) {
- return this.each( optall.complete );
- }
-
- return this[ optall.queue === false ? "each" : "queue" ](function() {
- // XXX 'this' does not always have a nodeName when running the
- // test suite
-
- var opt = jQuery.extend({}, optall), p,
- isElement = this.nodeType === 1,
- hidden = isElement && jQuery(this).is(":hidden"),
- self = this;
-
- for ( p in prop ) {
- var name = jQuery.camelCase( p );
-
- if ( p !== name ) {
- prop[ name ] = prop[ p ];
- delete prop[ p ];
- p = name;
- }
-
- if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
- return opt.complete.call(this);
- }
-
- if ( isElement && ( p === "height" || p === "width" ) ) {
- // Make sure that nothing sneaks out
- // Record all 3 overflow attributes because IE does not
- // change the overflow attribute when overflowX and
- // overflowY are set to the same value
- opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
-
- // Set display property to inline-block for height/width
- // animations on inline elements that are having width/height
- // animated
- if ( jQuery.css( this, "display" ) === "inline" &&
- jQuery.css( this, "float" ) === "none" ) {
- if ( !jQuery.support.inlineBlockNeedsLayout ) {
- this.style.display = "inline-block";
-
- } else {
- var display = defaultDisplay(this.nodeName);
-
- // inline-level elements accept inline-block;
- // block-level elements need to be inline with layout
- if ( display === "inline" ) {
- this.style.display = "inline-block";
-
- } else {
- this.style.display = "inline";
- this.style.zoom = 1;
- }
- }
- }
- }
-
- if ( jQuery.isArray( prop[p] ) ) {
- // Create (if needed) and add to specialEasing
- (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
- prop[p] = prop[p][0];
- }
- }
-
- if ( opt.overflow != null ) {
- this.style.overflow = "hidden";
- }
-
- opt.curAnim = jQuery.extend({}, prop);
-
- jQuery.each( prop, function( name, val ) {
- var e = new jQuery.fx( self, opt, name );
-
- if ( rfxtypes.test(val) ) {
- e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-
- } else {
- var parts = rfxnum.exec(val),
- start = e.cur() || 0;
-
- if ( parts ) {
- var end = parseFloat( parts[2] ),
- unit = parts[3] || "px";
-
- // We need to compute starting value
- if ( unit !== "px" ) {
- jQuery.style( self, name, (end || 1) + unit);
- start = ((end || 1) / e.cur()) * start;
- jQuery.style( self, name, start + unit);
- }
-
- // If a +=/-= token was provided, we're doing a relative animation
- if ( parts[1] ) {
- end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
- }
-
- e.custom( start, end, unit );
-
- } else {
- e.custom( start, val, "" );
- }
- }
- });
-
- // For JS strict compliance
- return true;
- });
- },
-
- stop: function( clearQueue, gotoEnd ) {
- var timers = jQuery.timers;
-
- if ( clearQueue ) {
- this.queue([]);
- }
-
- this.each(function() {
- // go in reverse order so anything added to the queue during the loop is ignored
- for ( var i = timers.length - 1; i >= 0; i-- ) {
- if ( timers[i].elem === this ) {
- if (gotoEnd) {
- // force the next step to be the last
- timers[i](true);
- }
-
- timers.splice(i, 1);
- }
- }
- });
-
- // start the next in the queue if the last step wasn't forced
- if ( !gotoEnd ) {
- this.dequeue();
- }
-
- return this;
- }
-
-});
-
-function genFx( type, num ) {
- var obj = {};
-
- jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
- obj[ this ] = type;
- });
-
- return obj;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show", 1),
- slideUp: genFx("hide", 1),
- slideToggle: genFx("toggle", 1),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
-});
-
-jQuery.extend({
- speed: function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
-
- // Queueing
- opt.old = opt.complete;
- opt.complete = function() {
- if ( opt.queue !== false ) {
- jQuery(this).dequeue();
- }
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
- };
-
- return opt;
- },
-
- easing: {
- linear: function( p, n, firstNum, diff ) {
- return firstNum + diff * p;
- },
- swing: function( p, n, firstNum, diff ) {
- return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
- }
- },
-
- timers: [],
-
- fx: function( elem, options, prop ) {
- this.options = options;
- this.elem = elem;
- this.prop = prop;
-
- if ( !options.orig ) {
- options.orig = {};
- }
- }
-
-});
-
-jQuery.fx.prototype = {
- // Simple function for setting a style value
- update: function() {
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
- },
-
- // Get the current size
- cur: function() {
- if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
- return this.elem[ this.prop ];
- }
-
- var r = parseFloat( jQuery.css( this.elem, this.prop ) );
- return r && r > -10000 ? r : 0;
- },
-
- // Start an animation from one number to another
- custom: function( from, to, unit ) {
- var self = this,
- fx = jQuery.fx;
-
- this.startTime = jQuery.now();
- this.start = from;
- this.end = to;
- this.unit = unit || this.unit || "px";
- this.now = this.start;
- this.pos = this.state = 0;
-
- function t( gotoEnd ) {
- return self.step(gotoEnd);
- }
-
- t.elem = this.elem;
-
- if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval(fx.tick, fx.interval);
- }
- },
-
- // Simple 'show' function
- show: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
- this.options.show = true;
-
- // Begin the animation
- // Make sure that we start at a small width/height to avoid any
- // flash of content
- this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
-
- // Start by showing the element
- jQuery( this.elem ).show();
- },
-
- // Simple 'hide' function
- hide: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
- this.options.hide = true;
-
- // Begin the animation
- this.custom(this.cur(), 0);
- },
-
- // Each step of an animation
- step: function( gotoEnd ) {
- var t = jQuery.now(), done = true;
-
- if ( gotoEnd || t >= this.options.duration + this.startTime ) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
-
- this.options.curAnim[ this.prop ] = true;
-
- for ( var i in this.options.curAnim ) {
- if ( this.options.curAnim[i] !== true ) {
- done = false;
- }
- }
-
- if ( done ) {
- // Reset the overflow
- if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
- var elem = this.elem,
- options = this.options;
-
- jQuery.each( [ "", "X", "Y" ], function (index, value) {
- elem.style[ "overflow" + value ] = options.overflow[index];
- } );
- }
-
- // Hide the element if the "hide" operation was done
- if ( this.options.hide ) {
- jQuery(this.elem).hide();
- }
-
- // Reset the properties, if the item has been hidden or shown
- if ( this.options.hide || this.options.show ) {
- for ( var p in this.options.curAnim ) {
- jQuery.style( this.elem, p, this.options.orig[p] );
- }
- }
-
- // Execute the complete function
- this.options.complete.call( this.elem );
- }
-
- return false;
-
- } else {
- var n = t - this.startTime;
- this.state = n / this.options.duration;
-
- // Perform the easing function, defaults to swing
- var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
- var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
- this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
- this.now = this.start + ((this.end - this.start) * this.pos);
-
- // Perform the next step of the animation
- this.update();
- }
-
- return true;
- }
-};
-
-jQuery.extend( jQuery.fx, {
- tick: function() {
- var timers = jQuery.timers;
-
- for ( var i = 0; i < timers.length; i++ ) {
- if ( !timers[i]() ) {
- timers.splice(i--, 1);
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- },
-
- interval: 13,
-
- stop: function() {
- clearInterval( timerId );
- timerId = null;
- },
-
- speeds: {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- },
-
- step: {
- opacity: function( fx ) {
- jQuery.style( fx.elem, "opacity", fx.now );
- },
-
- _default: function( fx ) {
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
- fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
- } else {
- fx.elem[ fx.prop ] = fx.now;
- }
- }
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.animated = function( elem ) {
- return jQuery.grep(jQuery.timers, function( fn ) {
- return elem === fn.elem;
- }).length;
- };
-}
-
-function defaultDisplay( nodeName ) {
- if ( !elemdisplay[ nodeName ] ) {
- var elem = jQuery("<" + nodeName + ">").appendTo("body"),
- display = elem.css("display");
-
- elem.remove();
-
- if ( display === "none" || display === "" ) {
- display = "block";
- }
-
- elemdisplay[ nodeName ] = display;
- }
-
- return elemdisplay[ nodeName ];
-}
-
-
-
-
-var rtable = /^t(?:able|d|h)$/i,
- rroot = /^(?:body|html)$/i;
-
-if ( "getBoundingClientRect" in document.documentElement ) {
- jQuery.fn.offset = function( options ) {
- var elem = this[0], box;
-
- if ( options ) {
- return this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
- if ( elem === elem.ownerDocument.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- try {
- box = elem.getBoundingClientRect();
- } catch(e) {}
-
- var doc = elem.ownerDocument,
- docElem = doc.documentElement;
-
- // Make sure we're not dealing with a disconnected DOM node
- if ( !box || !jQuery.contains( docElem, elem ) ) {
- return box || { top: 0, left: 0 };
- }
-
- var body = doc.body,
- win = getWindow(doc),
- clientTop = docElem.clientTop || body.clientTop || 0,
- clientLeft = docElem.clientLeft || body.clientLeft || 0,
- scrollTop = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ),
- scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),
- top = box.top + scrollTop - clientTop,
- left = box.left + scrollLeft - clientLeft;
-
- return { top: top, left: left };
- };
-
-} else {
- jQuery.fn.offset = function( options ) {
- var elem = this[0];
-
- if ( options ) {
- return this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
- if ( elem === elem.ownerDocument.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- jQuery.offset.initialize();
-
- var computedStyle,
- offsetParent = elem.offsetParent,
- prevOffsetParent = elem,
- doc = elem.ownerDocument,
- docElem = doc.documentElement,
- body = doc.body,
- defaultView = doc.defaultView,
- prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
- top = elem.offsetTop,
- left = elem.offsetLeft;
-
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
- if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
- break;
- }
-
- computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
- top -= elem.scrollTop;
- left -= elem.scrollLeft;
-
- if ( elem === offsetParent ) {
- top += elem.offsetTop;
- left += elem.offsetLeft;
-
- if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevOffsetParent = offsetParent;
- offsetParent = elem.offsetParent;
- }
-
- if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevComputedStyle = computedStyle;
- }
-
- if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
- top += body.offsetTop;
- left += body.offsetLeft;
- }
-
- if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
- top += Math.max( docElem.scrollTop, body.scrollTop );
- left += Math.max( docElem.scrollLeft, body.scrollLeft );
- }
-
- return { top: top, left: left };
- };
-}
-
-jQuery.offset = {
- initialize: function() {
- var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
- html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
-
- jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
-
- container.innerHTML = html;
- body.insertBefore( container, body.firstChild );
- innerDiv = container.firstChild;
- checkDiv = innerDiv.firstChild;
- td = innerDiv.nextSibling.firstChild.firstChild;
-
- this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
- this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
-
- checkDiv.style.position = "fixed";
- checkDiv.style.top = "20px";
-
- // safari subtracts parent border width here which is 5px
- this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
- checkDiv.style.position = checkDiv.style.top = "";
-
- innerDiv.style.overflow = "hidden";
- innerDiv.style.position = "relative";
-
- this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
-
- this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
-
- body.removeChild( container );
- body = container = innerDiv = checkDiv = table = td = null;
- jQuery.offset.initialize = jQuery.noop;
- },
-
- bodyOffset: function( body ) {
- var top = body.offsetTop,
- left = body.offsetLeft;
-
- jQuery.offset.initialize();
-
- if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
- top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
- left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
- }
-
- return { top: top, left: left };
- },
-
- setOffset: function( elem, options, i ) {
- var position = jQuery.css( elem, "position" );
-
- // set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- var curElem = jQuery( elem ),
- curOffset = curElem.offset(),
- curCSSTop = jQuery.css( elem, "top" ),
- curCSSLeft = jQuery.css( elem, "left" ),
- calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),
- props = {}, curPosition = {}, curTop, curLeft;
-
- // need to be able to calculate position if either top or left is auto and position is absolute
- if ( calculatePosition ) {
- curPosition = curElem.position();
- }
-
- curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0;
- curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
-
- if ( jQuery.isFunction( options ) ) {
- options = options.call( elem, i, curOffset );
- }
-
- if (options.top != null) {
- props.top = (options.top - curOffset.top) + curTop;
- }
- if (options.left != null) {
- props.left = (options.left - curOffset.left) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- }
-};
-
-
-jQuery.fn.extend({
- position: function() {
- if ( !this[0] ) {
- return null;
- }
-
- var elem = this[0],
-
- // Get *real* offsetParent
- offsetParent = this.offsetParent(),
-
- // Get correct offsets
- offset = this.offset(),
- parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
- offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
-
- // Add offsetParent borders
- parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
- parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
-
- // Subtract the two offsets
- return {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- },
-
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || document.body;
- while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent;
- });
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( ["Left", "Top"], function( i, name ) {
- var method = "scroll" + name;
-
- jQuery.fn[ method ] = function(val) {
- var elem = this[0], win;
-
- if ( !elem ) {
- return null;
- }
-
- if ( val !== undefined ) {
- // Set the scroll offset
- return this.each(function() {
- win = getWindow( this );
-
- if ( win ) {
- win.scrollTo(
- !i ? val : jQuery(win).scrollLeft(),
- i ? val : jQuery(win).scrollTop()
- );
-
- } else {
- this[ method ] = val;
- }
- });
- } else {
- win = getWindow( elem );
-
- // Return the scroll offset
- return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
- jQuery.support.boxModel && win.document.documentElement[ method ] ||
- win.document.body[ method ] :
- elem[ method ];
- }
- };
-});
-
-function getWindow( elem ) {
- return jQuery.isWindow( elem ) ?
- elem :
- elem.nodeType === 9 ?
- elem.defaultView || elem.parentWindow :
- false;
-}
-
-
-
-
-// Create innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each([ "Height", "Width" ], function( i, name ) {
-
- var type = name.toLowerCase();
-
- // innerHeight and innerWidth
- jQuery.fn["inner" + name] = function() {
- return this[0] ?
- parseFloat( jQuery.css( this[0], type, "padding" ) ) :
- null;
- };
-
- // outerHeight and outerWidth
- jQuery.fn["outer" + name] = function( margin ) {
- return this[0] ?
- parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
- null;
- };
-
- jQuery.fn[ type ] = function( size ) {
- // Get window width or height
- var elem = this[0];
- if ( !elem ) {
- return size == null ? null : this;
- }
-
- if ( jQuery.isFunction( size ) ) {
- return this.each(function( i ) {
- var self = jQuery( this );
- self[ type ]( size.call( this, i, self[ type ]() ) );
- });
- }
-
- if ( jQuery.isWindow( elem ) ) {
- // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
- return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
- elem.document.body[ "client" + name ];
-
- // Get document width or height
- } else if ( elem.nodeType === 9 ) {
- // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
- return Math.max(
- elem.documentElement["client" + name],
- elem.body["scroll" + name], elem.documentElement["scroll" + name],
- elem.body["offset" + name], elem.documentElement["offset" + name]
- );
-
- // Get or set width or height on the element
- } else if ( size === undefined ) {
- var orig = jQuery.css( elem, type ),
- ret = parseFloat( orig );
-
- return jQuery.isNaN( ret ) ? orig : ret;
-
- // Set the width or height on the element (default to pixels if value is unitless)
- } else {
- return this.css( type, typeof size === "string" ? size : size + "px" );
- }
- };
-
-});
-
-
-})(window); \ No newline at end of file
diff --git a/krumo/INSTALL b/krumo/INSTALL
deleted file mode 100755
index e6117c8..0000000
--- a/krumo/INSTALL
+++ /dev/null
@@ -1,32 +0,0 @@
-------------------------------------------------------------------------------
-
- 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. \ No newline at end of file
diff --git a/krumo/LICENSE b/krumo/LICENSE
deleted file mode 100755
index 03851a3..0000000
--- a/krumo/LICENSE
+++ /dev/null
@@ -1,504 +0,0 @@
- 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!
-
-
diff --git a/krumo/README b/krumo/README
deleted file mode 100755
index 9391409..0000000
--- a/krumo/README
+++ /dev/null
@@ -1,103 +0,0 @@
-=============================================================================
-
- 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/
diff --git a/krumo/TODO b/krumo/TODO
deleted file mode 100755
index d1de49f..0000000
--- a/krumo/TODO
+++ /dev/null
@@ -1,24 +0,0 @@
-******************************************************************************
-
- 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 \ No newline at end of file
diff --git a/krumo/VERSION b/krumo/VERSION
deleted file mode 100755
index 8d94012..0000000
--- a/krumo/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-0.2.1a \ No newline at end of file
diff --git a/krumo/class.krumo.php b/krumo/class.krumo.php
deleted file mode 100755
index 009a1f4..0000000
--- a/krumo/class.krumo.php
+++ /dev/null
@@ -1,1307 +0,0 @@
-<?php
-/**
-* 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.
-*
-* @author Kaloyan K. Tsvetkov <kaloyan@kaloyan.info>
-* @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License Version 2.1
-*
-* @package Krumo
-*/
-
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-* backward compatibility: the DIR_SEP constant isn't used anymore
-*/
-if(!defined('DIR_SEP')) {
- define('DIR_SEP', DIRECTORY_SEPARATOR);
- }
-/**
-* backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2
-*/
-if (!defined('PATH_SEPARATOR')) {
- define('PATH_SEPARATOR', OS_WINDOWS ? ';' : ':');
- }
-
-// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-/**
-* 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.
-*/
-if (!defined('KRUMO_DIR')) {
- define('KRUMO_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
- }
-
-/**
-* 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.
-*/
-if (!defined('KRUMO_TRUNCATE_LENGTH')) {
- define('KRUMO_TRUNCATE_LENGTH', 50);
- }
-
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-* Krumo API
-*
-* This class stores the Krumo API for rendering and
-* displaying the structured information it is reporting
-*
-* @package Krumo
-*/
-Class krumo {
-
- /**
- * Return Krumo version
- *
- * @return string
- * @access public
- * @static
- */
- Public Static Function version() {
- return '0.2.1a';
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Prints a debug backtrace
- *
- * @access public
- * @static
- */
- Public Static Function backtrace() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- return krumo::dump(debug_backtrace());
- }
-
- /**
- * Prints a list of all currently declared classes.
- *
- * @access public
- * @static
- */
- Public Static Function classes() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all currently declared classes.
-</div>
- <?php
- return krumo::dump(get_declared_classes());
- }
-
- /**
- * Prints a list of all currently declared interfaces (PHP5 only).
- *
- * @access public
- * @static
- */
- Public Static Function interfaces() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all currently declared interfaces.
-</div>
- <?php
- return krumo::dump(get_declared_interfaces());
- }
-
- /**
- * Prints a list of all currently included (or required) files.
- *
- * @access public
- * @static
- */
- Public Static Function includes() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all currently included (or required) files.
-</div>
- <?php
- return krumo::dump(get_included_files());
- }
-
- /**
- * Prints a list of all currently declared functions.
- *
- * @access public
- * @static
- */
- Public Static Function functions() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all currently declared functions.
-</div>
- <?php
- return krumo::dump(get_defined_functions());
- }
-
- /**
- * Prints a list of all currently declared constants.
- *
- * @access public
- * @static
- */
- Public Static Function defines() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all currently declared constants (defines).
-</div>
- <?php
- return krumo::dump(get_defined_constants());
- }
-
- /**
- * Prints a list of all currently loaded PHP extensions.
- *
- * @access public
- * @static
- */
- Public Static Function extensions() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all currently loaded PHP extensions.
-</div>
- <?php
- return krumo::dump(get_loaded_extensions());
- }
-
- /**
- * Prints a list of all HTTP request headers.
- *
- * @access public
- * @static
- */
- Public Static Function headers() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all HTTP request headers.
-</div>
- <?php
- return krumo::dump(getAllHeaders());
- }
-
- /**
- * Prints a list of the configuration settings read from <i>php.ini</i>
- *
- * @access public
- * @static
- */
- Public Static Function phpini() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- if (!readable(get_cfg_var('cfg_file_path'))) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of the configuration settings read from <code><b><?php echo get_cfg_var('cfg_file_path');?></b></code>.
-</div>
- <?php
- return krumo::dump(parse_ini_file(get_cfg_var('cfg_file_path'), true));
- }
-
- /**
- * Prints a list of all your configuration settings.
- *
- * @access public
- * @static
- */
- Public Static Function conf() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all your configuration settings.
-</div>
- <?php
- return krumo::dump(ini_get_all());
- }
-
- /**
- * Prints a list of the specified directories under your <i>include_path</i> option.
- *
- * @access public
- * @static
- */
- Public Static Function path() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of the specified directories under your <code><b>include_path</b></code> option.
-</div>
- <?php
- return krumo::dump(explode(PATH_SEPARATOR, ini_get('include_path')));
- }
-
- /**
- * Prints a list of all the values from the <i>$_REQUEST</i> array.
- *
- * @access public
- * @static
- */
- Public Static Function request() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all the values from the <code><b>$_REQUEST</b></code> array.
-</div>
- <?php
- return krumo::dump($_REQUEST);
- }
-
- /**
- * Prints a list of all the values from the <i>$_GET</i> array.
- *
- * @access public
- * @static
- */
- Public Static Function get() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all the values from the <code><b>$_GET</b></code> array.
-</div>
- <?php
- return krumo::dump($_GET);
- }
-
- /**
- * Prints a list of all the values from the <i>$_POST</i> array.
- *
- * @access public
- * @static
- */
- Public Static Function post() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all the values from the <code><b>$_POST</b></code> array.
-</div>
- <?php
- return krumo::dump($_POST);
- }
-
- /**
- * Prints a list of all the values from the <i>$_SERVER</i> array.
- *
- * @access public
- * @static
- */
- Public Static Function server() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all the values from the <code><b>$_SERVER</b></code> array.
-</div>
- <?php
- return krumo::dump($_SERVER);
- }
-
- /**
- * Prints a list of all the values from the <i>$_COOKIE</i> array.
- *
- * @access public
- * @static
- */
- Public Static Function cookie() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all the values from the <code><b>$_COOKIE</b></code> array.
-</div>
- <?php
- return krumo::dump($_COOKIE);
- }
-
- /**
- * Prints a list of all the values from the <i>$_ENV</i> array.
- *
- * @access public
- * @static
- */
- Public Static Function env() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all the values from the <code><b>$_ENV</b></code> array.
-</div>
- <?php
- return krumo::dump($_ENV);
- }
-
- /**
- * Prints a list of all the values from the <i>$_SESSION</i> array.
- *
- * @access public
- * @static
- */
- Public Static Function session() {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all the values from the <code><b>$_SESSION</b></code> array.
-</div>
- <?php
- return krumo::dump($_SESSION);
- }
-
- /**
- * Prints a list of all the values from an INI file.
- *
- * @param string $ini_file
- *
- * @access public
- * @static
- */
- Public Static Function ini($ini_file) {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // read it
- //
- if (!$_ = @parse_ini_file($ini_file, 1)) {
- return false;
- }
-
- // render it
- //
- ?>
-<div class="krumo-title">
-This is a list of all the values from the <code><b><?php echo realpath($ini_file) ? realpath($ini_file) : $ini_file;?></b></code> INI file.
-</div>
- <?php
- return krumo::dump($_);
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Dump information about a variable
- *
- * @param mixed $data,...
- * @access public
- * @static
- */
- Public Static Function dump($data) {
-
- // disabled ?
- //
- if (!krumo::_debug()) {
- return false;
- }
-
- // more arguments ?
- //
- if (func_num_args() > 1) {
- $_ = func_get_args();
- foreach($_ as $d) {
- krumo::dump($d);
- }
- return;
- }
-
- // the css ?
- //
- krumo::_css();
-
- // find caller
- // DEVEL: we added array_reverse() so the proper file+line number is found.
- $_ = array_reverse(debug_backtrace());
- while($d = array_pop($_)) {
- // DEVEL: changed if() condition below
- if ((strpos(@$d['file'], 'devel') === FALSE) && (strpos(@$d['file'], 'krumo') === FALSE) && @$d['class'] != 'krumo') {
- break;
- }
- }
-
- // the content
- // DEVEL: we add an ltr here.
- ?>
-<div class="krumo-root" dir="ltr">
- <ul class="krumo-node krumo-first">
- <?php echo krumo::_dump($data);?>
- <li class="krumo-footnote">
- <div class="krumo-version" style="white-space:nowrap;">
- <h6>Krumo version <?php echo krumo::version();?></h6> | <a
- href="http://krumo.sourceforge.net"
- target="_blank">http://krumo.sourceforge.net</a>
- </div>
-
- <?php if (@$d['file']) { ?>
- <span class="krumo-call" style="white-space:nowrap;">
- Called from <code><?php echo $d['file']?></code>,
- line <code><?php echo $d['line']?></code></span>
- <?php } ?>
- &nbsp;
- </li>
- </ul>
-</div>
-<?php
- // flee the hive
- //
- $_recursion_marker = krumo::_marker();
- if ($hive =& krumo::_hive($dummy)) {
- foreach($hive as $i=>$bee){
- if (is_object($bee)) {
- unset($hive[$i]->$_recursion_marker);
- } else {
- unset($hive[$i][$_recursion_marker]);
- }
- }
- }
-
- // PHP 4.x.x array reference bug...
- //
- if (is_array($data) && version_compare(PHP_VERSION, "5", "<")) {
- unset($GLOBALS[krumo::_marker()]);
- }
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Returns values from Krumo's configuration
- *
- * @param string $group
- * @param string $name
- * @param mixed $fallback
- * @return mixed
- *
- * @access private
- * @static
- */
- Private Static Function _config($group, $name, $fallback=null) {
-
- static $_config = array();
-
- // not loaded ?
- //
- if (empty($_config)) {
- $_config = (array) @parse_ini_file(
- KRUMO_DIR . 'krumo.ini',
- true);
- }
-
- // exists ?
- //
- return (isset($_config[$group][$name]))
- ? $_config[$group][$name]
- : $fallback;
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Print the skin (CSS)
- *
- * @return boolean
- * @access private
- * @static
- */
- Private Static Function _css() {
-
- static $_css = false;
-
- // already set ?
- //
- if ($_css) {
- return true;
- }
-
- $css = '';
- // DEVEL: changed for Drupal variables system
- $skin = variable_get('devel_krumo_skin', 'orange');
-
- // custom selected skin ?
- //
- $_ = KRUMO_DIR . "skins/{$skin}/skin.css";
- if ($fp = @fopen($_, 'r', 1)) {
- $css = fread($fp, filesize($_));
- fclose($fp);
- }
-
- // defautl skin ?
- //
- if (!$css && ($skin != 'default')) {
- $skin = 'default';
- $_ = KRUMO_DIR . "skins/default/skin.css";
- $css = join('', @file($_));
- }
-
- // print ?
- //
- if ($_css = $css != '') {
-
- // fix the urls
- //
- // DEVEL: changed for Drupal path system.
- $css_url = file_create_url(drupal_get_path('module', 'devel') . "/krumo/skins/{$skin}/");
-
- $css = preg_replace('~%url%~Uis', $css_url, $css);
-
- // the CSS
- //
- ?>
-<!-- Using Krumo Skin: <?php echo preg_replace('~^' . preg_quote(realpath(KRUMO_DIR) . DIRECTORY_SEPARATOR) . '~Uis', '', realpath($_));?> -->
-<style type="text/css">
-<!--/**/
-<?php echo $css?>
-
-/**/-->
-</style>
-<?php
- // the JS
- //
- ?>
-<script type="text/javascript">
-<!--//
-<?php echo join(file(KRUMO_DIR . "krumo.js"));?>
-
-//-->
-</script>
-<?php
- }
-
- return $_css;
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Enable Krumo
- *
- * @return boolean
- * @access public
- * @static
- */
- Public Static Function enable() {
- return true === krumo::_debug(true);
- }
-
- /**
- * Disable Krumo
- *
- * @return boolean
- * @access public
- * @static
- */
- Public Static Function disable() {
- return false === krumo::_debug(false);
- }
-
- /**
- * Get\Set Krumo state: whether it is enabled or disabled
- *
- * @param boolean $state
- * @return boolean
- * @access private
- * @static
- */
- Private Static Function _debug($state=null) {
-
- static $_ = true;
-
- // set
- //
- if (isset($state)) {
- $_ = (boolean) $state;
- }
-
- // get
- //
- return $_;
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Dump information about a variable
- *
- * @param mixed $data
- * @param string $name
- * @access private
- * @static
- */
- Private Static Function _dump(&$data, $name='...') {
-
- // object ?
- //
- if (is_object($data)) {
- return krumo::_object($data, $name);
- }
-
- // array ?
- //
- if (is_array($data)) {
-
- // PHP 4.x.x array reference bug...
- //
- if (version_compare(PHP_VERSION, "5", "<")) {
-
- // prepare the GLOBAL reference list...
- //
- if (!isset($GLOBALS[krumo::_marker()])) {
- $GLOBALS[krumo::_marker()] = array();
- }
- if (!is_array($GLOBALS[krumo::_marker()])) {
- $GLOBALS[krumo::_marker()] = (array) $GLOBALS[krumo::_marker()];
- }
-
- // extract ?
- //
- if (!empty($GLOBALS[krumo::_marker()])) {
- $d = array_shift($GLOBALS[krumo::_marker()]);
- if (is_array($d)) {
- $data = $d;
- }
- }
- }
-
- return krumo::_array($data, $name);
- }
-
- // resource ?
- //
- if (is_resource($data)) {
- return krumo::_resource($data, $name);
- }
-
- // scalar ?
- //
- if (is_string($data)) {
- return krumo::_string($data, $name);
- }
-
- if (is_float($data)) {
- return krumo::_float($data, $name);
- }
-
- if (is_integer($data)) {
- return krumo::_integer($data, $name);
- }
-
- if (is_bool($data)) {
- return krumo::_boolean($data, $name);
- }
-
- // null ?
- //
- if (is_null($data)) {
- return krumo::_null($name);
- }
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a dump for a NULL value
- *
- * @param string $name
- * @return string
- * @access private
- * @static
- */
- Private Static Function _null($name) {
-?>
-<li class="krumo-child">
- <div class="krumo-element"
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
-
- <a class="krumo-name"><?php echo $name;?></a>
- (<em class="krumo-type krumo-null">NULL</em>)
- </div>
-</li>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Return the marked used to stain arrays
- * and objects in order to detect recursions
- *
- * @return string
- * @access private
- * @static
- */
- Private Static Function _marker() {
-
- static $_recursion_marker;
- if (!isset($_recursion_marker)) {
- $_recursion_marker = uniqid('krumo');
- }
-
- return $_recursion_marker;
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Adds a variable to the hive of arrays and objects which
- * are tracked for whether they have recursive entries
- *
- * @param mixed &$bee either array or object, not a scallar vale
- * @return array all the bees
- *
- * @access private
- * @static
- */
- Private Static Function &_hive(&$bee) {
-
- static $_ = array();
-
- // new bee ?
- //
- if (!is_null($bee)) {
-
- // stain it
- //
- $_recursion_marker = krumo::_marker();
- (is_object($bee))
- ? @($bee->$_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
- //
- ?>
-<div class="krumo-nest" style="display:none;">
- <ul class="krumo-node">
- <?php
-
- // keys ?
- //
- $keys = ($_is_object)
- ? array_keys(get_object_vars($data))
- : array_keys($data);
-
- // itterate
- //
- foreach($keys as $k) {
-
- // skip marker
- //
- if ($k === $_recursion_marker) {
- continue;
- }
-
- // get real value
- //
- if ($_is_object) {
- $v =& $data->$k;
- } else {
- $v =& $data[$k];
- }
-
- krumo::_dump($v,$k);
- } ?>
- </ul>
-</div>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a block that detected recursion
- *
- * @access private
- * @static
- */
- Private Static Function _recursion() {
-?>
-<div class="krumo-nest" style="display:none;">
- <ul class="krumo-node">
- <li class="krumo-child">
- <div class="krumo-element"
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
- <a class="krumo-name"><big>&#8734;</big></a>
- (<em class="krumo-type">Recursion</em>)
- </div>
-
- </li>
- </ul>
-</div>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a dump for an array
- *
- * @param mixed $data
- * @param string $name
- * @access private
- * @static
- */
- Private Static Function _array(&$data, $name) {
-?>
-<li class="krumo-child">
-
- <div class="krumo-element<?php echo count($data) > 0 ? ' krumo-expand' : '';?>"
- <?php if (count($data) > 0) {?> onClick="krumo.toggle(this);"<?php } ?>
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
-
- <a class="krumo-name"><?php echo $name;?></a>
- (<em class="krumo-type">Array, <strong class="krumo-array-length"><?php echo
- (count($data)==1)
- ?("1 element")
- :(count($data)." elements");
- ?></strong></em>)
-
-
- <?php
- // callback ?
- //
- if (is_callable($data)) {
- $_ = array_values($data);
- ?>
- <span class="krumo-callback"> |
- (<em class="krumo-type">Callback</em>)
- <strong class="krumo-string"><?php
- echo htmlSpecialChars($_[0]);?>::<?php
- echo htmlSpecialChars($_[1]);?>();</strong></span>
- <?php
- }
- ?>
-
- </div>
-
- <?php if (count($data)) {
- krumo::_vars($data);
- } ?>
-</li>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a dump for an object
- *
- * @param mixed $data
- * @param string $name
- * @access private
- * @static
- */
- Private Static Function _object(&$data, $name) {
-?>
-<li class="krumo-child">
-
- <div class="krumo-element<?php echo count($data) > 0 ? ' krumo-expand' : '';?>"
- <?php if (count($data) > 0) {?> onClick="krumo.toggle(this);"<?php } ?>
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
-
- <a class="krumo-name"><?php echo $name;?></a>
- (<em class="krumo-type">Object</em>)
- <strong class="krumo-class"><?php echo get_class($data);?></strong>
- </div>
-
- <?php if (count($data)) {
- krumo::_vars($data);
- } ?>
-</li>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a dump for a resource
- *
- * @param mixed $data
- * @param string $name
- * @access private
- * @static
- */
- Private Static Function _resource($data, $name) {
-?>
-<li class="krumo-child">
-
- <div class="krumo-element"
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
-
- <a class="krumo-name"><?php echo $name;?></a>
- (<em class="krumo-type">Resource</em>)
- <strong class="krumo-resource"><?php echo get_resource_type($data);?></strong>
- </div>
-
-</li>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a dump for a boolean value
- *
- * @param mixed $data
- * @param string $name
- * @access private
- * @static
- */
- Private Static Function _boolean($data, $name) {
-?>
-<li class="krumo-child">
-
- <div class="krumo-element"
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
-
- <a class="krumo-name"><?php echo $name;?></a>
- (<em class="krumo-type">Boolean</em>)
- <strong class="krumo-boolean"><?php echo $data?'TRUE':'FALSE'?></strong>
- </div>
-
-</li>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a dump for a integer value
- *
- * @param mixed $data
- * @param string $name
- * @access private
- * @static
- */
- Private Static Function _integer($data, $name) {
-?>
-<li class="krumo-child">
-
- <div class="krumo-element"
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
-
- <a class="krumo-name"><?php echo $name;?></a>
- (<em class="krumo-type">Integer</em>)
- <strong class="krumo-integer"><?php echo $data;?></strong>
- </div>
-
-</li>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a dump for a float value
- *
- * @param mixed $data
- * @param string $name
- * @access private
- * @static
- */
- Private Static Function _float($data, $name) {
-?>
-<li class="krumo-child">
-
- <div class="krumo-element"
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
-
- <a class="krumo-name"><?php echo $name;?></a>
- (<em class="krumo-type">Float</em>)
- <strong class="krumo-float"><?php echo $data;?></strong>
- </div>
-
-</li>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
- /**
- * Render a dump for a string value
- *
- * @param mixed $data
- * @param string $name
- * @access private
- * @static
- */
- Private Static Function _string($data, $name) {
-
- // extra ?
- //
- $_extra = false;
- $_ = $data;
- if (strLen($data) > KRUMO_TRUNCATE_LENGTH) {
- $_ = substr($data, 0, KRUMO_TRUNCATE_LENGTH - 3) . '...';
- $_extra = true;
- }
-?>
-<li class="krumo-child">
-
- <div class="krumo-element<?php echo $_extra ? ' krumo-expand' : '';?>"
- <?php if ($_extra) {?> onClick="krumo.toggle(this);"<?php } ?>
- onMouseOver="krumo.over(this);"
- onMouseOut="krumo.out(this);">
-
- <a class="krumo-name"><?php echo $name;?></a>
- (<em class="krumo-type">String,
- <strong class="krumo-string-length"><?php
- echo strlen($data) ?> characters</strong> </em>)
- <strong class="krumo-string"><?php echo htmlSpecialChars($_);?></strong>
-
- <?php
- // callback ?
- //
- if (is_callable($data)) {
- ?>
- <span class="krumo-callback"> |
- (<em class="krumo-type">Callback</em>)
- <strong class="krumo-string"><?php echo htmlSpecialChars($_);?>();</strong></span>
- <?php
- }
- ?>
-
- </div>
-
- <?php if ($_extra) { ?>
- <div class="krumo-nest" style="display:none;">
- <ul class="krumo-node">
-
- <li class="krumo-child">
- <div class="krumo-preview"><?php echo htmlSpecialChars($data);?></div>
- </li>
-
- </ul>
- </div>
- <?php } ?>
-</li>
-<?php
- }
-
- // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-
-//--end-of-class--
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-/**
-* Alias of {@link krumo::dump()}
-*
-* @param mixed $data,...
-*
-* @see krumo::dump()
-*/
-Function krumo() {
- $_ = func_get_args();
- return call_user_func_array(
- array('krumo', 'dump'), $_
- );
- }
-
-//////////////////////////////////////////////////////////////////////////////
-
-?>
diff --git a/krumo/docs/Krumo/_class.krumo.php.html b/krumo/docs/Krumo/_class.krumo.php.html
deleted file mode 100644
index 6b3fcf4..0000000
--- a/krumo/docs/Krumo/_class.krumo.php.html
+++ /dev/null
@@ -1,267 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs for page class.krumo.php</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <script src="../media/lib/classTree.js"></script>
- <script language="javascript" type="text/javascript">
- var imgPlus = new Image();
- var imgMinus = new Image();
- imgPlus.src = "../media/images/plus.png";
- imgMinus.src = "../media/images/minus.png";
-
- function showNode(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- var oImg = document.layers["img" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- var oImg = document.all["img" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- var oImg = document.getElementById("img" + Node);
- break;
- }
- oImg.src = imgMinus.src;
- oTable.style.display = "block";
- }
-
- function hideNode(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- var oImg = document.layers["img" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- var oImg = document.all["img" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- var oImg = document.getElementById("img" + Node);
- break;
- }
- oImg.src = imgPlus.src;
- oTable.style.display = "none";
- }
-
- function nodeIsVisible(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- break;
- }
- return (oTable && oTable.style.display == "block");
- }
-
- function toggleNodeVisibility(Node){
- if (nodeIsVisible(Node)){
- hideNode(Node);
- }else{
- showNode(Node);
- }
- }
- </script>
- </head>
- <body>
- <div class="page-body">
-<h2 class="file-name"><img src="../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/class.krumo.php</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-constants">Constants</a>
- | <a href="#sec-functions">Functions</a>
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Krumo: Structured information display solution</p>
-<p class="description"><p>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.</p></p>
- <ul class="tags">
- <li><span class="field">author:</span> Kaloyan K. Tsvetkov &lt;<a href="mailto:kaloyan@kaloyan.info">kaloyan@kaloyan.info</a>&gt;</li>
- <li><span class="field">version:</span> $Id$</li>
- <li><span class="field">license:</span> <a href="http://opensource.org/licenses/lgpl-license.php">GNU Lesser General Public License Version 2.1</a></li>
- </ul>
-
- </div>
-</div>
-
- <a name="sec-classes"></a>
- <div class="info-box">
- <div class="info-box-title">Classes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Classes</span>
- | <a href="#sec-constants">Constants</a>
- | <a href="#sec-functions">Functions</a>
- </div>
- <div class="info-box-body">
- <table cellpadding="2" cellspacing="0" class="class-table">
- <tr>
- <th class="class-table-header">Class</th>
- <th class="class-table-header">Description</th>
- </tr>
- <tr>
- <td style="padding-right: 2em; vertical-align: top; white-space: nowrap">
- <img src="../media/images/Class.png"
- alt=" class"
- title=" class"/>
- <a href="../Krumo/krumo.html">krumo</a>
- </td>
- <td>
- Krumo API
- </td>
- </tr>
- </table>
- </div>
- </div>
-
-
- <a name="sec-constants"></a>
- <div class="info-box">
- <div class="info-box-title">Constants</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <span class="disabled">Constants</span>
- | <a href="#sec-functions">Functions</a>
- </div>
- <div class="info-box-body">
- <a name="defineDIR_SEP"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">DIR_SEP</span> = DIRECTORY_SEPARATOR
- (line <span class="line-number">22</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">backward compatibility: the DIR_SEP constant isn't used anymore</p>
-
-
-</div>
-<a name="defineKRUMO_DIR"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">KRUMO_DIR</span> = dirname(__FILE__).DIRECTORY_SEPARATOR
- (line <span class="line-number">39</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">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.</p>
-
-
-</div>
-<a name="defineKRUMO_TRUNCATE_LENGTH"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">KRUMO_TRUNCATE_LENGTH</span> = 50
- (line <span class="line-number">48</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">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>
-
-
-</div>
-<a name="definePATH_SEPARATOR"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">PATH_SEPARATOR</span> = OS_WINDOWS?';':':'
- (line <span class="line-number">28</span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</p>
-
-
-</div>
- </div>
- </div>
-
-
- <a name="sec-functions"></a>
- <div class="info-box">
- <div class="info-box-title">Functions</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-constants">Constants</a>
- | <span class="disabled">Functions</span>
- </div>
- <div class="info-box-body">
- <a name="functionkrumo" id="functionkrumo"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../media/images/Function.png" />
- <span class="method-title">krumo</span> (line <span class="line-number">1295</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Alias of <a href="../Krumo/krumo.html#methoddump">krumo::dump()</a></p>
- <ul class="tags">
- <li><span class="field">see:</span> <a href="../Krumo/krumo.html#methoddump">krumo::dump()</a></li>
- </ul>
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- krumo
- </span>
- ([<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data,...</span> = <span class="var-default"></span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">mixed</span>
- <span class="var-name">$data,...</span> </li>
- </ul>
-
-
-</div>
- </div>
- </div>
-
- <p class="notes" id="credit">
- Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
- </p>
- </div></body>
-</html> \ 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 ce4d33b..0000000
--- a/krumo/docs/Krumo/krumo.html
+++ /dev/null
@@ -1,900 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs For Class krumo</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <script src="../media/lib/classTree.js"></script>
- <script language="javascript" type="text/javascript">
- var imgPlus = new Image();
- var imgMinus = new Image();
- imgPlus.src = "../media/images/plus.png";
- imgMinus.src = "../media/images/minus.png";
-
- function showNode(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- var oImg = document.layers["img" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- var oImg = document.all["img" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- var oImg = document.getElementById("img" + Node);
- break;
- }
- oImg.src = imgMinus.src;
- oTable.style.display = "block";
- }
-
- function hideNode(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- var oImg = document.layers["img" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- var oImg = document.all["img" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- var oImg = document.getElementById("img" + Node);
- break;
- }
- oImg.src = imgPlus.src;
- oTable.style.display = "none";
- }
-
- function nodeIsVisible(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- break;
- }
- return (oTable && oTable.style.display == "block");
- }
-
- function toggleNodeVisibility(Node){
- if (nodeIsVisible(Node)){
- hideNode(Node);
- }else{
- showNode(Node);
- }
- }
- </script>
- </head>
- <body>
- <div class="page-body">
-<h2 class="class-name"><img src="../media/images/Class_logo.png"
- alt=" Class"
- title=" Class"
- style="vertical-align: middle"> krumo</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
-
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Krumo API</p>
-<p class="description"><p>This class stores the Krumo API for rendering and displaying the structured information it is reporting</p></p>
- <p class="notes">
- Located in <a class="field" href="_class.krumo.php.html">/class.krumo.php</a> (line <span class="field">61</span>)
- </p>
-
-
- <pre></pre>
-
- </div>
-</div>
-
-
-
-
- <a name="sec-method-summary"></a>
- <div class="info-box">
- <div class="info-box-title">Method Summary</span></div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
- </div>
- <div class="info-box-body">
- <div class="method-summary">
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#backtrace" title="details" class="method-name">backtrace</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#classes" title="details" class="method-name">classes</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#conf" title="details" class="method-name">conf</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#cookie" title="details" class="method-name">cookie</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#defines" title="details" class="method-name">defines</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">boolean</span>
- <a href="#disable" title="details" class="method-name">disable</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#dump" title="details" class="method-name">dump</a>
- (<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$data,...</span>)
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">boolean</span>
- <a href="#enable" title="details" class="method-name">enable</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#env" title="details" class="method-name">env</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#extensions" title="details" class="method-name">extensions</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#functions" title="details" class="method-name">functions</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#get" title="details" class="method-name">get</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#headers" title="details" class="method-name">headers</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#includes" title="details" class="method-name">includes</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#ini" title="details" class="method-name">ini</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$ini_file</span>)
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#interfaces" title="details" class="method-name">interfaces</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#path" title="details" class="method-name">path</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#phpini" title="details" class="method-name">phpini</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#post" title="details" class="method-name">post</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#request" title="details" class="method-name">request</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#server" title="details" class="method-name">server</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">void</span>
- <a href="#session" title="details" class="method-name">session</a>
- ()
- </div>
-
- <div class="method-definition">
- <img src="../media/images/StaticMethod.png" alt=" "/>
- static <span class="method-result">string</span>
- <a href="#version" title="details" class="method-name">version</a>
- ()
- </div>
- </div>
- </div>
- </div>
-
-
- <a name="sec-methods"></a>
- <div class="info-box">
- <div class="info-box-title">Methods</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
-
- </div>
- <div class="info-box-body">
- <A NAME='method_detail'></A>
-<a name="methodbacktrace" id="backtrace"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static backtrace</span> (line <span class="line-number">82</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a debug backtrace</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- backtrace
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodclasses" id="classes"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static classes</span> (line <span class="line-number">101</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all currently declared classes.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- classes
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodconf" id="conf"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static conf</span> (line <span class="line-number">297</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all your configuration settings.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- conf
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodcookie" id="cookie"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static cookie</span> (line <span class="line-number">441</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- cookie
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methoddefines" id="defines"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static defines</span> (line <span class="line-number">197</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all currently declared constants.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- defines
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methoddisable" id="disable"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static disable</span> (line <span class="line-number">747</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Disable Krumo</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">boolean</span>
- <span class="method-name">
- disable
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methoddump" id="dump"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static dump</span> (line <span class="line-number">548</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Dump information about a variable</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- dump
- </span>
- (<span class="var-type"></span>&nbsp;<span class="var-name">$data</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$data,...</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">mixed</span>
- <span class="var-name">$data,...</span> </li>
- <li>
- <span class="var-type"></span>
- <span class="var-name">$data</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable" id="enable"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static enable</span> (line <span class="line-number">736</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Enable Krumo</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">boolean</span>
- <span class="method-name">
- enable
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodenv" id="env"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static env</span> (line <span class="line-number">465</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all the values from the <em>$_ENV</em> array.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- env
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodextensions" id="extensions"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static extensions</span> (line <span class="line-number">221</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all currently loaded PHP extensions.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- extensions
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodfunctions" id="functions"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static functions</span> (line <span class="line-number">173</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all currently declared functions.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- functions
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodget" id="get"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static get</span> (line <span class="line-number">369</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all the values from the <em>$_GET</em> array.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- get
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodheaders" id="headers"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static headers</span> (line <span class="line-number">245</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all HTTP request headers.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- headers
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodincludes" id="includes"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static includes</span> (line <span class="line-number">149</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all currently included (or required) files.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- includes
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodini" id="ini"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static ini</span> (line <span class="line-number">515</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all the values from an INI file.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- ini
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$ini_file</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$ini_file</span> </li>
- </ul>
-
-
- </div>
-<a name="methodinterfaces" id="interfaces"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static interfaces</span> (line <span class="line-number">125</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all currently declared interfaces (PHP5 only).</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- interfaces
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodpath" id="path"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static path</span> (line <span class="line-number">321</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of the specified directories under your <em>include_path</em> option.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- path
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodphpini" id="phpini"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static phpini</span> (line <span class="line-number">269</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of the configuration settings read from <em>php.ini</em></p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- phpini
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodpost" id="post"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static post</span> (line <span class="line-number">393</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all the values from the <em>$_POST</em> array.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- post
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodrequest" id="request"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static request</span> (line <span class="line-number">345</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- request
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodserver" id="server"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static server</span> (line <span class="line-number">417</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all the values from the <em>$_SERVER</em> array.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- server
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodsession" id="session"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static session</span> (line <span class="line-number">489</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Prints a list of all the values from the <em>$_SESSION</em> array.</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">void</span>
- <span class="method-name">
- session
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodversion" id="version"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../media/images/StaticMethod.png" />
- <span class="method-title">static version</span> (line <span class="line-number">70</span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Return Krumo version</p>
- <ul class="tags">
- <li><span class="field">access:</span> public</li>
- </ul>
-
- <div class="method-signature">
- static <span class="method-result">string</span>
- <span class="method-name">
- version
- </span>
- ()
- </div>
-
-
-
- </div>
-
- </div>
- </div>
-
-
- <p class="notes" id="credit">
- Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
- </p>
- </div></body>
-</html> \ No newline at end of file
diff --git a/krumo/docs/blank.html b/krumo/docs/blank.html
deleted file mode 100755
index 98c9636..0000000
--- a/krumo/docs/blank.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>
-<head>
- <title>Krumo</title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
-</head>
-<body>
-<div align="center"><h1>Krumo</h1></div>
-<b>Welcome to Krumo!</b><br />
-<br />
-This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.0a2</a><br />
-</body>
-</html> \ 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 8123084..0000000
--- a/krumo/docs/classtrees_Krumo.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- </head>
- <body>
-
-<!-- Start of Class Data -->
-<H2>
-
-</H2>
-<h2>Root class krumo</h2>
-<ul>
-<li><a href="Krumo/krumo.html">krumo</a></li></ul>
-
- <p class="notes" id="credit">
- Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
- </p>
- </body>
-</html> \ No newline at end of file
diff --git a/krumo/docs/elementindex.html b/krumo/docs/elementindex.html
deleted file mode 100755
index bc89b7a..0000000
--- a/krumo/docs/elementindex.html
+++ /dev/null
@@ -1,392 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- </head>
- <body>
- <a name="top"></a>
-<h2>Full index</h2>
-<h3>Package indexes</h3>
-<ul>
- <li><a href="elementindex_Krumo.html">Krumo</a></li>
-</ul>
-<br />
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex.html#b">b</a>
- <a class="index-letter" href="elementindex.html#c">c</a>
- <a class="index-letter" href="elementindex.html#d">d</a>
- <a class="index-letter" href="elementindex.html#e">e</a>
- <a class="index-letter" href="elementindex.html#f">f</a>
- <a class="index-letter" href="elementindex.html#g">g</a>
- <a class="index-letter" href="elementindex.html#h">h</a>
- <a class="index-letter" href="elementindex.html#i">i</a>
- <a class="index-letter" href="elementindex.html#k">k</a>
- <a class="index-letter" href="elementindex.html#p">p</a>
- <a class="index-letter" href="elementindex.html#r">r</a>
- <a class="index-letter" href="elementindex.html#s">s</a>
- <a class="index-letter" href="elementindex.html#v">v</a>
-</div>
-
- <a name="b"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">b</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">backtrace</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodbacktrace">krumo::backtrace()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a debug backtrace</div>
- </dd>
- </dl>
- <a name="c"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">c</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Page.png" alt="Page" title="Page" /></title>
- <span class="include-title">class.krumo.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html">class.krumo.php</a> in class.krumo.php</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">classes</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodclasses">krumo::classes()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently declared classes.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">conf</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodconf">krumo::conf()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all your configuration settings.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">cookie</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodcookie">krumo::cookie()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</div>
- </dd>
- </dl>
- <a name="d"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">d</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">defines</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methoddefines">krumo::defines()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently declared constants.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">DIR_SEP</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineDIR_SEP">DIR_SEP</a> in class.krumo.php</div>
- <div class="index-item-description">backward compatibility: the DIR_SEP constant isn't used anymore</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">disable</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methoddisable">krumo::disable()</a> in class.krumo.php</div>
- <div class="index-item-description">Disable Krumo</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">dump</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methoddump">krumo::dump()</a> in class.krumo.php</div>
- <div class="index-item-description">Dump information about a variable</div>
- </dd>
- </dl>
- <a name="e"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">e</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodenable">krumo::enable()</a> in class.krumo.php</div>
- <div class="index-item-description">Enable Krumo</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">env</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodenv">krumo::env()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_ENV</em> array.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">extensions</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodextensions">krumo::extensions()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently loaded PHP extensions.</div>
- </dd>
- </dl>
- <a name="f"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">f</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">functions</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodfunctions">krumo::functions()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently declared functions.</div>
- </dd>
- </dl>
- <a name="g"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">g</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodget">krumo::get()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_GET</em> array.</div>
- </dd>
- </dl>
- <a name="h"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">h</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">headers</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodheaders">krumo::headers()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all HTTP request headers.</div>
- </dd>
- </dl>
- <a name="i"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">i</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">includes</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodincludes">krumo::includes()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently included (or required) files.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">ini</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodini">krumo::ini()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from an INI file.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">interfaces</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodinterfaces">krumo::interfaces()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently declared interfaces (PHP5 only).</div>
- </dd>
- </dl>
- <a name="k"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">k</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Function.png" alt="Function" title="Function" /></title>
- <span class="method-title">krumo</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#functionkrumo">krumo()</a> in class.krumo.php</div>
- <div class="index-item-description">Alias of <a href="Krumo/krumo.html#methoddump">krumo::dump()</a></div>
- </dd>
- <dt class="field">
- <img src="media/images/Class.png" alt="Class" title="Class" /></title>
- krumo
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html">krumo</a> in class.krumo.php</div>
- <div class="index-item-description">Krumo API</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">KRUMO_DIR</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineKRUMO_DIR">KRUMO_DIR</a> in class.krumo.php</div>
- <div class="index-item-description">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.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">KRUMO_TRUNCATE_LENGTH</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineKRUMO_TRUNCATE_LENGTH">KRUMO_TRUNCATE_LENGTH</a> in class.krumo.php</div>
- <div class="index-item-description">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.</div>
- </dd>
- </dl>
- <a name="p"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">p</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">path</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodpath">krumo::path()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of the specified directories under your <em>include_path</em> option.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">PATH_SEPARATOR</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#definePATH_SEPARATOR">PATH_SEPARATOR</a> in class.krumo.php</div>
- <div class="index-item-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">phpini</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodphpini">krumo::phpini()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of the configuration settings read from <em>php.ini</em></div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">post</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodpost">krumo::post()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_POST</em> array.</div>
- </dd>
- </dl>
- <a name="r"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">r</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">request</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodrequest">krumo::request()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</div>
- </dd>
- </dl>
- <a name="s"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">s</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">server</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodserver">krumo::server()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_SERVER</em> array.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">session</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodsession">krumo::session()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_SESSION</em> array.</div>
- </dd>
- </dl>
- <a name="v"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">v</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">version</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodversion">krumo::version()</a> in class.krumo.php</div>
- <div class="index-item-description">Return Krumo version</div>
- </dd>
- </dl>
-
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex.html#b">b</a>
- <a class="index-letter" href="elementindex.html#c">c</a>
- <a class="index-letter" href="elementindex.html#d">d</a>
- <a class="index-letter" href="elementindex.html#e">e</a>
- <a class="index-letter" href="elementindex.html#f">f</a>
- <a class="index-letter" href="elementindex.html#g">g</a>
- <a class="index-letter" href="elementindex.html#h">h</a>
- <a class="index-letter" href="elementindex.html#i">i</a>
- <a class="index-letter" href="elementindex.html#k">k</a>
- <a class="index-letter" href="elementindex.html#p">p</a>
- <a class="index-letter" href="elementindex.html#r">r</a>
- <a class="index-letter" href="elementindex.html#s">s</a>
- <a class="index-letter" href="elementindex.html#v">v</a>
-</div> </body>
-</html> \ 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 39e7477..0000000
--- a/krumo/docs/elementindex_Krumo.html
+++ /dev/null
@@ -1,389 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- </head>
- <body>
- <a name="top"></a>
-<h2>[Krumo] element index</h2>
-<a href="elementindex.html">All elements</a>
-<br />
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex_Krumo.html#b">b</a>
- <a class="index-letter" href="elementindex_Krumo.html#c">c</a>
- <a class="index-letter" href="elementindex_Krumo.html#d">d</a>
- <a class="index-letter" href="elementindex_Krumo.html#e">e</a>
- <a class="index-letter" href="elementindex_Krumo.html#f">f</a>
- <a class="index-letter" href="elementindex_Krumo.html#g">g</a>
- <a class="index-letter" href="elementindex_Krumo.html#h">h</a>
- <a class="index-letter" href="elementindex_Krumo.html#i">i</a>
- <a class="index-letter" href="elementindex_Krumo.html#k">k</a>
- <a class="index-letter" href="elementindex_Krumo.html#p">p</a>
- <a class="index-letter" href="elementindex_Krumo.html#r">r</a>
- <a class="index-letter" href="elementindex_Krumo.html#s">s</a>
- <a class="index-letter" href="elementindex_Krumo.html#v">v</a>
-</div>
-
- <a name="b"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">b</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">backtrace</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodbacktrace">krumo::backtrace()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a debug backtrace</div>
- </dd>
- </dl>
- <a name="c"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">c</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Page.png" alt="Page" title="Page" /></title>
- <span class="include-title">class.krumo.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html">class.krumo.php</a> in class.krumo.php</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">classes</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodclasses">krumo::classes()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently declared classes.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">conf</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodconf">krumo::conf()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all your configuration settings.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">cookie</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodcookie">krumo::cookie()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_COOKIE</em> array.</div>
- </dd>
- </dl>
- <a name="d"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">d</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">defines</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methoddefines">krumo::defines()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently declared constants.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">DIR_SEP</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineDIR_SEP">DIR_SEP</a> in class.krumo.php</div>
- <div class="index-item-description">backward compatibility: the DIR_SEP constant isn't used anymore</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">disable</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methoddisable">krumo::disable()</a> in class.krumo.php</div>
- <div class="index-item-description">Disable Krumo</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">dump</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methoddump">krumo::dump()</a> in class.krumo.php</div>
- <div class="index-item-description">Dump information about a variable</div>
- </dd>
- </dl>
- <a name="e"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">e</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodenable">krumo::enable()</a> in class.krumo.php</div>
- <div class="index-item-description">Enable Krumo</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">env</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodenv">krumo::env()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_ENV</em> array.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">extensions</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodextensions">krumo::extensions()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently loaded PHP extensions.</div>
- </dd>
- </dl>
- <a name="f"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">f</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">functions</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodfunctions">krumo::functions()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently declared functions.</div>
- </dd>
- </dl>
- <a name="g"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">g</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodget">krumo::get()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_GET</em> array.</div>
- </dd>
- </dl>
- <a name="h"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">h</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">headers</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodheaders">krumo::headers()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all HTTP request headers.</div>
- </dd>
- </dl>
- <a name="i"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">i</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">includes</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodincludes">krumo::includes()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently included (or required) files.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">ini</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodini">krumo::ini()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from an INI file.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">interfaces</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodinterfaces">krumo::interfaces()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all currently declared interfaces (PHP5 only).</div>
- </dd>
- </dl>
- <a name="k"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">k</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Function.png" alt="Function" title="Function" /></title>
- <span class="method-title">krumo</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#functionkrumo">krumo()</a> in class.krumo.php</div>
- <div class="index-item-description">Alias of <a href="Krumo/krumo.html#methoddump">krumo::dump()</a></div>
- </dd>
- <dt class="field">
- <img src="media/images/Class.png" alt="Class" title="Class" /></title>
- krumo
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html">krumo</a> in class.krumo.php</div>
- <div class="index-item-description">Krumo API</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">KRUMO_DIR</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineKRUMO_DIR">KRUMO_DIR</a> in class.krumo.php</div>
- <div class="index-item-description">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.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">KRUMO_TRUNCATE_LENGTH</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#defineKRUMO_TRUNCATE_LENGTH">KRUMO_TRUNCATE_LENGTH</a> in class.krumo.php</div>
- <div class="index-item-description">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.</div>
- </dd>
- </dl>
- <a name="p"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">p</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">path</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodpath">krumo::path()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of the specified directories under your <em>include_path</em> option.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">PATH_SEPARATOR</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/_class.krumo.php.html#definePATH_SEPARATOR">PATH_SEPARATOR</a> in class.krumo.php</div>
- <div class="index-item-description">backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">phpini</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodphpini">krumo::phpini()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of the configuration settings read from <em>php.ini</em></div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">post</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodpost">krumo::post()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_POST</em> array.</div>
- </dd>
- </dl>
- <a name="r"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">r</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">request</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodrequest">krumo::request()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_REQUEST</em> array.</div>
- </dd>
- </dl>
- <a name="s"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">s</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">server</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodserver">krumo::server()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_SERVER</em> array.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">session</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodsession">krumo::session()</a> in class.krumo.php</div>
- <div class="index-item-description">Prints a list of all the values from the <em>$_SESSION</em> array.</div>
- </dd>
- </dl>
- <a name="v"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">v</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">version</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="Krumo/krumo.html#methodversion">krumo::version()</a> in class.krumo.php</div>
- <div class="index-item-description">Return Krumo version</div>
- </dd>
- </dl>
-
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex_Krumo.html#b">b</a>
- <a class="index-letter" href="elementindex_Krumo.html#c">c</a>
- <a class="index-letter" href="elementindex_Krumo.html#d">d</a>
- <a class="index-letter" href="elementindex_Krumo.html#e">e</a>
- <a class="index-letter" href="elementindex_Krumo.html#f">f</a>
- <a class="index-letter" href="elementindex_Krumo.html#g">g</a>
- <a class="index-letter" href="elementindex_Krumo.html#h">h</a>
- <a class="index-letter" href="elementindex_Krumo.html#i">i</a>
- <a class="index-letter" href="elementindex_Krumo.html#k">k</a>
- <a class="index-letter" href="elementindex_Krumo.html#p">p</a>
- <a class="index-letter" href="elementindex_Krumo.html#r">r</a>
- <a class="index-letter" href="elementindex_Krumo.html#s">s</a>
- <a class="index-letter" href="elementindex_Krumo.html#v">v</a>
-</div> </body>
-</html> \ No newline at end of file
diff --git a/krumo/docs/errors.html b/krumo/docs/errors.html
deleted file mode 100755
index cf21fd4..0000000
--- a/krumo/docs/errors.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>phpDocumentor Parser Errors and Warnings</title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- </head>
- <body>
- <a href="#Post-parsing">Post-parsing</a><br>
- <p class="notes" id="credit">
- Documentation generated on Sun, 02 Dec 2007 09:43:25 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0a2</a>
- </p>
- </body>
-</html> \ No newline at end of file
diff --git a/krumo/docs/index.html b/krumo/docs/index.html
deleted file mode 100755
index 8276a70..0000000
--- a/krumo/docs/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <!-- Generated by phpDocumentor on Sun, 02 Dec 2007 09:43:23 +0200 -->
- <title>Krumo</title>
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
-</head>
-
-<FRAMESET rows='120,*'>
- <FRAME src='packages.html' name='left_top' frameborder="1" bordercolor="#999999">
- <FRAMESET cols='25%,*'>
- <FRAME src='li_Krumo.html' name='left_bottom' frameborder="1" bordercolor="#999999">
- <FRAME src='blank.html' name='right' frameborder="1" bordercolor="#999999">
- </FRAMESET>
- <NOFRAMES>
- <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>
- </NOFRAMES>
-</FRAMESET>
-</HTML> \ 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 f353e8d..0000000
--- a/krumo/docs/li_Krumo.html
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <script src="media/lib/classTree.js"></script>
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- <script language="javascript" type="text/javascript">
- var imgPlus = new Image();
- var imgMinus = new Image();
- imgPlus.src = "media/images/plus.png";
- imgMinus.src = "media/images/minus.png";
-
- function showNode(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- var oImg = document.layers["img" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- var oImg = document.all["img" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- var oImg = document.getElementById("img" + Node);
- break;
- }
- oImg.src = imgMinus.src;
- oTable.style.display = "block";
- }
-
- function hideNode(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- var oImg = document.layers["img" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- var oImg = document.all["img" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- var oImg = document.getElementById("img" + Node);
- break;
- }
- oImg.src = imgPlus.src;
- oTable.style.display = "none";
- }
-
- function nodeIsVisible(Node){
- switch(navigator.family){
- case 'nn4':
- // Nav 4.x code fork...
- var oTable = document.layers["span" + Node];
- break;
- case 'ie4':
- // IE 4/5 code fork...
- var oTable = document.all["span" + Node];
- break;
- case 'gecko':
- // Standards Compliant code fork...
- var oTable = document.getElementById("span" + Node);
- break;
- }
- return (oTable && oTable.style.display == "block");
- }
-
- function toggleNodeVisibility(Node){
- if (nodeIsVisible(Node)){
- hideNode(Node);
- }else{
- showNode(Node);
- }
- }
- </script>
- </head>
- <body>
- <h3 class="package-title">Krumo</h3>
-<div class="tree">
-<script language="Javascript">
-if (document.getElementById) {
- var tree = new WebFXTree('<span class="package">Krumo</span>');
- tree.setBehavior('classic');
- tree.openIcon = 'media/images/package.png';
- tree.icon = 'media/images/package.png';
-
-
- var class_trees = new WebFXTreeItem('Class trees', 'classtrees_Krumo.html');
- class_trees.openIcon = 'media/images/Index.png';
- class_trees.icon = 'media/images/Index.png';
- tree.add(class_trees);
-
- var elements = new WebFXTreeItem('Index of elements', 'elementindex_Krumo.html');
- elements.openIcon = 'media/images/Index.png';
- elements.icon = 'media/images/Index.png';
- tree.add(elements);
-
- var parent_node;
-
-
-
- var tree_classe = new WebFXTreeItem('Class(es)', '');
- tree_classe.openIcon = 'media/images/class_folder.png';
- tree_classe.icon = 'media/images/class_folder.png';
-
- var classe = new WebFXTreeItem('krumo', 'Krumo/krumo.html');
- classe.openIcon = 'media/images/Class.png';
- classe.icon = 'media/images/Class.png';
- tree_classe.add(classe);
-
- tree.add(tree_classe);
-
- var tree_function = new WebFXTreeItem('Function(s)', '');
- tree_function.openIcon = 'media/images/function_folder.png';
- tree_function.icon = 'media/images/function_folder.png';
-
- var fic = new WebFXTreeItem('krumo', 'Krumo/_class.krumo.php.html#functionkrumo');
- fic.openIcon = 'media/images/Function.png';
- fic.icon = 'media/images/Function.png';
- tree_function.add(fic);
-
- tree.add(tree_function);
-
- var tree_file = new WebFXTreeItem('File(s)', '');
- tree_file.openIcon = 'media/images/folder.png';
- tree_file.icon = 'media/images/folder.png';
-
- var file = new WebFXTreeItem('class.krumo.php', 'Krumo/_class.krumo.php.html');
- file.openIcon = 'media/images/Page.png';
- file.icon = 'media/images/Page.png';
- tree_file.add(file);
-
- tree.add(tree_file);
-
-
-document.write(tree);
-}
-</script>
-</div>
-<p class="notes">
- Generated by
- <a href="http://www.phpdoc.org" target="_blank">phpDocumentor <span class="field">1.4.0a2</span></a>
-</p>
-</body>
-</html> \ 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 1b7fa8a..0000000
--- 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 afa9d1d..0000000
--- a/krumo/docs/media/images/AbstractClass.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/AbstractClass_logo.png b/krumo/docs/media/images/AbstractClass_logo.png
deleted file mode 100755
index 8f65c39..0000000
--- a/krumo/docs/media/images/AbstractClass_logo.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/AbstractMethod.png b/krumo/docs/media/images/AbstractMethod.png
deleted file mode 100755
index 605ccbe..0000000
--- a/krumo/docs/media/images/AbstractMethod.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/AbstractPrivateClass.png b/krumo/docs/media/images/AbstractPrivateClass.png
deleted file mode 100755
index 53d76c6..0000000
--- a/krumo/docs/media/images/AbstractPrivateClass.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/AbstractPrivateClass_logo.png b/krumo/docs/media/images/AbstractPrivateClass_logo.png
deleted file mode 100755
index 4e68f57..0000000
--- a/krumo/docs/media/images/AbstractPrivateClass_logo.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/AbstractPrivateMethod.png b/krumo/docs/media/images/AbstractPrivateMethod.png
deleted file mode 100755
index 41cc9f0..0000000
--- a/krumo/docs/media/images/AbstractPrivateMethod.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Class.png b/krumo/docs/media/images/Class.png
deleted file mode 100755
index cf548d2..0000000
--- a/krumo/docs/media/images/Class.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Class_logo.png b/krumo/docs/media/images/Class_logo.png
deleted file mode 100755
index 6f223c4..0000000
--- a/krumo/docs/media/images/Class_logo.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Constant.png b/krumo/docs/media/images/Constant.png
deleted file mode 100755
index a9c6f28..0000000
--- a/krumo/docs/media/images/Constant.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Constructor.png b/krumo/docs/media/images/Constructor.png
deleted file mode 100755
index 3f16222..0000000
--- a/krumo/docs/media/images/Constructor.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Destructor.png b/krumo/docs/media/images/Destructor.png
deleted file mode 100755
index f28528f..0000000
--- a/krumo/docs/media/images/Destructor.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Function.png b/krumo/docs/media/images/Function.png
deleted file mode 100755
index 902fe25..0000000
--- a/krumo/docs/media/images/Function.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Global.png b/krumo/docs/media/images/Global.png
deleted file mode 100755
index 7281bd2..0000000
--- a/krumo/docs/media/images/Global.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/I.png b/krumo/docs/media/images/I.png
deleted file mode 100755
index e8512fb..0000000
--- a/krumo/docs/media/images/I.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Index.png b/krumo/docs/media/images/Index.png
deleted file mode 100755
index 6558ec3..0000000
--- a/krumo/docs/media/images/Index.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Interface.PNG b/krumo/docs/media/images/Interface.PNG
deleted file mode 100644
index e6cd51e..0000000
--- a/krumo/docs/media/images/Interface.PNG
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Interface_logo.png b/krumo/docs/media/images/Interface_logo.png
deleted file mode 100644
index 6f223c4..0000000
--- a/krumo/docs/media/images/Interface_logo.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/L.png b/krumo/docs/media/images/L.png
deleted file mode 100755
index eb334ed..0000000
--- a/krumo/docs/media/images/L.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Lminus.png b/krumo/docs/media/images/Lminus.png
deleted file mode 100755
index f7c43c0..0000000
--- a/krumo/docs/media/images/Lminus.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Lplus.png b/krumo/docs/media/images/Lplus.png
deleted file mode 100755
index 848ec2f..0000000
--- a/krumo/docs/media/images/Lplus.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Method.png b/krumo/docs/media/images/Method.png
deleted file mode 100755
index 9b21578..0000000
--- a/krumo/docs/media/images/Method.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Page.png b/krumo/docs/media/images/Page.png
deleted file mode 100755
index ffe7986..0000000
--- a/krumo/docs/media/images/Page.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Page_logo.png b/krumo/docs/media/images/Page_logo.png
deleted file mode 100755
index 44ce0b3..0000000
--- a/krumo/docs/media/images/Page_logo.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/PrivateClass.png b/krumo/docs/media/images/PrivateClass.png
deleted file mode 100755
index 470e6d5..0000000
--- a/krumo/docs/media/images/PrivateClass.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/PrivateClass_logo.png b/krumo/docs/media/images/PrivateClass_logo.png
deleted file mode 100755
index 590e006..0000000
--- a/krumo/docs/media/images/PrivateClass_logo.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/PrivateMethod.png b/krumo/docs/media/images/PrivateMethod.png
deleted file mode 100755
index d01f2b3..0000000
--- a/krumo/docs/media/images/PrivateMethod.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/PrivateVariable.png b/krumo/docs/media/images/PrivateVariable.png
deleted file mode 100755
index d76b21d..0000000
--- a/krumo/docs/media/images/PrivateVariable.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/StaticMethod.png b/krumo/docs/media/images/StaticMethod.png
deleted file mode 100644
index 9b21578..0000000
--- a/krumo/docs/media/images/StaticMethod.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/StaticVariable.png b/krumo/docs/media/images/StaticVariable.png
deleted file mode 100644
index 8e82019..0000000
--- a/krumo/docs/media/images/StaticVariable.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/T.png b/krumo/docs/media/images/T.png
deleted file mode 100755
index 3017325..0000000
--- a/krumo/docs/media/images/T.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Tminus.png b/krumo/docs/media/images/Tminus.png
deleted file mode 100755
index 2260e42..0000000
--- a/krumo/docs/media/images/Tminus.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Tplus.png b/krumo/docs/media/images/Tplus.png
deleted file mode 100755
index 2c8d8f4..0000000
--- a/krumo/docs/media/images/Tplus.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/Variable.png b/krumo/docs/media/images/Variable.png
deleted file mode 100755
index 8e82019..0000000
--- a/krumo/docs/media/images/Variable.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/blank.png b/krumo/docs/media/images/blank.png
deleted file mode 100755
index cee9cd3..0000000
--- a/krumo/docs/media/images/blank.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/class_folder.png b/krumo/docs/media/images/class_folder.png
deleted file mode 100755
index 84e9587..0000000
--- a/krumo/docs/media/images/class_folder.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/empty.png b/krumo/docs/media/images/empty.png
deleted file mode 100755
index d568386..0000000
--- a/krumo/docs/media/images/empty.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/file.png b/krumo/docs/media/images/file.png
deleted file mode 100755
index 0bb2427..0000000
--- a/krumo/docs/media/images/file.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/folder.png b/krumo/docs/media/images/folder.png
deleted file mode 100755
index a2d79f8..0000000
--- a/krumo/docs/media/images/folder.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/function_folder.png b/krumo/docs/media/images/function_folder.png
deleted file mode 100755
index 8b3d6e3..0000000
--- a/krumo/docs/media/images/function_folder.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/minus.gif b/krumo/docs/media/images/minus.gif
deleted file mode 100755
index f502662..0000000
--- a/krumo/docs/media/images/minus.gif
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/next_button.png b/krumo/docs/media/images/next_button.png
deleted file mode 100755
index cdbc615..0000000
--- a/krumo/docs/media/images/next_button.png
+++ /dev/null
Binary files 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 4a11780..0000000
--- a/krumo/docs/media/images/next_button_disabled.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/package.png b/krumo/docs/media/images/package.png
deleted file mode 100755
index b04cf56..0000000
--- a/krumo/docs/media/images/package.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/package_folder.png b/krumo/docs/media/images/package_folder.png
deleted file mode 100755
index 6162baf..0000000
--- a/krumo/docs/media/images/package_folder.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/plus.gif b/krumo/docs/media/images/plus.gif
deleted file mode 100755
index eeca02c..0000000
--- a/krumo/docs/media/images/plus.gif
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/previous_button.png b/krumo/docs/media/images/previous_button.png
deleted file mode 100755
index 327fdbc..0000000
--- a/krumo/docs/media/images/previous_button.png
+++ /dev/null
Binary files 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 c02ff64..0000000
--- a/krumo/docs/media/images/previous_button_disabled.png
+++ /dev/null
Binary files 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 590e006..0000000
--- a/krumo/docs/media/images/private_class_logo.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/tutorial.png b/krumo/docs/media/images/tutorial.png
deleted file mode 100755
index bc19737..0000000
--- a/krumo/docs/media/images/tutorial.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/tutorial_folder.png b/krumo/docs/media/images/tutorial_folder.png
deleted file mode 100755
index 2a468b2..0000000
--- a/krumo/docs/media/images/tutorial_folder.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/images/up_button.png b/krumo/docs/media/images/up_button.png
deleted file mode 100755
index ff36c59..0000000
--- a/krumo/docs/media/images/up_button.png
+++ /dev/null
Binary files differ
diff --git a/krumo/docs/media/lib/classTree.js b/krumo/docs/media/lib/classTree.js
deleted file mode 100755
index 5989426..0000000
--- 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