web/wp-includes/class.wp-dependencies.php
changeset 204 09a1c134465b
parent 194 32102edaa81b
equal deleted inserted replaced
203:f507feede89a 204:09a1c134465b
   194 				unset($this->args[$handle[0]]);
   194 				unset($this->args[$handle[0]]);
   195 			}
   195 			}
   196 		}
   196 		}
   197 	}
   197 	}
   198 
   198 
   199 	function query( $handle, $list = 'registered' ) { // registered, queue, done, to_do
   199 
   200 		switch ( $list ) :
   200 	function query( $handle, $list = 'registered' ) {
   201 		case 'registered':
   201 		switch ( $list ) {
   202 		case 'scripts': // back compat
   202 			case 'registered' :
   203 			if ( isset($this->registered[$handle]) )
   203 			case 'scripts': // back compat
   204 				return $this->registered[$handle];
   204 				if ( isset( $this->registered[ $handle ] ) )
   205 			break;
   205 					return $this->registered[ $handle ];
   206 		case 'to_print': // back compat
   206 				return false;
   207 		case 'printed': // back compat
   207 
   208 			if ( 'to_print' == $list )
   208 			case 'enqueued' :
   209 				$list = 'to_do';
   209 			case 'queue' :
   210 			else
   210 				return in_array( $handle, $this->queue );
   211 				$list = 'printed';
   211 
   212 		default:
   212 			case 'to_do' :
   213 			if ( in_array($handle, $this->$list) )
   213 			case 'to_print': // back compat
   214 				return true;
   214 				return in_array( $handle, $this->to_do );
   215 			break;
   215 
   216 		endswitch;
   216 			case 'done' :
       
   217 			case 'printed': // back compat
       
   218 				return in_array( $handle, $this->done );
       
   219 		}
   217 		return false;
   220 		return false;
   218 	}
   221 	}
   219 
   222 
   220 	function set_group( $handle, $recursion, $group ) {
   223 	function set_group( $handle, $recursion, $group ) {
   221 		$group = (int) $group;
   224 		$group = (int) $group;
   242 	var $args = null;
   245 	var $args = null;
   243 
   246 
   244 	var $extra = array();
   247 	var $extra = array();
   245 
   248 
   246 	function __construct() {
   249 	function __construct() {
   247 		@list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args();
   250 		@list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args();
   248 		if ( !is_array($this->deps) )
   251 		if ( ! is_array($this->deps) )
   249 			$this->deps = array();
   252 			$this->deps = array();
   250 	}
   253 	}
   251 
   254 
   252 	function add_data( $name, $data ) {
   255 	function add_data( $name, $data ) {
   253 		if ( !is_scalar($name) )
   256 		if ( !is_scalar($name) )